Time series withconfig from query results and prepare time series

Grafana version: docker image grafana/grafana:11.4.0
Attempting to transform record data to series by field values and apply configuration from query

Direct MySQL data source queries:
A: i.e. select series, timestamp, value from measure ...
B: i.e. select unit, omit_min, omit_max, threshold1, threshold2 from measure_def

Apply transformations:
1- Config from query results
– able to select query source when first in transform list, but not if after prepare time series transformation.
– able to apply unit and min/max, but only 1 threshold. only applies to time series when prepare time series is disabled
– Is there a way to apply multiple threshold values from a query result?

2- Prepare time series, multi-frame time series
– needed to split out the series field from query A into dynamic series
– when enabled, config from transform 1 vanishes

I need the prepare time series as due to some specific environment and mysql constraints and would prefer to avoid rolling a custom REST microservice

I realize the prepare time series transformation is creating multi-frames, but shouldn’t these inherit configs applied to the base? If I manually set the unit etc in the panel properties they are still effective after applying the prepare time series transformation. I’d expect this to be true if applying the config dynamically before the prepare time series transformation as well.

No errors in logs

moving “config from query” after “prepare time series” makes the query B source dissapear

welcome @michaelshaw2

what is query B in this time series you are trying to visualize?

the time series requires specific column names and the Format has to be time series that way you don’t need Prepare time series, multi-frame time series transformation

1 Like

thanks, @yosiasz

query A is the data to be visualized
query B is the source to provide y-axis unit and min/max values

the value of series in query A is very dynamic (based on selected time range and selected page variables/parameters
I need to pivot the value in the series column rows into series data columns so I can display a time series chart with multiple series

no pivot support in mysql and I’d like to avoid creating a stored procedure that builds sql strings to dynamically execute and return the data as column series orientation. kinda messy and more issues/complexity due to the multi-select page parameters I need. doable this way, just prefer not too. (don’t think
also like to avoid the overhead of creating a REST microservice as another alternative

Prepare time series gives me the result I’m looking for simply, EXCEPT that I cannot use it in combination with the config from query transformation

@yosiasz
good call, just came back and read your message again and it clicked. aliased my series column as metric and timestamp as time
and, importantly, changed the query A format to time series (it was table) and got the results I was looking for

thanks!

1 Like