-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
feat: add support for MetricTypeSum #37156
base: main
Are you sure you want to change the base?
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.
lgtm after lint errors are fixed
I’m encountering inconsistent behavior with the |
I finally identified the issue: The test function When the For example, consider the following labels:
First Execution
The corresponding map will look like this: {
series_name_1: 1,
value-1: 2,
__name__: 3,
sum_1: 4,
series_name_2: 5,
value-2: 6
} Thus, the
Second Execution Now, if the labels arrive in a different order, such as:
The updated map will become: {
series_name_1: 1,
value-1: 2,
__name__: 3,
sum_1: 4,
series_name_2: 5,
value-2: 6,
gauge_1: 9
} the final
The issue with the current approach is that the outcome of the second execution is directly influenced by the order of labels processed in the first execution. The simplest way that I found to address this, was sorting the labels before assigning the numerical reference. Is that makes sense? opentelemetry-collector-contrib/pkg/translator/prometheusremotewrite/metrics_to_prw_v2.go Lines 111 to 132 in 23117ab
|
Should the labels just be sorted before comparing in the test? If we aren't required to sort them for the protocol (or are we?), then we should probably avoid doing that? |
Taking a deep look into the places where we sort labels. We are already doing it inside opentelemetry-collector-contrib/pkg/translator/prometheusremotewrite/number_data_points_v2.go Lines 24 to 32 in ab56d0a
but we are doing that before add the What do you recommend in this case? I'm not sure if it's possible to sort the labels before comparing in the test. |
Description
Prometheus translation rw2 add support for MetricTypeSum.
The current work was inspired by #36353
Link to tracking issue #33661