-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Add query bytes fetched along with other series stats in Query Response #7390
base: main
Are you sure you want to change the base?
Conversation
it is to address this issue: #7365 |
8829c67
to
723f648
Compare
add thanos stats queried Signed-off-by: Christopher Li <christopher.li@databricks.com>
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.
It is a change on API response. I wonder if we want to put this under a FF in the API request.
sure that sounds like an idea. Another route I want to chase down is if we want to include in other metadata format like http headers, do we have any guidelines/examples on where we should put? |
Sorry I am a little bit unsure what you want to achieve here with http headers. Can you elaborate it more? Do you plan to log the info or ? |
Our use case is to export this stat information along with query response, and it could be part of response or pass with http headers. |
Warnings []error `json:"warnings,omitempty"` | ||
QueryAnalysis queryTelemetry `json:"analysis,omitempty"` | ||
Warnings []error `json:"warnings,omitempty"` | ||
SeriesStatsCounter storepb.SeriesStatsCounter `json:"seriesStatsCounter,omitempty"` |
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'm against this, it's a feature that could be so much more useful. For example, if you have a query like sum(a) + sum(b)
then how do you know which selector downloaded more data and what should be the focus of optimizations? We could do much better. In fact, there's a mechanism/place where this kind of info should be exposed.
Please take a look at the Analyze functionality and focus there. A good plan of action would be first to add some mechanism through context.Context that would allow capturing more granular data about the fan-out. This could be used in the PromQL engine to "surface" this data through the Analyze() call, and then this could be shown in the UI next to each selector.
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.
Hi @GiedriusS in our case our usecase is much simpler: we simply want to know how expensive each query is and attribute our total query cost to each user based on # of bytes fetched/# of timeseries.
I could follow @yeya24 's suggestion on making it a command line flag on querier.
The method you mentioned is an overkill for this usecase and could be put as a TODO, what do you think?
Add query bytes fetched along with other series stats in Query Response
Want to seek approval before I added changelog
Changes
Verification
curl http://localhost:10902/api/v1/query?query='COUNT(up)'
{"status":"success","data":{"resultType":"vector","result":[{"metric":{},"value":[1716515107.878,"173"]}],"analysis":{},"seriesStatsCounter":{"Series":174,"Chunks":174,"Samples":2248,"Bytes":101533}}}