vertx-dropwizard-metrics icon indicating copy to clipboard operation
vertx-dropwizard-metrics copied to clipboard

Make metric names configurable

Open venikkin opened this issue 7 years ago • 4 comments

Hi,

I've got an intention to override default metrics names Vertx provides. For example, I'm not happy with this metric for HTTP server (https://github.com/vert-x3/vertx-dropwizard-metrics/blob/master/src/main/java/io/vertx/ext/dropwizard/impl/VertxMetricsImpl.java#L112), as it actually leaves a colon in the metric's name. Some services treat colon in datapoint's name as invalid character (for instance Wavefront does that: https://docs.wavefront.com/wavefront_data_format.html).

In order to redefine the naming I have to extend VertxMetricsImpl class (which is a dirty as this class has a package private access), as well as provide custom factory for my new implementation.

Having configuration for metrics names or making official and clean way to redefine VertxMetricsImpl class would be really helpful to integrate metrics emitted by Vertx into common providers.

venikkin avatar Jul 03 '18 13:07 venikkin

How does your metric data go to the backend? It's usually possible to configure agent/collectors/relays to rename metrics.

tsegismont avatar Jul 03 '18 14:07 tsegismont

Yes. I guess it's possible. But on the other hand I want to keep my agent/collector/relay layer independent from the metrics one particular HTTP server emits in order to make testing and maintenance easier and more transparent.

venikkin avatar Jul 05 '18 11:07 venikkin

@venikkin feel free to make a complete PR

vietj avatar Jul 05 '18 14:07 vietj

getting the same error today with Datadog agent v7, which uses Dogstatsd and it gives parse error for Vert.x server metrics like:

vertx.http.servers.0.0.0.0:8080.trace-requests.median:0|g

any solutions to this?

ggetv avatar Mar 02 '22 04:03 ggetv