-
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
[receiver/prometheusreceiver]: trim type and unit suffixes from metric name #16071
[receiver/prometheusreceiver]: trim type and unit suffixes from metric name #16071
Conversation
Can you put this behind the |
ea6b8fd
to
d8ca297
Compare
@dashpole I've guarded this with the featuregate as asked, and added some specific tests for this on the receiver side as well. |
Note that this case is valid in prometheus format, just not in OpenMetrics format. |
feb607f
to
9d23af1
Compare
That makes sense, reverted those tests changes :) |
9d23af1
to
c592716
Compare
354d892
to
79073b9
Compare
Seems like @dashpole do you mind retrying please? |
fdd1e62
to
5550604
Compare
…c name (open-telemetry#16071) Trim type's and unit's suffixes from metric name as per otel specs. There was a lot of changes required to pass down a featuregate.Registry in order to be testable. The important bit in the receiver code path is the metricFamily.appendMetric which trims the suffixes when creating an OTLP metric. Units suffixes will only take effect when using the OpenMetrics format, since the prometheus parser doesn't support units. This is being guarded by the gate: --feature-gates=pkg.translator.prometheus.NormalizeName
…c name (open-telemetry#16071) Trim type's and unit's suffixes from metric name as per otel specs. There was a lot of changes required to pass down a featuregate.Registry in order to be testable. The important bit in the receiver code path is the metricFamily.appendMetric which trims the suffixes when creating an OTLP metric. Units suffixes will only take effect when using the OpenMetrics format, since the prometheus parser doesn't support units. This is being guarded by the gate: --feature-gates=pkg.translator.prometheus.NormalizeName
Description: Trim type's and unit's suffixes from metric name as per otel specs.
There was a lot of changes required to pass down a
featuregate.Registry
in order to be testable. The important bit in the receiver code path is themetricFamily.appendMetric
which trims the suffixes when creating an OTLP metric.Units suffixes will only take effect when using the OpenMetrics format, since the prometheus parser doesn't support units.
This is being guarded by the gate:
--feature-gates=pkg.translator.prometheus.NormalizeName
Link to tracking Issue: #8950
Testing: Units tests were added for the translator package, and prometheus receiver tests updated.