-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
traceparent
or X-Opaque-Id
headers to query tags
#2506
Comments
Just found out that there is a standard HTTP header for doing the above: References:
I found it on the Elasticsearch docs, which uses an X-Opaque-Id for the same purpose. Also, the tracestate header allows key value pairs for extra vendor information. We could include this information on the query tags. One problem with traceparent is that it has its own format
Though It also requires parsing and validating the header value as mentioned on the docs. On contrast the |
traceparent
or X-Opaque-Id
to query tagstraceparent
or X-Opaque-Id
headers to query tags
There's also the x-request-id header. With these variety of options think it'd be easier to just make it configurable. So |
A |
Should we somehow add the value passed through this header to the request logs, too? |
@wolfgangwalther What would the format look like? Also, how would that help with observability? Right now I'm mostly thinking of parsing the db logs. |
No idea, yet. It probably doesn't fit CLF, we'd might need Extended Log Format.
I had some cases where I wasn't sure which component (nginx, postgrest, postgresql) was actually throwing an error, when I got some failed requests on the client. It would be nice to just put that trace header on the request on the client and then grep all logs to see where it's logged and where it's not. I also had some cases where I wanted to track |
To be clear, what was implemented as new a new config option is called |
That would actually be really nice. Right now there doesn't seem to be any way to create full trace logs from frontend to backend because there's no way to identify the request log in postgrest with the requests from frontend / elsewhere. |
Related to #3415 (comment) |
Query tags are comments on the SQL query(
SELECT ... FROM tbl /*key=value/*
) , they're useful for getting context on the database logs.References:
We could include
request_id
(request_id=...). It could be generated by us or configured to be obtained from a header since a proxy already adds a request id: nginx has request_id, cloudflare has cf-ray, etc. We could also include this in the response header(configurable), to make it easier for users to search the generated query in the logs.It should be configurable
The text was updated successfully, but these errors were encountered: