-
Notifications
You must be signed in to change notification settings - Fork 658
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
Metric naming conventions reasoning #3207
Comments
It is part of the metrics specification https://github.com/open-telemetry/opentelemetry-specification/blob/ec84e5dcd77f36e79c0fe9bb1444d62be79dbb38/specification/metrics/api.md#instrument-name-syntax |
Does case insensitive imply that My point being is that |
That is not explicitly specified in the spec so there are different ways of implementing. Java does this, which means it ignores the case when aggregating metrics from instruments with equivalent names: if
Yes, @srikanthccv @lzchen @aabmass I think we are being compliant with what is being specified here, WDYT? |
From personal experience on our team we were caught off guard when we found out that |
The metrics API/SDK specification left room for implementation flexibility and interpretation. It says
The Python SDK implementation returns the same instrument if the metric identity if already seen
And it helps us with the
We can probably export as-is when only one instrument is registered. So what do you do when duplicate instruments are registered? There are multiple options here
Since it's not explicitly specified, any option is acceptable IMO, and SDK chose the first regardless of the duplication. If a backend says it supports OTLP protocol, should it also keep the case-insensitive search? |
Thank you for the explanation as it makes a lot of sense and is very helpful. Due to the SDK lowercasing the instrument names in case of duplicate instrument handling, is it recommended to use all lowercase instrument names in the first place so we know what to expect? |
I would suggest doing that. I am also open to the idea of SDK using the case of the first registered instrument in case of duplicates. And I think it should be technically possible to create two instruments with the same name but different casing and then use views to modify the resulting metric name.
I believe this is the issue created to address that #2558. |
Describe your environment I am currently using the Python SDK for a sample app that creates metrics instruments like Counter, UpDownCounter, and etc. When my metrics were exported to Cloudwatch, I noticed that the metric names are all lowercase so I checked the SDK and found here that metric names are converted to all lowercase for some reason. I was wondering why the metric names are converted to lowercase, and is this the naming convention we should follow? If so, should this be documented somewhere? Thank you.
The text was updated successfully, but these errors were encountered: