-
Notifications
You must be signed in to change notification settings - Fork 275
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
Improve logging experience #1840
Comments
This is great! A few things come to mind immediately:
|
Oh, could the title of this issue be a bit more specific?: maybe "subgraph request/response logging"? |
It's not specific to subgraph request/response logging. It's more global, but yes indeed in this description I was mainly focus on that topic. But for example the field |
Ok, fair! Let's leave it how it is for now and then consider breaking this into individual issues in the future. (In the general sense "Improve logging" is, I think, too generic and I wouldn't want this to turn into an issue we can't concretely close just because it touches on too many things.) |
The
will filter out all the errors with that exact ID. |
Will be great also to add other patterns for logging. Currently this goes directly inside stdout and for us that's not a viable option currently since we are using multi-tenant k8s cluster. We decided to pipe the log to a file but that doesn't take care of the file rotation and everything. |
Going to close this in favor of #3226 |
When you need to debug the router or find why you received an error from the router it's often a pain and can take time to discover what's going on. For example if you have to debug an error reported by the router and just wants to know what was the request sent and raw response received by a subgraph, for now it needs to add logs directly in the router codebase.
Another example, sometimes we throw an error in the graphql errors array with less context and cannot find the equivalent error with more context in our logs.
What I would like is to have a simple mechanism to find related logs to a GraphQL error just by grepping our logs. We could add a unique identifier generated for a specific error and provide this ID in
extensions
Example:
in logs
error_id="123e4567-e89b-12d3-a456-426614174000"
Also we could add a
logging
section intelemetry
to configure if we want to log requests and raw responses from subgraphs, if we want to add some redacting to not leak any sensible information.Sub tasks:
formatResponse
from the gatewayThe text was updated successfully, but these errors were encountered: