Apache flink 使用Graphite插件收集指标会导致;名为[…]的度量已存在“;错误
当我配置flink-conf.yaml以使用graphite插件收集指标时, 大多数情况下,只发送不完整的度量。在Taskmanager输出上出现多个错误,如:Apache flink 使用Graphite插件收集指标会导致;名为[…]的度量已存在“;错误,apache-flink,Apache Flink,当我配置flink-conf.yaml以使用graphite插件收集指标时, 大多数情况下,只发送不完整的度量。在Taskmanager输出上出现多个错误,如: 2018-08-15 00:58:59,016 WARN org.apache.flink.runtime.metrics.MetricRegistryImpl - Error while registering metric. java.lang.IllegalArgumentException:
2018-08-15 00:58:59,016 WARN org.apache.flink.runtime.metrics.MetricRegistryImpl - Error while registering metric.
java.lang.IllegalArgumentException: A metric named mycomputer.taskmanager.8ceab4c3dfbf9fc5fa2af0447f1373a1.State machine job.Source: Custom Source.0.numRecordsOut already exists
at com.codahale.metrics.MetricRegistry.register(MetricRegistry.java:91)
at org.apache.flink.dropwizard.ScheduledDropwizardReporter.notifyOfAddedMetric(ScheduledDropwizardReporter.java:131)
at org.apache.flink.runtime.metrics.MetricRegistryImpl.register(MetricRegistryImpl.java:329)
at org.apache.flink.runtime.metrics.groups.AbstractMetricGroup.addMetric(AbstractMetricGroup.java:379)
at org.apache.flink.runtime.metrics.groups.AbstractMetricGroup.counter(AbstractMetricGroup.java:312)
at org.apache.flink.runtime.metrics.groups.AbstractMetricGroup.counter(AbstractMetricGroup.java:302)
at org.apache.flink.runtime.metrics.groups.OperatorIOMetricGroup.<init>(OperatorIOMetricGroup.java:41)
at org.apache.flink.runtime.metrics.groups.OperatorMetricGroup.<init>(OperatorMetricGroup.java:48)
at org.apache.flink.runtime.metrics.groups.TaskMetricGroup.addOperator(TaskMetricGroup.java:146)
at org.apache.flink.streaming.api.operators.AbstractStreamOperator.setup(AbstractStreamOperator.java:174)
at org.apache.flink.streaming.api.operators.AbstractUdfStreamOperator.setup(AbstractUdfStreamOperator.java:82)
at org.apache.flink.streaming.runtime.tasks.OperatorChain.<init>(OperatorChain.java:143)
at org.apache.flink.streaming.runtime.tasks.StreamTask.invoke(StreamTask.java:267)
at org.apache.flink.runtime.taskmanager.Task.run(Task.java:711)
at java.lang.Thread.run(Thread.java:748)
我使用默认配置上运行的官方graphite docker映像()
有人知道我如何解决这个问题吗
谢谢你的问候
更新
为了排除特定的本地设置对这种行为负责,我在一个干净的EC2实例上重复了这个过程。这里也有同样的错误
如何复制:
作业启动后,您可以在任务管理器->日志下的flink dashboard中查看错误,只需快速查看您的问题:度量名称(“状态机作业”)中的空格是否有问题?您好,不,名称不应该有问题。我之所以选择这个工作,是因为它是Flink中的一个示例工作,我可以排除我的实现是错误的。我的其他工作也有同样的问题。同样值得注意的是,错误不仅发生在自定义指标上,而且也发生在所有这些指标上。
metrics.reporters: grph
metrics.reporter.grph.class: org.apache.flink.metrics.graphite.GraphiteReporter
metrics.reporter.grph.host: localhost
metrics.reporter.grph.port: 2003
metrics.reporter.grph.interval: 1 SECONDS
metrics.reporter.grph.protocol: TCP