-
Notifications
You must be signed in to change notification settings - Fork 889
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
Make http.status_code metric attribute an int #2943
Conversation
because metrics are sensitive to cardinality, I've seen instrumentations using strings like 4xx, 5xx for status code. |
I am wondering if there should be 2 attributes to cover that, i.e. |
Interesting. I think it would be ideal if the edit: Ignore me 😄 I had not refreshed and seen same comment from @svrnm. |
status_code_class is better, since it's the official name (see https://datatracker.ietf.org/doc/html/rfc9110#section-15), I am wondering if it should be "1xx", "2xx", etc or "Informational", "Successful", etc? |
Good question. Opened open-telemetry/semantic-conventions#1056 for follow up. |
@jsuereth I saw this only today, and couldn't join the semconv wg meeting, but shouldn't this be seen as a breaking change?
I'm not sure if it was discussed the change of attribute types in the last meeting being a breaking change. Looking at Another point to consider is, a It seems to me that the original issue was brought up due to the inconsistency between traces and metrics semconvs, but I'm failing to see a real use-case why the dimension should be an int. What value would this change bring? Maybe we should focus more on that instead of just fixing the inconsistency. I my view it's OK they are different types, since metric systems might not handle typed dimension values anyway and have to stringify it. |
No, for Prometheus Exporter, the integer |
@reyang right, Prometheus was just one example, but did we (or should we) consider metric back-ends that don't support non-string attribute values? If users of such back-ends are already using instrumentation libraries that sends this as strings and rely on the attribute being a string for their dashboards/alerts, by moving forward with this, we are essentially breaking them or am I missing something? |
Changing type from string to int is a breaking change IMHO (@jsuereth FYI). We shouldn't encourage such change once the semantic convention is Stable. For this particular case, I would highly encourage/support aligning the types at Experimental stage. |
Just to chime in, agree with @reyang here. For us to get HTTP semantic conventions stable we need to go through the differences between Trace/Metrics and align them. This is a breaking change, but hopefully one of the few we need to make prior to HTTP stability. |
Fixes #2855
The trace semantic conventions have a nice
Type
column. The metric conventions does not. It'd be nice if the structure of these tables matched. I'd be happy follow up with with this, but for now I wanted to make the smallest possible change to make sure we agreehttp.status_code
should be an integer attribute.