Uh oh!
There was an error while loading. Please reload this page.
Modify Prometheus exporter to translate non-monotonic Sums into gauges - #3306
Conversation
4777f46 to
01fc016CompareAdd unit tests for translating monotonic and non-monotonic Sums to prometheus metrics Update prometheus metric translation to match spec Added a check for the aggregation temporality of a Sum. "If the aggregation temporality is cumulative and the sum is non-monotonic, it MUST be converted to a Prometheus Gauge." Update changelog
01fc016 to
ca4eb1fCompare64110c1 to
0ceeea2CompareUh oh!
There was an error while loading. Please reload this page.
brettimus
commented
Jun 12, 2023
hey all! would it be possible to approve and/or merge this before the next release? i contribute to an open source lib that would benefit from this fix thank you!! |
Uh oh!
There was an error while loading. Please reload this page.
brettimus
commented
Jun 26, 2023
hi there! the only issue in the last run of the workflows had to do with linting afaik. i just ran (sorry for that hiccup by the way) |
aabmass
commented
Jul 10, 2023
@brettimus looks like there are build failures, could you take a look? |
brettimus
commented
Jul 14, 2023
looks like i needed to update my new test after #3279 was merged everything is green again locally! though i'm sad i didn't get to this sooner. i missed the release by a day! |
brettimus
commented
Jul 17, 2023
brettimus
commented
Jul 20, 2023
heck yeah! all green 🟢 |

Description
This PR modifies the prometheus exporter code that translates OpenTelemetry metrics into Prometheus metrics.
Prometheus has the concept of a Gauge, which is effectively a non-monotonic Sum. (In the world of Prometheus, a monotonic Sum is called a Counter.)
At present, the code that translates OTEL metrics into Prometheus metrics currently treats all Sums as Prometheus "Counters", regardless of their monotonicity.
Quoting @dashpole in issue #3071
Therefore, I've modified the Prometheus exporter to always convert non-monotonic Sums (with cumulative aggregation temporality) into Prometheus Gauges.
Fixes#3071
Type of change
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
tox -e opentelemetry-exporter-prometheustox -e lintDoes This PR Require a Contrib Repo Change?
Answer the following question based on these examples of changes that would require a Contrib Repo Change:
The OTel specification has changed which prompted this PR to update the method interfaces of
opentelemetry-api/oropentelemetry-sdk/The method interfaces of
test/utilhave changedScripts in
scripts/that were copied over to the Contrib repo have changedConfiguration files that were copied over to the Contrib repo have changed (when consistency between repositories is applicable) such as in
pyproject.tomlisort.cfg.flake8When a new
.github/CODEOWNERis addedMajor changes to project information, such as in:
README.mdCONTRIBUTING.mdYes. - Link to PR:
No.
Checklist: