All Products
Search
Document Center

Realtime Compute for Apache Flink:Customize metric reporters

Last Updated:Mar 09, 2026

Flink provides monitoring metrics to help you analyze jobs. You can view metrics directly on the Data Curve tab of the Job O&M page in the Realtime Compute for Apache Flink development console. You can also report the monitoring metrics to other channels. This topic describes how to report monitoring metrics to a self-managed Prometheus instance, Simple Log Service (SLS), Kafka, a self-managed platform, or multiple channels.

Precautions

You can report metrics to only a self-managed Prometheus instance, Simple Log Service (SLS), or Kafka. You can also report metrics to multiple channels.

  • When you report metrics to multiple channels

    Reporting to multiple channels incurs additional collection costs. You must also modify the metrics.reporters configuration item. For more information, see Report to multiple channels.

  • If you report metrics only to channels other than the Flink console

    • Realtime Compute for Apache Flink will not enable ARMS or Cloud Monitor services for you. The Flink development console will not display monitoring metrics. You must view the metrics on the platform where they are reported.

    • Existing alert configurations in the Flink development console will become invalid. For more information, see Configure monitoring and alerts. You will not be able to create valid alert configurations later. You must configure alerts on the platform where the metrics are reported.

Customize monitoring metric reporting channels

Report to a self-managed Prometheus instance

Ensure that your network is connected. Then, on the Deployment Details tab of the target job in the Flink development console, go to the Other Configurations section under Parameter Settings. Add the following code and modify the parameters for your self-managed Prometheus. For more information about how to configure parameters, see How do I configure custom job running parameters?

metrics.reporters: promgatewayappmgr
metrics.reporter.promgatewayappmgr.groupingKey: 'deploymentName={{deploymentName}};deploymentId={{deploymentId}};jobId={{jobId}}'
metrics.reporter.promgatewayappmgr.jobName: '{{deploymentName}}'
metrics.reporter.promgatewayappmgr.factory.class: org.apache.flink.metrics.prometheus.PrometheusPushGatewayReporterFactory
metrics.reporter.promgatewayappmgr.host: <Your pushgateway host>
metrics.reporter.promgatewayappmgr.port: <Your pushgateway port>
Note
  • In the code, replace <Your pushgateway host> and <Your pushgateway port> with your actual values. The system automatically replaces deploymentName, deploymentId, and jobId.

  • The network connectivity requirements between Flink and your self-managed Prometheus are as follows:

    • If your self-managed Prometheus and Flink workspace are in the same VPC, confirm that the Prometheus security group settings allow access from the Flink CIDR block.

    • If your self-managed Prometheus and Flink workspace are in different VPCs, but the Prometheus instance has a public IP address, configure public network access for Flink. For more information, see How do I access the internet?.

    • If your self-managed Prometheus and Flink workspace are in different VPCs, and the Prometheus instance has only a VPC IP address, you must connect the two VPCs. For more information, see How do I access other services across VPCs?.

Report to Simple Log Service (SLS)

Ensure that your network is connected. Then, on the Deployment Details tab of the target job in the Flink development console, go to the Other Configurations section under Parameter Settings. Add the following code and modify the SLS-related parameters. For more information about how to configure parameters, see How do I configure custom job running parameters?

metrics.reporters: sls
metrics.reporter.sls.factory.class: org.apache.flink.metrics.sls.SLSReporterFactory
metrics.reporter.sls.project: <Your project>
metrics.reporter.sls.logStore: <Your logStore>
metrics.reporter.sls.endPoint: <Your endPoint>
metrics.reporter.sls.accessId: <Your accessId>
metrics.reporter.sls.accessKey: <Your accessKey>
metrics.reporter.sls.extraTags: deploymentId={{ deploymentId }};deploymentName={{ deploymentName}};namespace={{ namespace }}
Note

In the code, modify the SLS-related parameters. You do not need to modify deploymentId, deploymentName, or namespace. The system automatically replaces them. For more information about AccessKey information, see How do I view my AccessKey ID and AccessKey secret?

Report to a specified Metricstore in SLS

To report to a specified Metricstore, add the following parameters. Also, change the value of metrics.reporter.sls.logStore to the name of your Metricstore.

metrics.reporter.sls.toMetricStore: true
metrics.reporter.sls.logStore: <Your Metricstore name>

Report to Kafka

Ensure that your network is connected. Then, on the Deployment Details tab of the target job in the Flink development console, go to the Other Configurations section under Parameter Settings. Add the following code and modify the Kafka-related parameters. For more information about how to configure parameters, see How do I configure custom job running parameters?

metrics.reporters: monitor
metrics.reporter.monitor.factory.class: org.apache.flink.metrics.monitor.KafkaReporterFactory
metrics.reporter.monitor.kafka.bootstrap.servers: <Your servers>
metrics.reporter.monitor.topicName: <Your topicName>
metrics.reporter.monitor._FLINK_CLUSTER_NAME: '{{ deploymentName }}'
metrics.reporter.monitor._JOB_NAME: '{{ deploymentName }}'
metrics.reporter.monitor._NAMESPACE_NAME: '{{ namespace }}'
Note

In the code, modify the parameters for your self-managed Kafka. You do not need to modify deploymentName or namespace. The system automatically replaces them.

Report to multiple channels

Report to a self-managed platform using ARMS APIs

If you selected Prometheus Service when you created the workspace, you can use ARMS APIs to retrieve Flink metrics. You can then integrate the metrics into your own platform. This lets you view metrics on your self-managed platform while still being able to view metric curves and use alert configurations in Realtime Compute for Apache Flink.

For more information about ARMS APIs, see API overview. For more information about Operator-related metrics, see Operator Metrics.

Report to the Flink console and other channels

To report metrics to other channels for viewing and also need to view metric curves and use alert configurations in Realtime Compute for Apache Flink, you can configure multi-channel reporting. This incurs additional collection costs.

For example, to display metrics in both the Flink development console and SLS, on the Deployment Details tab of the target job in the Flink development console, go to the Other Configurations section under Parameter Settings. Add the following code and modify the SLS-related parameters.

metrics.reporters: jmx,promappmgr,sls
metrics.reporter.sls.factory.class: org.apache.flink.metrics.sls.SLSReporterFactory
metrics.reporter.sls.project: <Your project>
metrics.reporter.sls.logStore: <Your logStore>
metrics.reporter.sls.endPoint: <Your endPoint>
metrics.reporter.sls.accessId: <Your accessId>
metrics.reporter.sls.accessKey: <Your accessKey>
metrics.reporter.sls.extraTags: deploymentId={{ deploymentId }};deploymentName={{ deploymentName}};namespace={{ namespace }}
Note

When the metrics.reporters configuration item includes jmx,promappmgr, you can view metrics in the Flink development console. For more information about other configuration parameters, see Report to Simple Log Service (SLS).

Report to multiple channels outside the Flink console

After you report metrics to multiple channels outside the Flink console, the Flink development console does not display monitoring metrics. You must view the metrics on the corresponding platforms. For more information, see Precautions.

For example, to report metrics to both SLS and Kafka, configure the following code in the running parameters on the Deployment Details tab of the target job in the Flink development console:

metrics.reporters: sls,monitor 
metrics.reporter.sls.factory.class: org.apache.flink.metrics.sls.SLSReporterFactory
metrics.reporter.sls.project: <Your project>
metrics.reporter.sls.logStore: <Your logStore>
metrics.reporter.sls.endPoint: <Your endPoint>
metrics.reporter.sls.accessId: <Your accessId>
metrics.reporter.sls.accessKey: <Your accessKey>
metrics.reporter.sls.extraTags: deploymentId={{ deploymentId }};deploymentName={{ deploymentName}};namespace={{ namespace }}
metrics.reporter.monitor.factory.class: org.apache.flink.metrics.monitor.KafkaReporterFactory
metrics.reporter.monitor.kafka.bootstrap.servers: <Your servers>
metrics.reporter.monitor.topicName: <Your topicName>
metrics.reporter.monitor._FLINK_CLUSTER_NAME: '{{ deploymentName }}'
metrics.reporter.monitor._JOB_NAME: '{{ deploymentName }}'
metrics.reporter.monitor._NAMESPACE_NAME: '{{ namespace }}'
Note

For more information about configuration parameters, see Report to Simple Log Service (SLS) and Report to Kafka.

References