id: observability-prometheus title: Observability with Prometheus sidebar_label: Prometheus

You can integrate Heron with Prometheus to monitor and gather runtime metrics exported by Heron topologies.

Exporting topology metrics from Heron to Prometheus

Heron supports custom metric exporters from the Metrics Manager. You can either build your own Prometheus metrics sink or use the provided Prometheus sink.

To set up your Heron cluster to export to Prometheus, you need to make two changes to the metrics_sinks.yaml configuration file:

  • Add prometheus-sink to the sinks list
  • Add a prometheus-sink map to the file that sets values for the parameters listed below. You can uncomment the existing prometheus-sink map to get the default configuration.

Prometheus parameters

ParameterDescriptionDefault
classThe Java class used to control Prometheus sink behaviororg.apache.heron.metricsmgr.sink.PrometheusSink
portThe port on which Prometheus will scrape for metrics. Note: You must supply a port or port-file config.8080
port-fileThe path to a text file that contains the port number to be used by Prometheus for metrics scraping. Note: You must supply a port or port-file config.metrics.port
pathThe Prometheus path on which to publish metrics/metrics
include-topology-nameWhether the name of the Heron topology will be included in names for metricstrue
metrics-cache-max-sizeThe maximum number of metrics cached and published1000000
metrics-cache-ttl-secThe time to live (TTL) for metrics, i.e. the time, in seconds after which a metric that was collected will stop being published600 (10 minutes)