Using Grafana OSS 11.5.1 I have this Postgres query:
SELECT
b.date_booked AS "time",
s."name" as service_name,
COUNT(*) AS metric
FROM
bookings b
JOIN
services s ON b.service_id = s.id
WHERE
-- $__timeFilter(b.date_booked) and
b.status != 'X'
GROUP BY
b.date_booked, s."name"
ORDER BY
b.date_booked, metric DESC;
Using Transformations → Prepare Time Series → Multi-frame time series I get almost the output I want, with one metric per service displayed in the graph. The labels however look like this:
total_bookings Escalade Summer
… and I cannot figure out how to strip the "total_bookings " prefix??
Rename fields by regex apparently only works on raw query fields, not on the fields generated by the Prepare time series transformation.
Field override → Display Name supports regex bu apparently not back references to capture groups.
What is the right way to go about this?
Thanks!
-
What Grafana version and what operating system are you using?
OSS 11.5.1 -
What are you trying to achieve?
Display multiple time series on the Time Series visualization, with dynamic labels coming from the DB -
How are you trying to achieve it?
Using Prepare Time Series transformation to create a multi-frame time series, then a Rename field by regex to rename the new fields -
What happened?
The transformation is not applied to generated fields. -
What did you expect to happen?
The regex transform being applied to the fields generated by the Prepare time series step.