我尝试在我的 config.yml 文件中配置我的 dropwizard 石墨指标报告器:
metrics:
reporters:
- type: graphite
host: my.graphite.host.com
port: 2003
prefix: my.prefix
我的 pom.xml 中有 dropwizard-metrics 和 metrics-graphite 作为依赖项。我的应用程序类或配置类中没有关于记者的任何内容。我的印象是 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"])
为什么“石墨”没有被认为是可接受的类型?我错过了什么?