Search code examples
prometheusmetricsdistributed-tracingopencensus

Observability: can we filter by tags then aggregate on prometheus or any metrics backend server


For example, I call Redis server with following command:

SET key "value"

After running, I want to track those 2 information at the same time:

  • statistic of all write operators (so tag should be SET)
  • statistic of all specific operators (so tag should be SET and key)

So I will create views for tracking metrics. There are 2 ways I can think:

  • Single view with tag "SET" and key. and later hopefully I can filter by "SET" or by "SET" and by key. (1)
  • Creating 2 views. First view only has tag "SET" and second view will have tags "SET" and key. So each view for each query. (2)

I prefer (1) because it is more elegant and I don't need to create too many views. My question is: If I do on (1), can it works on metric backend server ? (i.e: Prometheus). Or metric backend server doesn't support filter by tag and aggregation, so I must create separate views ?

Thanks


Solution

  • Prometheus enables you to browse metrics by a specific tag and aggregate them.

    I recommend Prometheus documentation on aggregation and on tags (which in Prometheus are called 'labels').

    If you are asking about 'views' in something like Grafana, then they are easily configurable and you can set the filtering with variables for example.