-
Notifications
You must be signed in to change notification settings - Fork 897
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
Permit non-alphabetic characters as the 1st character in metric names #4371
Comments
👍 |
hey thanks for your proposal, this needs a broader discussion, I recommend that you attend the SIG meeting to get some feedback: https://github.com/open-telemetry/community/?tab=readme-ov-file#specification-sigs |
Previous relevant Issue/PR that removed some restriction on metric name : #3422 This keeps coming up. "/" is now allowed, but there are asks to support longer-than-63 length, ":", " " (space), "\" (back slash) And this issue which is asking to relax 1st character restriction. Will join the next Spec SIG meeting to discuss how to unblock users. |
Spec meeting (Jan 28) notes:
@dashpole can help with questions related to Prometheus compatibility. |
Prometheus' standard restrictions prevent metric names from starting with a number, and the character restrictions only otherwise allow letters and underscores. With prometheus' UTF-8 support that is rolling out, any valid UTF-8 names can be used. It does mean a different query syntax is needed (but this is needed for most names anyways):
We don't currently have an escaping strategy specified for metric names, but for labels names, we prepend
Based on prometheus' experience with escaping mechanisms, I would oppose doing any escaping by default in the SDK. It has led to a significant amount of user confusion, and is taking a long time to undo. IMO, it is better for exporters that can't accept the name fail and to direct users to "fix" metric naming issues using views than to automatically rename metrics.
The right place seems to be metric.metadata: https://github.com/open-telemetry/opentelemetry-proto/blob/ffade295895a2be5a6e7931eb0cda1c72bc4c0f6/opentelemetry/proto/metrics/v1/metrics.proto#L218. However, I don't believe this can be set from any SDKs today, so that would require additional spec changes. |
https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/api.md#instrument-name-syntax
We are looking to start using a dotnet OpenTelemetry distribution. Unfortunately, our metric names begin with a '-' character, which is not allowed as the first character.
Changing the metric names is not a feasible option for us due to the high cost and the potential invalidation of numerous queries accumulated across various tools, dashboards, and users. Therefore, we hope that a feature request could be considered to allow non-alphabetic characters as the first character of metric names. This would enable us to fully utilize the features and benefits provided by OpenTelemetry metrics.
Thanks,
Helen
The text was updated successfully, but these errors were encountered: