-
Notifications
You must be signed in to change notification settings - Fork 581
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 instrument types in system metrics #2865
base: main
Are you sure you want to change the base?
Conversation
Don't have much clue about metrics but the generated semantic conventions package provides some helper functions to creates these metrics, and they return |
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.
From specs:
I want to measure something (by reporting an absolute value):
- If the measurement values are non-additive, use an Asynchronous Gauge.
If the measurement values are additive:
- If the value is monotonically increasing - use an Asynchronous Counter.
- If the value is NOT monotonically increasing - use an Asynchronous UpDownCounter.
So I think the UpDownCounter
is correct no?
@xrmx @emdneto Thanks for taking a look at the PR. The issue is not with UpDownCounter, but the temporality used by ObservableUpDownCounter. From the definition, ObservableUpDownCounter is cumulative, while these metrics are delta.
Changing them from ObservableUpDownCounter to UpDownCounter should also fix the issue. I actually want to take back my words on using UpDownCounter. By checking the specification of UpDownCounter, it's more appropriate to use when the metrics are emitted using I understand it deviates from the semantic conventions, but I also want to ask for a second thought based on the actual collection process. |
Description
This PR fixes the instrument types when creating the system metrics.
Metrics that are impacted:
Collected from psutil.net_connections is a snapshot of the current state of network connections, thus should be delta and is not monotonic.
Collected from python gc is the current collection counts, thus should be delta and is not monotonic.
Collected from psutil.Process.memory_info is a snapshot of the process’s memory usage at the time of the call, thus should be delta and is not monotonic.
Collected from psutil.Process.num_threads is the number of threads currently used by this process (non cumulative).
Collected from psutil.Process.num_fds is the number of file descriptors currently opened by this process (non cumulative).
Change the instrument types for the metrics above to
observable_gauge
for correction.Fixes #2861
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
delta
temporality for all the metric types.Does This PR Require a Core Repo Change?
Checklist:
See contributing.md for styleguide, changelog guidelines, and more.