-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Handle scope name version #38413
Handle scope name version #38413
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.
We also have a test case called duplicated scope name and version
at the top of TestTranslatev2. It would be nice if it were grouped together with the new test at the bottom. While you're at it, could you also add comments with the index positions? It's hard to look at the labelsRef and immediately understand which labels they represent 😛
Also, rereading it, I feel like duplicated...
sounds confusing 🤔 Where is the duplication? Something like timeseries with different scopes
sounds more appropriate
scopeName := prw.settings.BuildInfo.Description | ||
scopeVersion := prw.settings.BuildInfo.Version | ||
|
||
if sName := ls.Get("otel_scope_name"); sName != "" { | ||
scopeName = sName | ||
} | ||
|
||
if sVersion := ls.Get("otel_scope_version"); sVersion != "" { | ||
scopeVersion = sVersion | ||
} |
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.
Could we make this a function? We'll repeat this code in all Add...Datapoints
calls, so we might as well make this reusable instead of duplicated
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.
fixed here 91fd77c
Fixed cc705d5, looking directly in the git diff it's a little bit hard to understand that I just changed the order. Maybe will be easy to understand if you "open the branch" |
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.
Fixed cc705d5, looking directly in the git diff it's a little bit hard to understand that I just changed the order. Maybe will be easy to understand if you "open the branch"
Yeah, I did that :) Looks good
The failing test seems to be unrelated to your change.
Description
This PR ensures that when Prometheus samples lack the otel_scope_name or otel_scope_version labels, the receiver fills in default values.
It take care of part of #37277