Enhanced trace attributes for Thanos gRPC#8723
Open
ringerc wants to merge 11 commits intothanos-io:mainfrom
Open
Enhanced trace attributes for Thanos gRPC#8723ringerc wants to merge 11 commits intothanos-io:mainfrom
ringerc wants to merge 11 commits intothanos-io:mainfrom
Conversation
2e1aaf2 to
33aa1f5
Compare
Contributor
Author
|
Docs check failure appears transient
The (8,2) CI tests seem to be broken in general too, I've seen this failure on other PRs. Does not appear related. |
Add a query.expr attribute to inbound gRPC Query trace spans. The query is sometimes already exposed in inner spans when the Thanos engine is in use, but not when the Prometheus engine is in use. And it's helpful to have it recorded at the boundaries between components on a SERVER span, so it remains visible when INNER spans are folded. Signed-off-by: Craig Ringer <craig.ringer@enterprisedb.com>
Add result.series and result.samples attributes to traces for the thanos Query gRPC response. Signed-off-by: Craig Ringer <craig.ringer@enterprisedb.com>
Add result.series and result.samples attributes to trace spans for Series gRPC responses. Signed-off-by: Craig Ringer <craig.ringer@enterprisedb.com>
Make it easier to reliably find the series selector for Series gRPC requests in traces by injecting it directly onto the Series gRPC entrypoint trace span. Signed-off-by: Craig Ringer <craig.ringer@enterprisedb.com>
Add a result.wire_bytes trace attribute that records the gRPC response size for a given request by using a gRPC interceptor. Signed-off-by: Craig Ringer <craig.ringer@enterprisedb.com>
Add result.estimated_final_memory_bytes, result.series, result.samples trace attributes for direct /api/v1/query and /api/v1/query_range requests served by Thanos Query. The result.estimated_final_memory_bytes is only computed when tracing is enabled. It estimates the size in memory of the final promql result that is to be serialized to json and sent to the client. Signed-off-by: Craig Ringer <craig.ringer@enterprisedb.com>
Count the size of HTTP responses sent on the wire and add the size to the result.wire_bytes trace span. Counting is only performed if tracing is enabled and the span is sampled. Signed-off-by: Craig Ringer <craig.ringer@enterprisedb.com>
This commit's test modifications were developed with the assistance of a LLM tool. Signed-off-by: Craig Ringer <craig.ringer@enterprisedb.com>
Signed-off-by: Craig Ringer <craig.ringer@enterprisedb.com>
This has been removed from Prometheus in 3.10 in favour of the stdlib errors.Join. Signed-off-by: Craig Ringer <craig.ringer@enterprisedb.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Enhance the span attributes exposed by Thanos to tracing collectors with:
query.exprattribute on inbound Query and QueryRange gRPC request spansresult.seriesandresult.samplescounts on responses to Query and QueryRange gRPCresult.seriesandresult.samplescounts on responses to Series gRPCseries.selectoron inbound Series gRPC requestsresult.wire_bytes(computed with gRPC interceptor) to record the bytes-on-the-wire sent in response to a particular series or query gRPC requestresult.seriesandresult.samplesfor response size, and aresult.estimated_final_memory_bytesthat estimates the size of thepromql.Valuerepresentation of the final result in-memory before it is serialized to json and sent to the client.These attributes make it easier to understand what Thanos is doing in distributed queries.
A follow-up PR will add wire bytes recording for the HTTP API response, and result-memory-use estimation for the gRPC endpoints.
Verification
I've exercised this by deploying the changes.
I'll look at further test cover updates for the tracing tests too.