我尝试在config.yml文件中配置我的dropwizard graphite metrics报告器:
metrics:
reporters:
- type: graphite
host: my.graphite.host.com
port: 2003
prefix: my.prefix
Run Code Online (Sandbox Code Playgroud)
我的pom.xml中有dropwizard-metrics和metrics-graphite作为依赖项.我的Application类或Configuration类中没有关于记者的任何内容.我的印象是DropWizard负责MetricRegistry和记者的所有初始化和启动.然而,当我运行我的应用程序时,我收到以下错误:
config.yml has an error:
* Failed to parse configuration at: metrics.reporters;
Could not resolve type id 'graphite' into a subtype of [simple type,
class io.dropwizard.metrics.ReporterFactory]:
known type ids = [ReporterFactory, console, csv, log]
at [Source: N/A; line: -1, column: -1]
(through reference chain: com.example.MyConfiguration["metrics"]-
>io.dropwizard.metrics.MetricsFactory["reporters"])
Run Code Online (Sandbox Code Playgroud)
为什么'石墨'没有被接受为可接受的类型?我错过了什么?