# Traffic Metrics
Kuma facilitates consistent traffic metrics across all dataplanes in your mesh.
A user can enable traffic metrics by editing a
Mesh resource and providing the desired
Mesh-wide configuration. If necessary, metrics configuration can be customized for each
Dataplane individually, e.g. to override the default metrics port that might be already in use on that particular machine.
Kuma provides full integration with
- if enabled, every dataplane will expose its metrics in
Kumawill make sure that
Prometheuscan automatically find every dataplane in the mesh
To collect metrics from Kuma, you need to first expose metrics from Dataplanes and then configure Prometheus to collect them.
# Expose metrics from Dataplanes
Prometheus metrics from every dataplane in the mesh, configure a
Mesh resource as follows:
Both snippets from above instruct
Kuma to configure every dataplane in the mesh
default to expose an HTTP endpoint with
Prometheus metrics on port
5670 and URI path
The metrics endpoint is forwarded to the standard Envoy Prometheus metrics endpoint (opens new window) and supports the same query parameters.
You can pass the
filter query parameter to limit the results to metrics whose names match a given regular expression.
By default all available metrics are returned.
# Override Prometheus settings per Dataplane
# Configure Prometheus
Although dataplane metrics are now exposed,
Prometheus doesn't know anything about it just yet.
Prometheus to automatically discover dataplanes,
Kuma provides a tool -
kuma-prometheus-sd is meant to run alongside
It knows location of
Kuma Control Plane is and can fetch an up-to-date list of dataplanes from it.
It then transforms that information into a format that
Prometheus can understand, and saves it into a file on disk.
Prometheus watches for changes to that file and updates its scraping configuration accordingly.
Now, if you check
Targets page on
Prometheus UI, you should see a list of dataplanes from your mesh, e.g.
# Secure Dataplane metrics
Kuma lets you expose Dataplane metrics in a secure way by leveraging mTLS. Prometheus needs to be a part of the Mesh for this feature to work, which is the default deployment model when
kumactl install metrics is used on Kubernetes.
# Expose metrics from applications
In addition to exposing metrics from Dataplane, you may want to expose metrics from application next to Kuma DP.
Remember that in order to consume paths protected by mTLS, you need Traffic Permission that lets Prometheus consume applications.
# Grafana Dashboards
Kuma ships with 4 default dashboards that are available to import from Grafana Labs repository (opens new window).
# Kuma Dataplane
This dashboards lets you investigate the status of a single dataplane in the mesh.
# Kuma Mesh
This dashboard lets you investigate the aggregated statistics of a single mesh.
# Kuma Service to Service
This dashboard lets you investigate aggregated statistics from dataplanes of given source service to dataplanes of given destination service.
# Kuma CP
This dashboard lets you investigate statistics of the control plane.
# Kuma Service
This dashboard lets you investigate aggregated statistics for each service.