Bug
In v1.7.0, the datasource appends the dashboard time range to the user query without wrapping the user expression:
%s AND timestamp >= "<from>" AND timestamp <= "<to>"
For a query with a top-level OR, Cloud Logging parses AND before OR. For example:
jsonPayload.event_type="app.error" OR (jsonPayload.event_type="app.request" AND jsonPayload.metadata.status>=500)
becomes effectively:
jsonPayload.event_type="app.error" OR (jsonPayload.event_type="app.request" AND jsonPayload.metadata.status>=500 AND timestamp >= "<from>" AND timestamp <= "<to>")
The time range therefore applies only to the final branch.
The datasource should group the user expression before appending the time range, for example:
(<user query>) AND timestamp >= "<from>" AND timestamp <= "<to>"
This was observed in a Grafana dashboard using GoogleCloudPlatform/cloud-logging-data-source-plugin v1.7.0. A local workaround is to parenthesize any dashboard query containing OR.
Related Kaamos issue: https://github.com/Kaamos-AI/kaamos/issues/2949
Bug
In v1.7.0, the datasource appends the dashboard time range to the user query without wrapping the user expression:
For a query with a top-level OR, Cloud Logging parses AND before OR. For example:
becomes effectively:
The time range therefore applies only to the final branch.
The datasource should group the user expression before appending the time range, for example:
This was observed in a Grafana dashboard using GoogleCloudPlatform/cloud-logging-data-source-plugin v1.7.0. A local workaround is to parenthesize any dashboard query containing OR.
Related Kaamos issue: https://github.com/Kaamos-AI/kaamos/issues/2949