-
Notifications
You must be signed in to change notification settings - Fork 692
Add ability to drop instance label from span metrics #5706
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
Changes from 4 commits
14bc00f
c7d82dd
2c19f5f
c041a80
7f024d5
651841d
5e0fd06
ed75ec4
2a81c5c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -55,6 +55,7 @@ linters: | |
| - linters: | ||
| - goconst | ||
| - gosec | ||
| - forbidigo | ||
| path: (.+)_test\.go | ||
| paths: | ||
| - third_party$ | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -206,7 +206,7 @@ func (p *Processor) aggregateMetricsForSpan(svcName string, jobName string, inst | |
| labelValues = append(labelValues, jobName) | ||
| } | ||
| // add instance label only if job is not blank | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not related to your code but this comment looks like its wrong.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah this is a chance to the original requirement. I will change the comments. |
||
| if instanceID != "" && p.Cfg.EnableTargetInfo { | ||
| if instanceID != "" && p.Cfg.EnableTargetInfo && !p.Cfg.DropInstanceLabel { | ||
| labels = append(labels, dimInstance) | ||
| labelValues = append(labelValues, instanceID) | ||
| } | ||
|
|
@@ -246,7 +246,7 @@ func (p *Processor) aggregateMetricsForSpan(svcName string, jobName string, inst | |
| targetInfoLabelValues = append(targetInfoLabelValues, jobName) | ||
| } | ||
| // add instance label to target info only if job is not blank | ||
| if instanceID != "" { | ||
| if instanceID != "" && !p.Cfg.DropInstanceLabel { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same comment issue here. |
||
| targetInfoLabels = append(targetInfoLabels, dimInstance) | ||
| targetInfoLabelValues = append(targetInfoLabelValues, instanceID) | ||
| } | ||
|
|
||
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.
@rlankfo isn't instance semi required for
target_infoto work correctly?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.
IE when we go to set the value on the Gauge your likely to override/not override appropriately in SetForTargetInfo
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.
can you explain why it would not work appropriately?
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.
the original requirement also states that if instance is empty to skip it entirely, which sounds to me like it's not a hard requirement.
Uh oh!
There was an error while loading. Please reload this page.
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 there is not a job or instance then the metric will never get recorded, which feels like different behavior than reducing cardinality. The change in behavior would be if there is no job label and drop instance is true then the metric will not be recorded, whereas previously it would be. Though granted that should be pretty rare that a
service.name(job) is not declared.