-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
update OTLP proto to v0.9.0 #3740
update OTLP proto to v0.9.0 #3740
Conversation
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.
Looking at the changeset open-telemetry/opentelemetry-proto@v0.8.0...v0.9.0 it seems like there are a couple more things that will need to be added:
- schema_url
- bytes data type
Will these be added in a future PR? (I think that would be best to keep this one small).
model/internal/otlp_wrapper.go
Outdated
func numberDataPointsLabelsToAttributes(dps []*otlpmetrics.NumberDataPoint) { | ||
for i, _ := range dps { | ||
if dps[i].Labels != nil { | ||
dps[i].Attributes = labelsToAttributes(dps[i].Labels) |
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.
To clarify: numberDataPointsLabelsToAttributes and its callers do not attempt to merge Labels
and Attributes
. The assumption is that the source data is in the old format so Attributes
should be empty?
Is that true and is that how MetricsCompatibilityChanges
is used in the codebase? If so can we clarify this somewhere in the comments?
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 has been moved out of this PR, but I think it's an important point to clarify. Based on the comments in the proto, https://github.com/open-telemetry/opentelemetry-proto/blob/48ca003a72365f5591f1acd9b065ea8316be2ade/opentelemetry/proto/metrics/v1/metrics.proto#L307-L312 what are your thoughts on the right way to move forward? I suppose we can either:
- assume the Attributes are empty and override them with labels
- upsert Labels into Attributes
- insert Labels that are not present only
3 seems to make the most sense to me, but it's not a strong preference.
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 would say we need to assume Attributes is empty:
Users cannot constructor custom protos since they are hidden. This case can happen only when we receive from the wire. So MetricsCompatibilityChanges
is only called from data received on the wire which can be in new or old format but not a mix.
Depends how backwards compatible we want to be:
- If only labels is set we upsert everything to the Attributes
- If both are received the expectation is that they are the same, do nothing
- If only attributes is received then do nothing.
On the sent side:
- If we want to do the correct thing we should translate attributes to labels and send both, but this is not what we did with IntSum/IntGauge. So maybe just a CHANGELOG entry and say that we broke this?
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.
Got it.
When receiving:
- we should check if both labels and attributes are set, if so, don't do anything
- if labels are set, upsert into attributes and leave labels as is.
- don't do anything with the attributes only case.
When exporting, should labels always be dropped here? I worry that we would end up with inconsistent behaviour if labels are sometimes set and sometimes not.
Yes that's correct, I'm only trying to do the bare minimum to get the tests passing w/ OTLP v0.9.0, I've added the rest to a task list on this PR's description, though they should probably go in the main issue #3535, but I don't have permission to add tasks there. |
9346b16
to
adcd7a2
Compare
Please rebase, and make more granular changes :) |
bccda7d
to
1b349bb
Compare
@bogdandrutu done, will add separate PRs for converting labels to attributes. |
2beb787
to
54b1110
Compare
54b1110
to
e839f7d
Compare
Adapt code to changes in core: - config.experimental.configsource.Watchable interface open-telemetry/opentelemetry-collector#3792 - Rename CustomUnmarshable to Unmarshallable open-telemetry/opentelemetry-collector#3774 - Switched metrics from Value() to DoubleVal() open-telemetry/opentelemetry-collector#3740
* Bump smart agent version to v5.11.3 * Update CHANGELOG.md * Update core/contrib deps * Fix broken code due to renaming of CustomUnmarshable to Unmarshallable * Fix broken code due to renaming of CustomUnmarshable to Unmarshallable * Revert "Fix broken code due to renaming of CustomUnmarshable to Unmarshallable" This reverts commit de03f5e. * Revert "Fix broken code due to renaming of CustomUnmarshable to Unmarshallable" This reverts commit e09a9e3. * Update code according to changes in core Adapt code to changes in core: - config.experimental.configsource.Watchable interface open-telemetry/opentelemetry-collector#3792 - Rename CustomUnmarshable to Unmarshallable open-telemetry/opentelemetry-collector#3774 - Switched metrics from Value() to DoubleVal() open-telemetry/opentelemetry-collector#3740 Co-authored-by: Eyal Maderer <emaderer@splunk.com> Co-authored-by: Dmitry <anoshindx@gmail.com>
// The aggregation value is over the time interval (start_time_unix_nano, | ||
// time_unix_nano]. | ||
// This field will be removed in ~3 months, on July 1, 2021. | ||
Labels []v11.StringKeyValue `protobuf:"bytes,1,rep,name=labels,proto3" json:"labels"` // Deprecated: Do not use. |
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.
Has the Labels field been removed in the latest version? We still use the old version of the collector in some places. Is there any way to make it compatible?
Description:
Update opentelemetry-proto to v0.9.0. As part of the change:
StringKeyValue
Link to tracking Issue: Part of #3535
This is built on top of #3735
Remaining work once this PR is done:
FilteredLabels
toFilteredAttributes
translate FilteredLabels to FilteredAttributes #3822