Skip to main content
Gathering Interest

Data Models query in Grafana with custom labels

  • Heet Vora

Hi. I’ve got a simple data model set up, with the following view.

type MonitoredObject {
  name: String
  tradeTimeSeriesName: String
  watercourse: String
  statusTimeSeries: TimeSeries
  rawTimeSeries: TimeSeries
  prepTimeSeries: TimeSeries
}

I’m trying to make a dashboard in Grafana, to display the values from the “statusTimeSeries” of all MonitoredObjects. I’d like the labels to display the value from the “tradeTimeSeriesName” property. 

The following query renders the time series correctly, but, I’m unable to access the “tradeTimeSeriesProperty” as label

{
  listMonitoredObject {
    items {
      tradeTimeSeriesName
      statusTimeSeries {
        __typename
        externalId
      }
    }
  }
}
The time series render correctly. But I’d like to give them another label.

 

In the table view, I see that the retrieved tradeTimeSeriesName values appear on a different row.

tradeTimeSeriesName appears in a table view like this

 

Any suggestion how I could change my graphQL query or use transformations in Grafana to get the label I want on the status history panel? 

For the other query types in the Cognite Data Source for Grafana, there is a “label” field, where I could enter for instance {{description}} to set the label. Is there anything similar for the “Data Models” query type?

3 replies

Everton Colling
Seasoned Practitioner
Forum|alt.badge.img
  • Seasoned Practitioner
  • 163 replies
  • February 3, 2025

Hi Kristian,

Currently, the Data Models query type in the Cognite Data Source for Grafana doesn't support custom labels in the way you're trying to achieve with the tradeTimeSeriesName property. While other query types (like time series queries) support custom labels through the {{}} syntax, this functionality isn't yet available for Data Models.

We're aware of this limitation and we have plans to enhance the Data Models support in Grafana this year, including better support for complex GraphQL expressions, support for native selection and transformation capabilities and custom labeling similar to what's available in other query types.

@Mithila Jayalath could we convert this question into a Product Idea to ensure this specific use case is captured in our product backlog? This will help us with prioritization and serves as another validation case for the implementation when we work on these improvements.


Forum|alt.badge.img+4

Thanks ​@Everton Colling, Then I’ll be keeping a lookout for future updates on this!


Mithila Jayalath
Seasoned Practitioner
Forum|alt.badge.img

@Kristian Nymoen  I have converted the question to a product idea. Please upvote this idea to gain more attention.


Reply


Cookie Policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings