-
Notifications
You must be signed in to change notification settings - Fork 66
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
stop automatically converting camelCase to snake_case in OpenMetrics exporter #357
Milestone
Comments
That's completely safe, and what I'd recommend these days. I'd not offer an
option for this, as metrics having two different names depending on an
exposition-level option would be annoying to deal with.
…On Wed 6 Mar 2019, 12:47 Don Bourne, ***@***.***> wrote:
When naming metrics, I often find need/desire to use camelCase to connect
two or more words. It's inconvenient to have the association between those
words undone in our OpenMetrics (OM) exporter.
As an example, if I define a metric with name
"connectionPool.managedConnections" -- then our current spec dictates that
implementations of mpMetrics are expected to change that to snake case.
According to the OM exporter guidelines at
https://prometheus.io/docs/instrumenting/writing_exporters/ :
*Prometheus metrics and label names are written in snake_case. Converting
camelCase to snake_case is desirable, though doing so automatically doesn’t
always produce nice results for things like myTCPExample or isNaN so
sometimes it’s best to leave them as-is.*
What I'd like to propose is that we leave it up to the developer to decide
whether camel case is appropriate, and just stop requiring any automatic
conversion to snake case in our spec.
Metric name in code: connectionPool.managedConnections
Current OM output: connection_pool_managed_connections
Proposed OM output: connectionPool_managedConnections
WDYT?
@brian-brazil <https://github.com/brian-brazil> , is it safe for us to
stop doing camel case -> snake case autoconversion in metric and label
names? will that cause any problems for OM?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#357>, or mute the
thread
<https://github.com/notifications/unsubscribe-auth/AGyTdrlQSVZmUpoEmtwyAscBF_qy1cPgks5vT7jGgaJpZM4bgzOE>
.
|
ok, thanks @brian-brazil -- I agree with your point about not having an option for it as that would just make it hard to create dashboards that depend on consistent metric names across servers. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When naming metrics, I often find need/desire to use camelCase to connect two or more words. It's inconvenient to have the association between those words undone in our OpenMetrics (OM) exporter.
As an example, if I define a metric with name "connectionPool.managedConnections" -- then our current spec dictates that implementations of mpMetrics are expected to change that to snake case.
According to the OM exporter guidelines at
https://prometheus.io/docs/instrumenting/writing_exporters/ :
Prometheus metrics and label names are written in snake_case. Converting camelCase to snake_case is desirable, though doing so automatically doesn’t always produce nice results for things like myTCPExample or isNaN so sometimes it’s best to leave them as-is.
What I'd like to propose is that we leave it up to the developer to decide whether camel case is appropriate, and just stop requiring any automatic conversion to snake case in our spec.
WDYT?
@brian-brazil , is it safe for us to stop doing camel case -> snake case autoconversion in metric and label names? will that cause any problems for OM?
The text was updated successfully, but these errors were encountered: