axiomhq / axiom-grafana

The official Axiom datasource plugin for Grafana.
https://axiom.co
Apache License 2.0
6 stars 3 forks source link

"Summarize count() by <field>,bin_auto(_time)" statements do not visualize as different series #74

Open van-vliet opened 1 month ago

van-vliet commented 1 month ago

While using the plugin version 0.3.0, I created a dashboard panel that showed the number of log messages logged at each severity level over time:

image

I used the following query to power this:

['global']
| where ['resource.env'] == "dev"
| summarize count() by ['severity'],bin_auto(_time)

I used the following transformation

image

to convert the result series from the format

image

to the format shown in the first screenshot.

After upgrading the Axiom data plugin to version 0.5.1, my dashboard shows a single count instead of individual counts per severity:

image

This seems like a regression. I expected that it would still show 1 line per severity. I have tried using Grafana transformations to get individual series again, but without success.

The dashboard used to demonstrate the bug is here: series-bug-dashboard.json

Versions used: Grafana v11.2.0 (2a88694fd3) Axiom plugin: 0.5.1

dasfmi commented 1 month ago

hi @van-vliet, In version 5.0.0 we switched the returned data format, perhaps I missed something. I will take a look and get back to you.

dasfmi commented 1 month ago

@van-vliet Can you try to add a transformation that changes format from Long to Wide? That solved the issue for me for one of the charts. You can do that temporarily until I figure out the full solution.

van-vliet commented 2 weeks ago

@SollyzDev I am not sure what you are asking me to do.

I tried adding a type conversion transformation in Grafana. I see the following, but no options mention a long or wide format:

image

I also tried modifying my Axiom query to:

['global']
| where ['resource.env'] == "dev"
| summarize tolong(count()) by ['severity'],bin_auto(_time)

but that did not solve my issue either.

Can you provide an example of the change you performed that worked?

dasfmi commented 1 week ago

@van-vliet The transformation is called "Prepare time series". Add it, then choose "Multi-frame time series" like the screenshot below:

Screenshot 2024-10-07 at 1 33 43 PM

I will include a fix in the next version that will do this transformation automatically.