How can i separate istio metrics by destination host?

I have a pod in k8s that contains two containers - application and istio_proxy sidecar This application makes requests to two out of k8s mongoDBs like mongo-one and mongo-two I use istio filter mongo_proxy to monitor traffic of the connection to mongo instances In this monitoring what i really need is the reply_time metric that called envoy_mongo__cmd_unknown_command_reply_time_ms_sum But in this case the istio-proxy sidecar sumurize this metric like if reply time of mongo-one equals 5 and mongo-two equals 7 the metric envoy_mongo__cmd_unknown_command_reply_time_ms_sum would be 12 like:

envoy_mongo__cmd_unknown_command_reply_time_ms_sum{mongo_prefix="cmd"} 12

But i do not want this because i need to know the separated values like:

envoy_mongo__cmd_unknown_command_reply_time_ms_sum{destination_host='mongo-one'} 5 envoy_mongo__cmd_unknown_command_reply_time_ms_sum{destination_host='mongo-two'} 7

ServiceEntries:

apiVersion: networking.istio.io/v1alpha3
kind: ServiceEntry
metadata:
  name: my-serviceentry-one
spec:
  addresses:
    - 127.0.0.1/32 (just example)
  exportTo:
    - my-namespace
  hosts:
    - mongo-my-serviceentry.mesh
    - mongo-one.my.net
  location: MESH_EXTERNAL
  ports:
    - name: mongo-27131
      number: 27131
      protocol: MONGO
  resolution: NONE


apiVersion: networking.istio.io/v1alpha3
kind: ServiceEntry
metadata:
  name: my-serviceentry-two
spec:
  addresses:
    - 127.0.0.1/32 (just example)
  exportTo:
    - my-namespace
  hosts:
    - mongo-my-serviceentry.mesh
    - mongo-two.my.net
  location: MESH_EXTERNAL
  ports:
    - name: mongo-27131
      number: 27131
      protocol: MONGO
  resolution: NONE

Everything else to make mongo_proxy metrics available i dit so the result has to be kinda like this:

envoy_mongo__cmd_unknown_command_reply_time_ms_sum{destination_host='mongo-one'} 5 envoy_mongo__cmd_unknown_command_reply_time_ms_sum{destination_host='mongo-two'} 7

Please, help me, how can i make it?

I tried the k8s istio manifest kind: Telemetry but it doesn't work. Also tried to modify istio envoyFilter but it also doesn't work.

Upvotes: 0

Views: 12

Answers (0)

Related Questions