Customizing Istio Metrics with Telemetry API
Telemetry API has been in Istio as a first-class API for quite sometime now.
Previously, users had to configure metrics in the telemetry
section of the Istio configuration.
This task shows you how to customize the metrics that Istio generates with Telemetry API.
Before you begin
Install Istio6 in your cluster and deploy an application.
Telemetry API can not work together with EnvoyFilter
. For more details please checkout this issue7.
Starting with Istio version
1.18
, the PrometheusEnvoyFilter
will not be installed by default, and insteadmeshConfig.defaultProviders
is used to enable it. Telemetry API should be used to further customize the telemetry pipeline.For versions of Istio before
1.18
, you should install with the followingIstioOperator
configuration:
Override metrics
The metrics
section provides values for the metric dimensions as expressions,
and allows you to remove or override the existing metric dimensions.
You can modify the standard metric definitions using tags_to_remove
or by re-defining a dimension.
Remove
grpc_response_status
tags fromREQUEST_COUNT
metricAdd custom tags for
REQUEST_COUNT
metric
Disable metrics
Disable all metrics by following configuration:
Disable
REQUEST_COUNT
metrics by following configuration:Disable
REQUEST_COUNT
metrics for client by following configuration:Disable
REQUEST_COUNT
metrics for server by following configuration:
Verify the results
Send traffic to the mesh. For the Bookinfo sample, visit http://$GATEWAY_URL/productpage
in your web
browser or issue the following command:
Use the following command to verify that Istio generates the data for your new or modified dimensions:
For example, in the output, locate the metric istio_requests_total
and
verify it contains your new dimension.