-
Notifications
You must be signed in to change notification settings - Fork 11.7k
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
Prometheus: Implement Streaming JSON Parser #48477
Conversation
Nice -- this will be required for the new sparse heatmap coming down the pike. Can you implement this with a feature flag, and keep both approaches possible while we evaluate and gain confidence? I am sure we will learn something when deploying to ops :) |
d71de33
to
495e414
Compare
224eb09
to
126fc2a
Compare
return nil, err | ||
} | ||
|
||
u.Path = path.Join(u.Path, "api/v1/query") |
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.
is this needed, or should we overwrite the path from the user supplied URL string?
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.
I don't know enough to say 🤷♂️
Quick scan/review -- are the changes to "buffered" and "query" folders, really just renaming the folder, and no meaningful changes? Is this really just adding "streaming" as an alternative client? I wonder if there is a structure we could use that makes the no-feature-flagged path feel less like a big change 🤔. The folder names "buffered" and "streaming" only make sense in contrast to one another -- eventually we do not want the name anywhere (i think) Maybe we should do an independent PR that makes whatever changes required to the "buffered" client so that swapping the implemenation is easy. In this version, it is hard to tell that the feature flag only affects the "streaming" branch :) |
@ryantxu
agreed, my thought was that they would be temporary until the feature flag is removed
that's a good idea to make it easier to review. i'll hold off on that until i get your feedback on my responses above |
42810bf
to
e00bbb7
Compare
@gabor could you take a look at this approach since you have worked with the streaming parser as well? |
b2fa967
to
a3a6359
Compare
46c387c
to
88a8fd3
Compare
b5733bc
to
115b6f1
Compare
115b6f1
to
b5cc5c2
Compare
…dtreece/prom-streaming-matrix-vector
i see 3 possible approaches:
i like [1] the most, but it is the most risky (mostly because of the alerting-format change). if [1] is not possible, i vote for [2] .. probably.. not 100% sure. what do you think? |
@gabor check out this example on play.grafana.com it seems like |
@gabor it looks like the |
i like the keep_nan_as_it_is approach 👍 . the problem will be that if we want to keep the behind-feature-flag mode in a way that produces different testdata-snapshots, then we have to update the PR to not run the tests, otherwise we can never merge it 😄 |
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.
LGTM
use `prometheusStreamingJSONParser` feature toggle to enable
What this PR does / why we need it:
This is the second step in a series of PRs that will use the prometheus JSON streaming parser added by #44520.
The current plan is:
buffered
package (Prometheus: Move existing query logic to new buffered package #48668)querydata
package that uses a standard HTTP client instead of the prometheus go client and the streaming response parser (this PR)buffered
package, remove feature flag, and renamestreaming
package (future PR once things have stabilized)Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer: