Class MetricOptions


  • @PublicEvolving
    public class MetricOptions
    extends Object
    Configuration options for metrics and metric reporters.
    • Field Detail

      • REPORTERS_LIST

        public static final ConfigOption<String> REPORTERS_LIST
        An optional list of reporter names. If configured, only reporters whose name matches any of the names in the list will be started. Otherwise, all reporters that could be found in the configuration will be started.

        Example:

        
         metrics.reporters = foo,bar
        
         metrics.reporter.foo.class = org.apache.flink.metrics.reporter.JMXReporter
         metrics.reporter.foo.interval = 10
        
         metrics.reporter.bar.class = org.apache.flink.metrics.graphite.GraphiteReporter
         metrics.reporter.bar.port = 1337
         
      • REPORTER_SCOPE_DELIMITER

        public static final ConfigOption<String> REPORTER_SCOPE_DELIMITER
      • REPORTER_EXCLUDED_VARIABLES

        public static final ConfigOption<String> REPORTER_EXCLUDED_VARIABLES
      • REPORTER_CONFIG_PARAMETER

        public static final ConfigOption<String> REPORTER_CONFIG_PARAMETER
      • SCOPE_DELIMITER

        public static final ConfigOption<String> SCOPE_DELIMITER
        The delimiter used to assemble the metric identifier.
      • SCOPE_NAMING_JM

        public static final ConfigOption<String> SCOPE_NAMING_JM
        The scope format string that is applied to all metrics scoped to a JobManager.
      • SCOPE_NAMING_TM

        public static final ConfigOption<String> SCOPE_NAMING_TM
        The scope format string that is applied to all metrics scoped to a TaskManager.
      • SCOPE_NAMING_JM_JOB

        public static final ConfigOption<String> SCOPE_NAMING_JM_JOB
        The scope format string that is applied to all metrics scoped to a job on a JobManager.
      • SCOPE_NAMING_JM_OPERATOR

        public static final ConfigOption<String> SCOPE_NAMING_JM_OPERATOR
        The scope format string that is applied to all metrics scoped to the components running on a JobManager of an operator.
      • SCOPE_NAMING_TM_JOB

        public static final ConfigOption<String> SCOPE_NAMING_TM_JOB
        The scope format string that is applied to all metrics scoped to a job on a TaskManager.
      • SCOPE_NAMING_TASK

        public static final ConfigOption<String> SCOPE_NAMING_TASK
        The scope format string that is applied to all metrics scoped to a task.
      • SCOPE_NAMING_OPERATOR

        public static final ConfigOption<String> SCOPE_NAMING_OPERATOR
        The scope format string that is applied to all metrics scoped to an operator.
      • LATENCY_SOURCE_GRANULARITY

        public static final ConfigOption<String> LATENCY_SOURCE_GRANULARITY
      • LATENCY_HISTORY_SIZE

        public static final ConfigOption<Integer> LATENCY_HISTORY_SIZE
        The number of measured latencies to maintain at each operator.
      • SYSTEM_RESOURCE_METRICS

        public static final ConfigOption<Boolean> SYSTEM_RESOURCE_METRICS
        Whether Flink should report system resource metrics such as machine's CPU, memory or network usage.
      • SYSTEM_RESOURCE_METRICS_PROBING_INTERVAL

        public static final ConfigOption<Duration> SYSTEM_RESOURCE_METRICS_PROBING_INTERVAL
        Interval between probing of system resource metrics specified in milliseconds. Has an effect only when SYSTEM_RESOURCE_METRICS is enabled.
      • QUERY_SERVICE_PORT

        public static final ConfigOption<String> QUERY_SERVICE_PORT
        The default network port range for Flink's internal metric query service. The "0" means that Flink searches for a free port.
      • QUERY_SERVICE_THREAD_PRIORITY

        public static final ConfigOption<Integer> QUERY_SERVICE_THREAD_PRIORITY
        The thread priority for Flink's internal metric query service. The 1 means the min priority and the 10 means the max priority.
      • METRIC_FETCHER_UPDATE_INTERVAL

        public static final ConfigOption<Duration> METRIC_FETCHER_UPDATE_INTERVAL
        The config parameter defining the update interval for the metric fetcher used by the web UI in milliseconds.
    • Method Detail

      • forReporter

        @Experimental
        public static Configuration forReporter​(Configuration configuration,
                                                String reporterName)
        Returns a view over the given configuration via which options can be set/retrieved for the given reporter.
             Configuration config = ...
             MetricOptions.forReporter(config, "my_reporter")
                 .set(MetricOptions.REPORTER_INTERVAL, Duration.ofSeconds(10))
                 ...
         
        Parameters:
        configuration - backing configuration
        reporterName - reporter name
        Returns:
        view over configuration