最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Graphite Metric Reporter for Apache Flink does not recognize Port value - Stack Overflow

programmeradmin0浏览0评论

I try to configure Graphite as metric reporter DB in Apache Flink 1.20

metrics:
  scope:
     operator: <job_name>.<operator_name>
     task: <job_name>.<task_name>
  reporters: grph,prom
  reporter:
    grph:
      factory:
        class: .apache.flink.metrics.graphite.GraphiteReporterFactory
      host: localhost3
      port: 2001
      protocol: TCP
      interval: 10 SECONDS
    prom:
      factory:
        class: .apache.flink.metrics.prometheus.PrometheusReporterFactory
      port: 9249-9251
      scope:
        operator: <job_name>.<operator_name>
        task: <job_name>.<task_name>

But when I start the cluster, I get the exception below. AS you can see, host name is parsed but port is invalid.

2025-03-12 19:31:26,025 ERROR .apache.flink.runtime.metrics.ReporterSetup                   [] - Could not instantiate MetricReporter grph. Metrics might not be exposed/reported.
java.lang.IllegalArgumentException: Invalid host/port configuration. Host: localhost3 
Port: -1
        at     .apache.flink.metrics.graphite.GraphiteReporter.getReporter(GraphiteReporter.java:51) ~    [?:?]
        at     .apache.flink.dropwizard.ScheduledDropwizardReporter.open(ScheduledDropwizardReporter.ja    va:113) ~[?:?]
        at     .apache.flink.runtime.metrics.ReporterSetup.createReporterSetup(ReporterSetup.java:185)     ~[flink-dist-1.20.0.jar:1.20.0]
        at     .apache.flink.runtime.metrics.ReporterSetup.lambda$setupReporters$2(ReporterSetup.java:3    60) ~[flink-dist-1.20.0.jar:1.20.0]

in Flink logs, at startup I can see, these values are parsed correctly.

INFO  [] - Loading configuration property: metrics.reporter.grph.port, 2001
INFO  [] - Loading configuration property: metrics.reporter.grph.host, localhost3
INFO  [] - Loading configuration property: metrics.reporter.grph.interval, 10 SECONDS
INFO  [] - Loading configuration property: metrics.reporter.grph.interval, 10 SECONDS

Any idea why port value can not be parsed and seems -1 ,default value?

I try to configure Graphite as metric reporter DB in Apache Flink 1.20

metrics:
  scope:
     operator: <job_name>.<operator_name>
     task: <job_name>.<task_name>
  reporters: grph,prom
  reporter:
    grph:
      factory:
        class: .apache.flink.metrics.graphite.GraphiteReporterFactory
      host: localhost3
      port: 2001
      protocol: TCP
      interval: 10 SECONDS
    prom:
      factory:
        class: .apache.flink.metrics.prometheus.PrometheusReporterFactory
      port: 9249-9251
      scope:
        operator: <job_name>.<operator_name>
        task: <job_name>.<task_name>

But when I start the cluster, I get the exception below. AS you can see, host name is parsed but port is invalid.

2025-03-12 19:31:26,025 ERROR .apache.flink.runtime.metrics.ReporterSetup                   [] - Could not instantiate MetricReporter grph. Metrics might not be exposed/reported.
java.lang.IllegalArgumentException: Invalid host/port configuration. Host: localhost3 
Port: -1
        at     .apache.flink.metrics.graphite.GraphiteReporter.getReporter(GraphiteReporter.java:51) ~    [?:?]
        at     .apache.flink.dropwizard.ScheduledDropwizardReporter.open(ScheduledDropwizardReporter.ja    va:113) ~[?:?]
        at     .apache.flink.runtime.metrics.ReporterSetup.createReporterSetup(ReporterSetup.java:185)     ~[flink-dist-1.20.0.jar:1.20.0]
        at     .apache.flink.runtime.metrics.ReporterSetup.lambda$setupReporters$2(ReporterSetup.java:3    60) ~[flink-dist-1.20.0.jar:1.20.0]

in Flink logs, at startup I can see, these values are parsed correctly.

INFO  [] - Loading configuration property: metrics.reporter.grph.port, 2001
INFO  [] - Loading configuration property: metrics.reporter.grph.host, localhost3
INFO  [] - Loading configuration property: metrics.reporter.grph.interval, 10 SECONDS
INFO  [] - Loading configuration property: metrics.reporter.grph.interval, 10 SECONDS

Any idea why port value can not be parsed and seems -1 ,default value?

Share Improve this question asked Mar 12 at 16:49 KenankKenank 3682 silver badges11 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

For some reason defining the port as a string allow the plugin to work.

  reporter:
    grph:
      factory:
        class: .apache.flink.metrics.graphite.GraphiteReporterFactory
      host: localhost3
      port: '2001'
      protocol: TCP
      interval: 10 SECONDS
发布评论

评论列表(0)

  1. 暂无评论