Dropwizard Yaml for graphite server configuration

2019-08-01 10:08发布

问题:

I am using metrics with dropwizard and I am reporting these to the graphite server. Almost the same way described in the tutorial. https://dropwizard.github.io/metrics/3.1.0/manual/graphite/#manual-graphite But I wanted to configure the graphite properties in the dropwizard yaml file. Something like the following

metrics:
  reporters:
   - type: graphite
     host: graphite_server
     port: 2003 
     prefix: some_example_metrics

How do I then configure this in my dropwizard configuration class in order to use it in the application ?