Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge transform not working if one of the query return empty response #26890

Closed
jtorkkel opened this issue Aug 10, 2020 · 2 comments · Fixed by #27362
Closed

Merge transform not working if one of the query return empty response #26890

jtorkkel opened this issue Aug 10, 2020 · 2 comments · Fixed by #27362

Comments

@jtorkkel
Copy link

I am trying to merge multiple Prometheus instant queries into into single table (like 6.x did by default) which is prerequisite to get "Organize Fields" to work (Organize fields only works with a single frame). Intent is to list all alerts in single table, multiple queries needed to filter the alerts properly using template variables, and then sort and filter some fields using Organize fields.

Current behavior:
When all queries return one or more entry then merge works in 7.1.0 and in 7.1.2.

But if one of the query return empty response then merge is not done at all and each query is listed separately, and only one can be shown in table.

Expected behavior:
Queries should be merged and empty response should be ignored. Otherwise merge will not work with dynamic data like alerts where some queries might be are empty.

Screenshots from merge transform debug:
Two instant query are merged: One instant query result 5 entries and another 2 entries resulting 7 entries (Not merged to single line because some label values are different, and in some queries also some labels are different)
image

Empty response from query inspector:
image

Three query when one is empty are not merged: One instant query result 5 entries, another 2 entries but third query is empty.
image

Repro step:
Create two or more query which are correctly merged. Then clone one query and add query parameter which result empty result like {noMatchLabel="noMatch"}

Environment:

  • Grafana version 7.1.0 and 7.1.2:
  • Data source type & version: Prometheus
  • OS Grafana is installed on: Windows and Linux
  • User OS & Browser: Chrome
  • Grafana plugins:
  • Others:
@sakjur
Copy link
Contributor

sakjur commented Aug 10, 2020

@jtorkkel Thank you for your bug report. I had to set "Format" to "Table" in addition to the steps you outlined to replicate this issue.

Internal note: I'm not sure if this is a problem with the Prometheus data source or the data transformations, but it feels more likely to be the latter.

@jtorkkel
Copy link
Author

Thanks, naturally "Format" has to be Prometheus table.

Based on docs "Series to rows" should merge multiple query into single table, but it seems not to work for Prometheus Table, only works for time series where metric column contains all the labels key=values, metric name defined for legend.
I created another incident as alternative to support Grafana 6.4 kind of "join/merge", at least doc shold be updated.
#26901

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment