Allllright, time for a naming bike shed! My favorite thing!
We are in the process of using Prometheus JMX exporter for the new Kafka jumbo cluster. JMX has an option to snake case attribute names, e.g. turning FifteenMinuteRate into fifteen_minute_rate, but it does not have an option to snake case the metric mbean names. Instead, we can leave them as they are (camelCase), or we can lower case them in place. Example:
Here is an metric from Kafka
kafka.server:type=KafkaRequestHandlerPool,name=RequestHandlerAvgIdlePercent
Here is what it would look like when it is lower cased in prometheus.
kafka_server_kafkarequesthandlerpool_requesthandleravgidlepercent
This is what it would look like if we left it as is:
kafka_server_KafkaRequestHandlerPool_RequestHandlerAvgIdlePercent
We need to decide if we are going to auto-lower case all metrics from JMX exporter, OR if we are going to leave them as they are.
Cassandra is already lower casing them, but I suspect this was done just because why not (please correct me if there was reasoning behind it).
I'd much much strongly prefer to leave them as they are, in upper CamelCase. Reasons:
- Consistency. The metric names in prometheus then match their original names in JMX. Easier for grepping, etc.
- Readability. Simply lower casing the names loses the word separators. By lower casing, we choose to drop meaning. I find the smushed together words difficult to read. This could get worse in other cases, as java loves to be verbose and smush words together with capitals.
FYI, in general I much prefer snake_case over camelCase, but we aren't writing a coding style guide here, we are choosing whether or not we should transform upstream's names to all lower case (not snake_case) just because we don't like camelCase.
If I can't convince either Filippo OR Luca that we should not lower case, I'll deal with it, but my aesthetic sensibilities will be greatly offended whenever I look at a Kafka metrics :D :p