Skip to content
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

fix tracing instrumentation docs #398

Merged
merged 2 commits into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions graphql-java-support/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,7 @@ GraphQL graphql = GraphQL.newGraphQL(graphQLSchema)
.build();
```

**By default, all requests will be traced.** In order to skip dev requests and only trace requests that come from the Apollo Gateway, you should populate tracing information in the `GraphQLContext` map.
This will ensure that only requests with `apollo-federation-include-trace=ftv1` header value will be traced.
Only requests with `apollo-federation-include-trace=ftv1` header value will be traced and you need to populate this tracing information in the `GraphQLContext` map.

```java
String federatedTracingHeaderValue = httpRequest.getHeader(FEDERATED_TRACING_HEADER_NAME);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
* A GraphQL Java Instrumentation that computes a max age for an operation based on @cacheControl
* directives.
*
* By default, this instrumentation will only set the `Cache-Control` `max-age` value IF positive int
* value is provided. If you would rather want to return explicit `max-age=0` values, you need to
* explicitly opt-in to this behavior by specifying `allowZeroMaxAge=true` constructor value.
* <p>By default, this instrumentation will only set the `Cache-Control` `max-age` value IF positive
* int value is provided. If you would rather want to return explicit `max-age=0` values, you need
* to explicitly opt-in to this behavior by specifying `allowZeroMaxAge=true` constructor value.
*
* <p>You can retrieve the "max-age=..." header value with a {@link GraphQLContext}: <code>
* String cacheControlHeader = CacheControlInstrumentation.cacheControlContext(context);
Expand Down