open-telemetry / opentelemetry-python

OpenTelemetry Python API and SDK
https://opentelemetry.io
Apache License 2.0
1.67k stars 569 forks source link

Fix prometheus metric name and unit conversion #3924

Closed aabmass closed 1 month ago

aabmass commented 1 month ago

[!IMPORTANT]
This is a breaking change. This PR changes the output prometheus metric names, but the API is not changed.

Description

Fixes https://github.com/open-telemetry/opentelemetry-python/issues/2938

Updates the prometheus exporter name conversion to match the specification by implementing a few fixes:

Type of change

Please delete options that are not relevant.

How Has This Been Tested?

I added a ton of test cases. Many were copied from the collector's test cases. I also added tests for semconv metrics so we can be sure what they will look like.

Does This PR Require a Contrib Repo Change?

Checklist:

jeremydvoss commented 1 month ago

This PR appears to be facing the same spelling issue as mine. Every "assertIn" is now marked as incorrect spelling. How do we add words to the dictionary. Is it just the ignore list in .codespellrc?

lzchen commented 1 month ago

This PR appears to be facing the same spelling issue as mine. Every "assertIn" is now marked as incorrect spelling. How do we add words to the dictionary. Is it just the ignore list in .codespellrc?

https://github.com/open-telemetry/opentelemetry-python/pull/3930