-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Fix broken spanmetrics counters after span producing service restart #29711
Fix broken spanmetrics counters after span producing service restart #29711
Conversation
don't include things like process pid etc. Signed-off-by: Sean Porter <portertech@gmail.com>
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.
Please add a changelog
Signed-off-by: Sean Porter <portertech@gmail.com>
Signed-off-by: Sean Porter <portertech@gmail.com>
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.
Thanks! I think this might also be useful in limiting memory/cpu resources; which seems to be coming up as issues recently.
Added a couple of comments.
Signed-off-by: Sean Porter <portertech@gmail.com>
Signed-off-by: Sean Porter <portertech@gmail.com>
Signed-off-by: Sean Porter <portertech@gmail.com>
Signed-off-by: Sean Porter <portertech@gmail.com>
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 overall! Just some nits.
Thanks for making it configurable by the way!
Co-authored-by: Albert <26584478+albertteoh@users.noreply.github.com>
Signed-off-by: Sean Porter <portertech@gmail.com>
Signed-off-by: Sean Porter <portertech@gmail.com>
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.
Thanks!
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.
Just some minor optimisations and clarification have behaviour, otherwise, seems reasonable to me.
… attributes Signed-off-by: Sean Porter <portertech@gmail.com>
Added @portertech (me) to connector/spanmetrics codeowners. Supporters: @djaglowski, @albertteoh Recent relevant PR: #29711 Signed-off-by: Sean Porter <portertech@gmail.com>
…pen-telemetry#29711) My spanmetrics counters (e.g. `calls_total`) break after restarting the span producing service. For example: ![Screenshot from 2023-12-06 11-39-57](https://github.com/open-telemetry/opentelemetry-collector-contrib/assets/149630/abea1b72-392b-4f1f-a403-644c4e356f3d) I discovered that the resource key used for the calculated metrics was a map hash of the resource attributes. This worked fine for some instrumented services, however, other services include attributes like its process id etc. Restarting one of these services would result in a new hash and calculated resource metrics (in addition to the existing ones). This pull-request filters the resource attributes used to produce the resource metrics key map hash. I am now able to restart services without breaking my counters. --------- Signed-off-by: Sean Porter <portertech@gmail.com> Co-authored-by: Albert <26584478+albertteoh@users.noreply.github.com>
…ry#30401) Added @portertech (me) to connector/spanmetrics codeowners. Supporters: @djaglowski, @albertteoh Recent relevant PR: open-telemetry#29711 Signed-off-by: Sean Porter <portertech@gmail.com>
My spanmetrics counters (e.g.
calls_total
) break after restarting the span producing service.For example:
I discovered that the resource key used for the calculated metrics was a map hash of the resource attributes. This worked fine for some instrumented services, however, other services include attributes like its process id etc. Restarting one of these services would result in a new hash and calculated resource metrics (in addition to the existing ones).
This pull-request filters the resource attributes used to produce the resource metrics key map hash. I am now able to restart services without breaking my counters.