Skip to content
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

Closed
donbourne opened this issue Mar 6, 2019 · 2 comments
Milestone

Comments

@donbourne
Copy link
Member

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 , 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?

@brian-brazil
Copy link

brian-brazil commented Mar 6, 2019 via email

@donbourne
Copy link
Member Author

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants