-
Notifications
You must be signed in to change notification settings - Fork 544
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
Add job & instance labels to span metrics, a new target_info metrics, and the ability to customize dimension label mapping #2261
Conversation
@ie-pham thanks for this great news.
|
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.
Left a few comments. Please correct me if I'm wrong, I'm no expert in the requirements for target_info
.
Is this change drifting this component further away from the upstream component? Is there an intention of converging them into one? |
@ie-pham Do we need documentation for this? It looks like new features that need content. |
yes we do, can you point me to where i need to update this? |
Also this will cause an increase in cardinality because we are not including |
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.
So w/o finding every line I've noticed that some of these changes will impact existing cloud users. Specifically the changes will increase cardinality and impact their bill. We either need the defaults to not change the metrics that are being produced or we need to communicate this change in advance in some clear and official way to our cloud users.
Will look to @gouthamve to provide guidance.
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'm happy with the changes from an OTel perspective, as I understand they will indeed bring this closer to the expected pipelines in upstream (otelcol with span to metrics connector and Prometheus exporter)
@gouthamve @jpkrohling @kovrus can the user disable job and instance? |
What is the motivation behind that? Those are generated by Prometheus remote write, it is not possible to disable it manually, but if the |
@ie-pham is it possible to add some tests for the target info generation? |
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 looks good to me. Nice work. A couple comments but otherwise I'm +1 here.
p.spanMetricsCallsTotal.UpdateLabels(p.labels) | ||
p.spanMetricsDurationSeconds.UpdateLabels(p.labels) | ||
p.spanMetricsSizeTotal.UpdateLabels(p.labels) | ||
p.spanMetricsTargetInfo.UpdateLabels(p.targetInfoLabels) |
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.
Not sure if this is thread-safe. Batches can be concurrently pushed to a processor. If a set of traces has instance_id
, and other doesn't, how does that affect all the labels that are being mutated in the metrics and the processor itself (eg. line 174)?
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.
good catch! i made some changes and added tests for this scenario but yeah I'm not sure how to handle concurrency. Do you have any recommendations on how to handle it?
… and the ability to customize dimension label mapping (grafana#2261) * add job, instance, target_info * add test & gofmt * fmt & test * fix e2e test * add custom dimension mapping * updated test for custom mapping and changelog * fmt * changed the dimension mapping logic * fix test * update logic for job instance * fix test & lint * add service back and add gauge for target_info * added overrides and docs * undo config test change * typo * change traces_spanmetrics_target_info to just target_info * lint * fix overrides * handle batches with different resource attributes * redo counter * refactor registry * refactor label pair * oops * oops * rebase mishap * remove job instance by default * refactor * rebase hell * count * lint * remove arbitary number * traces_target_info * comments * sanitize labels for target info * small refactor to improve perf * rebased * rebased
…2447) * Add config param for autocomplete filtering (#2433) * Add config param for autocomplete filtering * Docs * Fix * Fix test * Address comments * Add job & instance labels to span metrics, a new target_info metrics, and the ability to customize dimension label mapping (#2261) * add job, instance, target_info * add test & gofmt * fmt & test * fix e2e test * add custom dimension mapping * updated test for custom mapping and changelog * fmt * changed the dimension mapping logic * fix test * update logic for job instance * fix test & lint * add service back and add gauge for target_info * added overrides and docs * undo config test change * typo * change traces_spanmetrics_target_info to just target_info * lint * fix overrides * handle batches with different resource attributes * redo counter * refactor registry * refactor label pair * oops * oops * rebase mishap * remove job instance by default * refactor * rebase hell * count * lint * remove arbitary number * traces_target_info * comments * sanitize labels for target info * small refactor to improve perf * rebased * rebased --------- Co-authored-by: Jennie Pham <[email protected]>
What this PR does: Add the
service
label tojob
in span metrics and addinstance
as additional intrinsic dimensions. Add feature to allow custom dimension label mapping.Dimension Mapping config:
Decisions for target_info/job/instance:
#2261 (comment)
Make sure this is a non-breaking change
Which issue(s) this PR fixes:
Fixes #
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]