-
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
[docs] Create debugging-client-requests.mdx #6504
Closed
+57
−0
Closed
Changes from 3 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
7727ea5
Create debugging-client-requests.mdx
smyrick d431547
Create debug-client-requests.md
smyrick e592d8f
Rename debug-client-requests.md to docs_debug_client_requests.md
smyrick 4f0cee4
Update debugging-client-requests.mdx
smyrick 8d641f8
Update debugging-client-requests.mdx
smyrick 935efb4
Update debugging-client-requests.mdx
smyrick b09d811
Update debugging-client-requests.mdx
smyrick File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
### [docs] Create debugging-client-requests.mdx ([PR #6504](https://github.com/apollographql/router/pull/6504)) | ||
|
||
Add a docs page about how to debug client requests. This infomation is spread across many different features so this serves as a landing page for all of that. | ||
|
||
By [@smyrick](https://github.com/smyrick) in https://github.com/apollographql/router/pull/6504 |
52 changes: 52 additions & 0 deletions
52
docs/source/routing/observability/debugging-client-requests.mdx
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
--- | ||
title: Debugging Client Requests to GraphOS Router | ||
subtitle: Log incoming requests to help debug problematic queries or errors | ||
description: Enable telemetry features to help gain more visibility into incoming HTTP requests and help debug issues your clients may be having. | ||
--- | ||
|
||
GraphOS Router by default does not emit access logs for the incoming client HTTP requests, nor are other features, like OpenTelemetry, on by default that include every request. Given the volume and size of GraphQL requests, this would produce a large amount of telemetry data that may impact your observability costs. | ||
|
||
The best way to see GraphQL operation data is to use [GraphOS Insights](https://www.apollographql.com/docs/graphos/platform/insights). Here you will be able to see failed requests, what the client id was, and what was the exact GraphQL error if enabled. | ||
smyrick marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
If however, you are having issues with some requests coming from clients and would like to enable debugging features in your own evnironment, we reccomend first doing this in a non-production environment or using logic to do this on a per-request basis. | ||
|
||
## OpenTelemetry Spans and Traces | ||
Using [Router Telemetry](https://www.apollographql.com/docs/graphos/routing/observability/telemetry), the trace for a give request will have a span labeled as `router`. This span will contain the HTTP information for a given client request with our [standard attributes](https://www.apollographql.com/docs/graphos/reference/router/telemetry/instrumentation/standard-attributes#router). | ||
|
||
This will include helpful information about the request and response, but you will notice that an attribute for the HTTP body text is not included. If you would like to see the GraphQL operation first check your [GraphOS Insights](https://www.apollographql.com/docs/graphos/platform/insights) or follow the other options listed below. | ||
|
||
## Request/Response Logging | ||
Using either the [logging-when-header](https://www.apollographql.com/docs/graphos/reference/router/telemetry/log-exporters/overview#requestresponse-logging) feature you can include the request body in your logs conditionally. | ||
smyrick marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
```yaml title="router.yaml" | ||
telemetry: | ||
exporters: | ||
logging: | ||
# If one of these headers matches we will log supergraph and subgraphs requests/responses | ||
experimental_when_header: | ||
- name: apollo-router-log-request | ||
value: my_client | ||
headers: true # default: false | ||
body: true # default: false | ||
``` | ||
|
||
## Rhai Scripts & Coprocessors | ||
|
||
|
||
## Debug Router Logs | ||
GraphOS Router by default uses the `info` level for its logging. [Enabling other logging levels](https://www.apollographql.com/docs/graphos/reference/router/telemetry/log-exporters/overview) can help debug specific scenarios. It is only reccomended for local or non-production environments. | ||
|
||
## Alternative Cloud Services | ||
If you are deploying GraphOS Router to a cloud service, it is likely that you already have access to the raw HTTP logs through other services such as a load balancer. Using the trace id or operation hash, you should be able to find a specific client request to logs for that operation. Check out the docs for popular cloud providers here: | ||
|
||
AWS | ||
* [AWS CloudWatch Logs](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/WhatIsCloudWatchLogs.html) | ||
* [AWS Elastic Load Balancer](https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-access-logs.html) | ||
|
||
GCP | ||
* [Google Cloud Observability](https://cloud.google.com/logging/docs/log-analytics) | ||
* [Google Cloud Load Balancing](https://cloud.google.com/load-balancing/docs/l7-internal/monitoring) | ||
|
||
Azure | ||
* [Azure App Service Logging](https://learn.microsoft.com/en-us/azure/app-service/troubleshoot-diagnostic-logs) | ||
* [Azure Load Balancer](https://learn.microsoft.com/en-us/azure/load-balancer/monitor-load-balancer] |
Oops, something went wrong.
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.
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.
Wording is bit confusing here. Maybe rewrite to something like:
"By default, the GraphOS Router does not generate access logs for incoming client HTTP requests, nor are features like OpenTelemetry enabled to capture every request."