-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Integrate collector with new metadata api #858
Conversation
Signed-off-by: Sean Porter <[email protected]>
Signed-off-by: Sean Porter <[email protected]>
Signed-off-by: Sean Porter <[email protected]>
Signed-off-by: Sean Porter <[email protected]>
Signed-off-by: Sean Porter <[email protected]>
Signed-off-by: Sean Porter <[email protected]>
Signed-off-by: Sean Porter <[email protected]>
Signed-off-by: Sean Porter <[email protected]>
Signed-off-by: Sean Porter <[email protected]>
Signed-off-by: Sean Porter <[email protected]>
Signed-off-by: Sean Porter <[email protected]>
Signed-off-by: Sean Porter <[email protected]>
Signed-off-by: Sean Porter <[email protected]>
Signed-off-by: Sean Porter <[email protected]>
Signed-off-by: Sean Porter <[email protected]>
Signed-off-by: Sean Porter <[email protected]>
Signed-off-by: Sean Porter <[email protected]>
Signed-off-by: Sean Porter <[email protected]>
…rk proxy info Signed-off-by: Sean Porter <[email protected]>
Signed-off-by: Sean Porter <[email protected]>
Signed-off-by: Sean Porter <[email protected]>
Signed-off-by: Sean Porter <[email protected]>
Signed-off-by: Sean Porter <[email protected]>
Signed-off-by: Sean Porter <[email protected]>
Signed-off-by: Sean Porter <[email protected]>
Signed-off-by: Sean Porter <[email protected]>
// Copyright The OpenTelemetry Authors | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package api | ||
|
||
type OpenMetadataHostDetails struct { | ||
Name string `json:"name"` | ||
OsName string `json:"osName"` | ||
OsVersion string `json:"osVersion"` | ||
Environment string `json:"environment"` | ||
} | ||
|
||
type OpenMetadataCollectorDetails struct { | ||
RunningVersion string `json:"runningVersion"` | ||
} | ||
|
||
type OpenMetadataNetworkDetails struct { | ||
HostIpAddress string `json:"hostIpAddress"` | ||
} | ||
|
||
type OpenMetadataRequestPayload struct { | ||
HostDetails OpenMetadataHostDetails `json:"hostDetails"` | ||
CollectorDetails OpenMetadataCollectorDetails `json:"collectorDetails"` | ||
NetworkDetails OpenMetadataNetworkDetails `json:"networkDetails"` | ||
TagDetails map[string]interface{} `json:"tagDetails"` | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we going to change api in the futher? Do we need any kind of versioning?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't believe so, there may be additional fields. I used registration for reference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me overall, left some minor comments.
|
||
se.logger.Info("Updating collector metadata", | ||
zap.String("URL", u.String()), | ||
zap.String("body", buff.String())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we're going to log this, we should make sure that it's human-readable. Setting an indentation level on the encoder should suffice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Zap String() doesn't pretty print it as expected, for example: {\n\t\t\"runningVersion\":
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This logging is really for our own testing, it should moved to debug or be removed when we remove the feature gate.
Co-authored-by: Mikołaj Świątek <[email protected]>
Signed-off-by: Sean Porter <[email protected]>
Signed-off-by: Sean Porter <[email protected]>
Signed-off-by: Sean Porter <[email protected]>
Integrated the collector with the new metadata API. Update the collector's metadata on every process start, before the heartbeat loop is initialized. Metadata is important to the user experience, errors result in retries with back-off.
Spec doc.
Jira ticket.
This feature uses a gate (for now), you must enable it via the CLI with the
--feature-gates
flag. For example: