Configure metrics
By default, each Dapr system process emits Go runtime/process metrics and has their own Dapr metrics.
The Dapr sidecars exposes a Prometheus metrics endpoint that you can scrape to gain a greater understanding of how Dapr is behaving.
Configuring metrics using the CLI
The metrics application endpoint is enabled by default. You can disable it by passing the command line argument .
You can also enable/disable the metrics for a specific application by setting the dapr.io/enable-metrics: "false"
annotation on your application deployment. With the metrics exporter disabled, does not open the metrics listening port.
The following Kubernetes deployment example shows how metrics are explicitly enabled with the port specified as “9090”.
Configuring metrics using application configuration
You can also enable metrics via application configuration. To disable the metrics collection in the Dapr sidecars running in a specific namespace:
- Set
enabled: false
to disable the metrics in the Dapr runtime.
The following example shows how to apply a regular expression for the label method
in the metric :
When this configuration is applied, a recorded metric with the method
label of orders/a746dhsk293972nz
will be replaced with orders/
.
Watch this video to walk through handling high cardinality metrics: