Skip to main content
Gathering Interest

Grafana Data Source. Filtering time series on metadata keys

  • May 29, 2024
  • 3 replies
  • 52 views

Forum|alt.badge.img+4

I’m trying to make a grafana dashboard with a filter on metadata like this.

ts{metadata={myKey=~'.+'}}

The idea was to get any time series with any metadata value set for “myKey”. However, the panel also returns all the time series where the myKey does not exist. What am I doing wrong here?

Can I do a server-side type of filtering to retrieve the time-series I want?

3 replies

Forum|alt.badge.img+4
  • Author
  • Practitioner ⭐️
  • May 29, 2024

I found a solution, but as far as I can understand, this is still only client-side filtering.

ts{metadata={myKey!=null, myKey!=''}}

This will filter out both empty strings (the metadata key exists without a value) and null (the metadata key does not exist)

Does anyone know if there is a good server-side way to approach this?


Everton Colling
Expert ⭐️⭐️⭐️⭐️
Forum|alt.badge.img
  • Expert ⭐️⭐️⭐️⭐️
  • May 30, 2024

Hi Kristian!

You are completely right, queries with inexact inequality filters (!=) are executed on the client side. You can read more about query limitations in our docs: https://docs.cognite.com/cdf/dashboards/guides/grafana/timeseries#query-limitations

With advanced filters it’s possible to compose server side requests to the timeseries endpoints, as can be seen here: https://api-docs.cognite.com/20230101/tag/Time-series/operation/listTimeSeries#!path=advancedFilter&t=request. That being said, this is not supported in Grafana today. @Anita Hæhre can we turn this into a product idea, so we can track interest in this functionality?


Dilini Fernando
Expert ⭐️⭐️⭐️⭐️
Forum|alt.badge.img+2
  • Expert ⭐️⭐️⭐️⭐️
  • June 12, 2024

Hi @Kristian Nymoen ,

We have converted this question into a product idea.