-
Notifications
You must be signed in to change notification settings - Fork 12.4k
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
Loki: Add feature flag to enable dataplane-compliant metric frames #66017
Conversation
Backend code coverage report for PR #66017
|
Frontend code coverage report for PR #66017 |
You have successfully added a new CodeQL configuration |
6808620
to
bef1a1b
Compare
bef1a1b
to
0ff547c
Compare
// 🌟 This was machine generated. Do not edit. 🌟 | ||
{ | ||
"status": 200 | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If "empty" means "no data" in Grafana terms here, it can be returned as a single frame with no fields. This way metadata can still be passed. In particular, the executed query string (if using macros, can help to see what happened to result in no data if unexpected). https://github.com/grafana/grafana-plugin-sdk-go/blob/main/data/contract_docs/contract.md#no-data-and-empty
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the tip. i'll check what to modify to achieve this 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, i see prom adds an empty-frame if converter/prom.go
returns zero frames:
grafana/pkg/tsdb/prometheus/querydata/response.go
Lines 34 to 37 in 5df9e64
// Add frame to attach metadata | |
if len(r.Frames) == 0 && !q.ExemplarQuery { | |
r.Frames = append(r.Frames, data.NewFrame("")) | |
} |
i'll do the same for Loki too (in a separate PR, not to complicate things here)
0ff547c
to
23dead6
Compare
23dead6
to
c19256b
Compare
this PR adds a feature-flag that makes Loki's responses to metric queries compliant with the dataplane-spec's time series multi and numeric multi formats.
(similar PR happened to Prometheus in #62694)
this means the following changes:
Frame.Name
field is not used anymoreFrame.Meta.Type
field changes fromtimeseries-multi
tonumeric-multi
.we do not expect many backward-compatibility issues with this change, but for now it is opt-in thing controlled by the feature-flag.
we are running the snapshot-tests twice, both for the flag being enabled and also for the flag being disabled
when reading the diff, the real changes are in the
tsdb/loki
part, the rest is adding a feature-flag, and adding more snapshot-tests (because now we need to cover both flag-enabled and flag-disabled cases).if anyone has any idea how to do this in an easier way, i'm listening 👍 .
how to test:
lokiMetricDataplane
lokiMetricDataplane