istio: Telemetry V2 - cannot override standard istio metrics

Bug Description

I am trying to overwrite the “source_workload” metric in “request_bytes_bucket” using the following definition (very hard to find clear examples or documentation for this):

apiVersion: install.istio.io/v1alpha1
kind: IstioOperator
metadata:
  name: istio
spec:
  values:
    telemetry:
      v2:
        prometheus:
          configOverride:
            inboundSidecar:
              stat_prefix: istio
              metrics:
                - name: request_bytes_bucket
                  dimensions:
                    source_workload: "test"

The envoy filter appears to be applied to the config:

{
	"name": "istio.stats",
	"typedConfig": {
		"@type": "type.googleapis.com/udpa.type.v1.TypedStruct",
		"typeUrl": "type.googleapis.com/envoy.extensions.filters.network.wasm.v3.Wasm",
		"value": {
			"config": {
				"configuration": {
					"@type": "type.googleapis.com/google.protobuf.StringValue",
					"value": "{\"metrics\":[{\"dimensions\":{\"source_workload\":\"test\"},\"name\":\"request_bytes_bucket\"}],\"stat_prefix\":\"istio\"}\n"
				},
				"root_id": "stats_inbound",
				"vm_config": {
					"code": {
						"local": {
							"inline_string": "envoy.wasm.stats"
						}
					},
					"runtime": "envoy.wasm.runtime.null",
					"vm_id": "tcp_stats_inbound"
				}
			}
		}
	}
}

but no metrrics are affected and there are no errors in the proxy logs.

How do I override the source_workload metric, and better still can i use conditionals or regex in the value to only modify based on certain source_app’s ?

Version

λ istioctl version
client version: 1.9.1
control plane version: 1.9.1
data plane version: 1.9.1

λ kubectl version --short
Client Version: v1.18.0
Server Version: v1.18.20-eks-8c579e

Additional Information

No response

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 17 (7 by maintainers)

Most upvoted comments

I think you need to drop the _bucket suffix.