Monitor Prometheus metrics

Prometheus is an open-source monitoring and alerting toolkit which is popular in the Kubernetes community. Prometheus scrapes metrics from a number of HTTP(s) endpoints that expose metrics in the OpenMetrics format.

Dynatrace integrates Gauge and Counter metrics from Prometheus exporters in K8s and makes them available for charting, alerting, and analysis. See the list of available exporters in the Prometheus documentation.


  • In your Dynatrace environment, go to Settings > Cloud and virtualization > Kubernetes and turn on Enable monitoring and Monitor Prometheus exporters.
  • Annotated pod definitions, see below.

Annotate Prometheus exporter pods

Dynatrace collects metrics from any pods that are annotated with a property set to true in the pod definition.

Depending on the actual exporter in a pod, you might need to set additional annotations to the pod definition in order to allow Dynatrace to properly ingest those metrics.

Enable metrics scraping required

Set to 'true' to enable Dynatrace to collect Prometheus metrics exposed for this pod.

Path to metrics endpoint optional

Use to override the default (/metrics) Prometheus endpoint.

Metrics port optional

By default, Prometheus metrics are available at the first exposed TCP port of the pod. We recommend to set to respective port.

HTTP/HTTPS optional

Set to true if you want to collect metrics that are exposed by an exporter via HTTPS. The default value is false, because most exporters expose their metrics via HTTP.

Filter metrics optional

Use to define a filter that allows you to either include ("mode": "include") or exclude (("mode": "exclude")) a list of metrics. If no filter annotation is defined, all metrics are collected.

See an example of a simple pod definition with the annotations.

apiVersion: v1
kind: Pod
  name: mypod
  annotations: 'true' '/path/to-metrics' '9001' 'false' |
      "mode": "include",
      "names": [
  - name: mycontainer
    image: myregistry/myimage:mytag

View metrics on a dashboard

Metrics from Prometheus exporters are available in the Data Explorer for custom charting. Select Create custom chart and select Try it out in the top banner. For more information, see Data explorer.

You can simply search for metric keys of all available metrics and define how you’d like to analyze and chart your metrics. After that you can pin your charts on a dashboard.

Metric alerts

You can also create custom alerts based on the Prometheus scraped metrics. From the navigation menu, select Settings > Anomaly detection > Custom events for alerting and select Create custom event for alerting. In the Create custom event for alerting page, search for a Prometheus metric using its key and define your alert. For more information, see Metric events for alerting.


The current limitations of the Prometheus metrics integration are as follows.

  • This integration supports only the Counter and Gauge Prometheus metric types.
  • Metrics can be scraped from annotated pods only. Scraping of metrics from Kubernetes services or endpoints will be available in a later release.
  • If you run multiple exporters in a pod, you need to set the annotation to direct Dynatrace which one to use.
  • Up to 1000 pods with 200 metric data points each, per minute.
  • For OpenShift, monitoring the node-exporter or any other Prometheus exporter in the OpenShift monitoring project isn't currently supported, as these exporters are controlled by the OpenShift Cluster Monitoring Operator (CMO). The OpenShift Cluster Monitoring Operator doesn't allow any changes to the YAML file, so the required annotations can't be added.

Monitoring consumption

Prometheus metrics in Kubernetes environments are subject to DDU consumption.

  • Prometheus metrics from exporters that run on OneAgent-monitored hosts are first deducted from your quota of included metrics per host unit. Once this quota is exceeded, the remaining metrics consume DDUs.
  • Prometheus metrics from exporters that run on hosts that aren't monitored by OneAgent always consume DDUs.