-
Notifications
You must be signed in to change notification settings - Fork 510
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
Endpoints are missing a content-type header #1185
Comments
Thanks for creating this! The way Tempo deals with content encoding is a bit funky because we convert everything to protobuf internally. So the response coming from the querier will be in protobuf and the query-frontend is responsible for converting it into JSON if the user requested this. Some pointers about the code: Trace lookupThis is where we determine the response content encoding: And this is where we set the response body, we should probably set the content-type here as well: SearchThe search endpoint is a bit simpler because we only return search results in JSON. We probably should set the content-type somewhere here: https://github.com/grafana/tempo/blob/main/modules/frontend/frontend.go#L163-L184
|
Probably won't hurt for sure, but as you said, everything is done over protobuf internally, so it would still require setting the content-type in the query frontend based on the accept header yeah? |
Yeah. that's true. I was thinking of a scenario in which the user requests protobuf, in that case we don't have to do any conversion in the query-frontend. But we actually still have to manipulate the body a little bit to return the correct format so we never forward the request as-is. |
* Add Content-Type header on query-frontend paths Fixes #1185 * Update CHANGELOG * Add Content-Type header to TraceByIDHandler in querier
Some of the API endpoints are returning a content-type of
text/plain
even if theAccept
header on the request is set toapplication/json
orapplication/protobuf
. I noticed it on/api/traces/{traceID}
and/api/search
at least, there could be others as well.The text was updated successfully, but these errors were encountered: