Help Center/ Application Service Mesh/ User Guide/ Mesh Configuration/ Upgrades/ Configuring Custom Metrics Using the Telemetry API (v1.18 to v1.28)
Updated on 2026-11-12 GMT+08:00

Configuring Custom Metrics Using the Telemetry API (v1.18 to v1.28)

Scenarios

Starting from v1.28, ASM uses the Telemetry API to manage sidecar metrics. Custom metrics configured in IOP v1.18 are not inherited after the upgrade. Instead, ASM preset metric templates are applied.

This section provides an example of configuring custom metrics using the Telemetry API. Prepare a Telemetry API configuration file as needed and apply it to the CCE cluster after the upgrade.

Procedure

  1. The following IOP configuration is used as an example. In this configuration, customize four tags and remove two.

    spec:
      values:    
        telemetry:
          enabled: true
          v2:
            enabled: true
            prometheus:
              configOverride:
                gateway:
                  http:
                    metrics:
                      - name: requests_total
                        dimensions: 
                          destination_cluster: upstream_peer.cluster_id
                          destination_port: string(upstream.port)
                          source_cluster: node.metadata['CLUSTER_ID']
                          source_pod: node.metadata['NAME']
                        tags_to_remove: 
                          - response_flags
                          - source_principal

  2. Check the corresponding Telemetry API configuration file.

    apiVersion: telemetry.istio.io/v1
    kind: Telemetry
    metadata:
      name: custom-tag
      namespace: istio-system
    spec:
      metrics:
        - providers:
            - name: prometheus
          overrides:
            - match:
                metric: REQUEST_COUNT
                mode: CLIENT
              tagOverrides:
                destination_cluster:
                  value: filter_state.upstream_peer.cluster
                destination_port:
                  value: string(upstream.port)
                source_cluster:
                  value: xds.node.metadata['CLUSTER_ID']
                source_pod:
                  value: xds.node.metadata['NAME']
                response_flags:
                  operation: REMOVE
                source_principal:
                  operation: REMOVE

  3. Run the following command in the CCE cluster to create the configuration:

    kubectl apply -f telemetry-custom-tag.yaml -n istio-system

Helpful Links

For more information about the Telemetry API, see the Istio official documentation Telemetry API - Metrics.