【发布时间】:2019-11-22 19:41:19
【问题描述】:
我们正在尝试使用 Dropwizard 指标将自动化指标添加到我们的 Java 应用程序中。到目前为止,config.yml 文件如下所示:
metrics:
reporters:
- type: log
logger: metrics
frequency: 5 minute
includes: "io.dropwizard.jetty.MutableServletContextHandler.active-requests","io.dropwizard.jetty.MutableServletContextHandler.active-dispatches","io.dropwizard.jetty.MutableServletContextHandler.active-suspended"
运行此项目时,我们收到一条错误消息,指出 yaml 文件格式错误:
io.dropwizard.configuration.ConfigurationParsingException: test/config.yml has an error:
* Malformed YAML at line: 24, column: 82; while parsing a block mapping
in 'reader', line 20, column 5:
- type: log
^
expected <block end>, but found FlowEntry
in 'reader', line 23, column 81:
... tContextHandler.active-requests","io.dropwizard.jetty.MutableSer ...
^
这里写 yaml 的方式到底有什么问题?我的理解是缩进、空格和引号内没有逗号是正确的,我们无法找到任何其他问题。
【问题讨论】:
-
似乎表达
Set的值有其他格式:github.com/dropwizard/dropwizard/blob/…
标签: java format dropwizard metrics