fix(opentelemetry-exporter-prometheus)!: apply ratio suffix to gauges when necessary#6613
fix(opentelemetry-exporter-prometheus)!: apply ratio suffix to gauges when necessary#6613cjihrig wants to merge 2 commits intoopen-telemetry:mainfrom
Conversation
|
|
||
| // Prometheus requires that metrics of the Counter kind have "_total" suffix | ||
| if ( | ||
| !name.endsWith('_total') && |
There was a problem hiding this comment.
As a drive-by change, I switched the order of these checks to save the most expensive one for last.
|
Given that this is a breaking change would it be worth it to put this behind a configuration for some period of time, allowing users to retain backwards compatibility for some time if needed? This is an experimental component so breaking changes technically allowed, but it might be good to be a bit cautious here. |
I'll defer to you and the other maintainers on that. It's probably a good idea because I'd like to look into some of the other discrepancies such as replacing |
Ping @dyladan |
|
I would not encode
I'd give these configs with obvious names too. Documenting them together should be sufficient to indicate they are meant to all be enabled together. It also gives people the ability to control when each breaking change occurs. We're going to be releasing a 3.x soon anyway so it will be a good opportunity to change the settings to default on. |
|
Hey 👋 This conversion was recently removed from the spec 😬
Right now it is experimental, the Prometheus SIG is working towards stabilizing it though :) |
Which problem is this PR solving?
When converting OTLP metrics to Prometheus,
_ratioshould be appended to gauges whose unit is"1".Here is the corresponding code in the Golang library (it is a Prometheus library used by the OTLP library). Here is the OTLP Golang unit test and corresponding test output snapshot.
There are a fairly significant amount of other similar changes missing from the JavaScript library that I'd like to work on, but I wanted to start with a small change to see how it would be received. However, because they can change the names of the output metrics, they would be breaking changes.
Fixes # N/A but found when looking into #6605
Short description of the changes
This commit appends the
_ratiosuffix to gauges as necessary.Type of change
How Has This Been Tested?
Checklist: