Skip to content

Commit 5bea82c

Browse files
authored
Removed Apollo Tracing documentation (#7595)
1 parent 2e50852 commit 5bea82c

File tree

2 files changed

+1
-100
lines changed

2 files changed

+1
-100
lines changed

website/src/docs/hotchocolate/v14/server/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Though not considered one of the responsibilities of a GraphQL server, for conve
5050

5151
# Instrumentation
5252

53-
Hot Chocolate allows you to gather instrumentation data about your GraphQL server, by hooking into various events in the execution process of a GraphQL request. You will also learn how to setup our OpenTelemetry integration and how to utilize _Apollo Tracing_.
53+
Hot Chocolate allows you to gather instrumentation data about your GraphQL server, by hooking into various events in the execution process of a GraphQL request. You will also learn how to set up our OpenTelemetry integration.
5454

5555
[Learn more about instrumentation](/docs/hotchocolate/v14/server/instrumentation)
5656

website/src/docs/hotchocolate/v14/server/instrumentation.md

Lines changed: 0 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -374,102 +374,3 @@ builder.Services.AddSingleton<ActivityEnricher, CustomActivityEnricher>();
374374
```
375375

376376
![Jaeger](../../../shared/jaeger4.png)
377-
378-
# Apollo Tracing
379-
380-
_Apollo Tracing_ is a [performance tracing specification](https://github.com/apollographql/apollo-tracing) for GraphQL servers. It works by returning tracing information about the current request alongside the computed data. While it is not part of the GraphQL specification itself, there is a common agreement in the GraphQL community that all GraphQL servers should support it.
381-
382-
**Example**
383-
384-
```graphql
385-
{
386-
book(id: 1) {
387-
name
388-
author
389-
}
390-
}
391-
```
392-
393-
The above request would result in the below response if _Apollo Tracing_ is enabled.
394-
395-
```json
396-
{
397-
"data": {
398-
"book": {
399-
"name": "C# in Depth",
400-
"author": "Jon Skeet"
401-
}
402-
},
403-
"extensions": {
404-
"tracing": {
405-
"version": 1,
406-
"startTime": "2021-09-25T15:31:41.6515774Z",
407-
"endTime": "2021-09-25T15:31:43.1602255Z",
408-
"duration": 1508648100,
409-
"parsing": { "startOffset": 13335, "duration": 781 },
410-
"validation": { "startOffset": 17012, "duration": 323681 },
411-
"execution": {
412-
"resolvers": [
413-
{
414-
"path": ["book"],
415-
"parentType": "Query",
416-
"fieldName": "book",
417-
"returnType": "Book",
418-
"startOffset": 587048,
419-
"duration": 1004748344
420-
},
421-
{
422-
"path": ["book", "author"],
423-
"parentType": "Book",
424-
"fieldName": "author",
425-
"returnType": "String",
426-
"startOffset": 1005854823,
427-
"duration": 500265020
428-
}
429-
]
430-
}
431-
}
432-
}
433-
}
434-
```
435-
436-
## Enabling Apollo Tracing
437-
438-
_Apollo Tracing_ needs to be explicitly enabled by calling `AddApolloTracing` on the `IRequestExecutorBuilder`.
439-
440-
```csharp
441-
builder.Services
442-
.AddGraphQLServer()
443-
.AddApolloTracing();
444-
```
445-
446-
Further, we can specify a `TracingPreference`. Per default, it is `TracingPreference.OnDemand`.
447-
448-
```csharp
449-
builder.Services
450-
.AddGraphQLServer()
451-
.AddApolloTracing(TracingPreference.Always);
452-
```
453-
454-
There are three possible options for the `TracingPreference`.
455-
456-
| Option | Description |
457-
| ---------- | -------------------------------------------------------------------------------------------- |
458-
| `Never` | _Apollo Tracing_ is disabled. Useful if we want to conditionally disable _Apollo Tracing_. |
459-
| `OnDemand` | _Apollo Tracing_ only traces requests if a specific header is passed with the query request. |
460-
| `Always` | _Apollo Tracing_ is always enabled, and all query requests are traced automatically. |
461-
462-
## On Demand
463-
464-
When _Apollo Tracing_ is added using the `TracingPreference.OnDemand`, we are required to pass one of the following HTTP headers with our query request in order to enable tracing for this specific request.
465-
466-
- `GraphQL-Tracing=1`
467-
- `X-Apollo-Tracing=1`
468-
469-
When using `curl` this could look like the following.
470-
471-
```bash
472-
curl -X POST -H 'GraphQL-Tracing: 1' -H 'Content-Type: application/json' \
473-
-d '{"query":"{\n book(id: 1) {\n name\n author\n }\n}\n"}' \
474-
'http://localhost:5000/graphql'
475-
```

0 commit comments

Comments
 (0)