GoogleCloudPlatform / GoogleCloudPlatform/cloud-logging-data-source-plugin
Cloud Logging datasource appends time range without grouping OR queries
- Vorherrschende Sprache
- TypeScript
- Sterne
- 24
- Forks
- 17
- Ø Merge
- 13 Std. 11 Min.
- Gemergte PRs (30 T.)
- 11
Beschreibung
## Bug
In v1.7.0, the datasource appends the dashboard time range to the user query without wrapping the user expression:
```text
%s AND timestamp >= "" AND timestamp <= ""
```
For a query with a top-level OR, Cloud Logging parses AND before OR. For example:
```text
jsonPayload.event_type="app.error" OR (jsonPayload.event_type="app.request" AND jsonPayload.metadata.status>=500)
```
becomes effectively:
```text
jsonPayload.event_type="app.error" OR (jsonPayload.event_type="app.request" AND jsonPayload.metadata.status>=500 AND timestamp >= "" AND timestamp <= "")
```
The time range therefore applies only to the final branch.
The datasource should group the user expression before appending the time range, for example:
```text
() AND timestamp >= "" AND timestamp <= ""
```
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
Beitragsleitfaden
Rechercherichtung
Finde den Datasource-Code, der Dashboard-Zeitgrenzen an Benutzerabfragen anhängt, und untersuche, wie Ausdrücke mit OR zusammengesetzt werden. Ergänze Tests für eine OR-Abfrage auf oberster Ebene und stelle sicher, dass der vollständige Benutzerausdruck vor den Zeitbedingungen gruppiert wird, wobei das bestehende Abfrageverhalten erhalten bleibt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- google-cloud, grafana, typescript
- Bereich
- backend, cloud
- Issue-Typ
- Bug
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Aktivitätsstatus
- Aktiv
- Klarheit
- Klar beschrieben
- Anfängerfreundlichkeit
- 72/100