Skip to content

Commit 57083fa

Browse files
authored
[Website] Fix the diagnostic event tables on the instrumentation page (#10672)
1 parent 1e8bc18 commit 57083fa

1 file changed

Lines changed: 58 additions & 52 deletions

File tree

‎website/content/docs/hotchocolate/server/instrumentation.md‎

Lines changed: 58 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -106,25 +106,27 @@ Instrument server events of the Hot Chocolate transport layer by creating a clas
106106
```csharp
107107
public class MyServerEventListener : ServerDiagnosticEventListener
108108
{
109-
public override IDisposable ExecuteHttpRequest(RequestContext context)
109+
public override IDisposable ExecuteHttpRequest(HttpContext context,
110+
HttpRequestKind kind)
110111
{
111112
// Omitted code for brevity
112113
}
113114
}
114115
```
115116

116-
| Method name | Description |
117-
| -------------------------- | ------------------------------------------------------------------------------------------------------------ |
118-
| ExecuteHttpRequest | Called when starting to execute a GraphQL over HTTP request in the transport layer. |
119-
| StartSingleRequest | Called within the ExecuteHttpRequest scope, signals that a single GraphQL request will be executed. |
120-
| StartBatchRequest | Called within the ExecuteHttpRequest scope, signals that a GraphQL batch request will be executed. |
121-
| StartOperationBatchRequest | Called within the ExecuteHttpRequest scope, signals that an operation batch request will be executed. |
122-
| HttpRequestError | Called within the ExecuteHttpRequest scope, signals an error while processing the GraphQL over HTTP request. |
123-
| ParseHttpRequest | Called when starting to parse a GraphQL HTTP request. |
124-
| ParserErrors | Called within the ParseHttpRequest scope, signals an error while parsing the GraphQL request. |
125-
| FormatHttpResponse | Called when starting to format a GraphQL query result. |
126-
| WebSocketSession | Called when starting to establish a GraphQL WebSocket session. |
127-
| WebSocketSessionError | Called within the WebSocketSession scope, signals an error that terminated the session. |
117+
| Method name | Description |
118+
| ------------------------------ | ---------------------------------------------------------------------------------------------------------------- |
119+
| ExecuteHttpRequest | Called when starting to execute a GraphQL over HTTP request in the transport layer. |
120+
| HttpRequestError | Called within the ExecuteHttpRequest scope, signals an error while processing the GraphQL over HTTP request. |
121+
| ParseHttpRequest | Called when starting to parse a GraphQL HTTP request. |
122+
| ParserErrors | Called within the ParseHttpRequest scope, signals an error while parsing the GraphQL request. |
123+
| StartSingleRequest | Called within the ExecuteHttpRequest scope, signals that a single GraphQL request will be executed. |
124+
| StartBatchRequest | Called within the ExecuteHttpRequest scope, signals that a GraphQL batch request will be executed. |
125+
| StartOperationBatchRequest | Called within the ExecuteHttpRequest scope, signals that an operation batch request will be executed. |
126+
| FormatHttpResponse | Called when starting to format a GraphQL query result. |
127+
| WebSocketSession | Called when starting to establish a GraphQL WebSocket session. |
128+
| WebSocketConnectionInitialized | Called within the WebSocketSession scope once the server accepts the client's connection initialization message. |
129+
| WebSocketSessionError | Called within the WebSocketSession scope, signals an error that terminated the session. |
128130

129131
## Execution Events
130132

@@ -142,38 +144,38 @@ public class MyExecutionEventListener : ExecutionDiagnosticEventListener
142144

143145
The following methods can be overridden:
144146

145-
| Method name | Description |
146-
| ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
147-
| ExecuteRequest | Scope that encloses the entire GraphQL request execution. Also the first diagnostic event raised during a request. |
148-
| RequestError | Called if the GraphQL request produced an error. Called immediately before the scope of `ExecuteRequest` is disposed. |
149-
| ExecuteSubscription | Scope that encloses the execution of a subscription query. Created when a client subscribes and disposed when the subscription ends. |
150-
| ParseDocument | Scope that encloses the parsing of a document. |
151-
| SyntaxError | Called if a document could not be parsed due to a syntax error. |
152-
| ValidateDocument | Scope that encloses the validation of a document. |
153-
| ValidationErrors | Called if errors occurred during document validation. |
154-
| AnalyzeOperationComplexity | Called when starting to analyze operation complexity. |
155-
| OperationComplexityAnalyzerCompiled | Called within AnalyzeOperationComplexity scope when an analyzer is compiled. |
156-
| OperationComplexityResult | Called within AnalyzeOperationComplexity scope, reports the outcome of the analyzer. |
157-
| CoerceVariables | Called when starting to coerce variables for a request. |
158-
| CompileOperation | Called when starting to compile the GraphQL operation from the syntax tree. |
159-
| ExecuteOperation | Called when starting to execute the GraphQL operation and its resolvers. |
160-
| StartProcessing | Scope that encloses the scheduling of work, such as invoking a DataLoader or starting execution tasks. |
161-
| StopProcessing | Called if the execution engine has to wait for resolvers to complete or whenever execution has completed. |
162-
| RunTask | Scope that encloses the execution of an execution task. A `ResolverExecutionTask` uses the `ResolveFieldValue` event instead. |
163-
| TaskError | Called if an execution task produced an error. |
164-
| ResolveFieldValue | Scope that encloses the execution of a specific field resolver. (\*) |
165-
| ResolverError | Called if a specific field resolver produces an error. |
166-
| OnSubscriptionEvent | Scope that encloses the computation of a subscription result once the event stream yields a new payload. |
167-
| SubscriptionEventError | Called if the computation of the subscription result produced an error. |
168-
| AddedDocumentToCache | Called once a document has been added to `DocumentCache`. |
169-
| RetrievedDocumentFromCache | Called once a document has been retrieved from the `DocumentCache`. |
170-
| AddedOperationToCache | Called once an operation has been added to the `OperationCache`. |
171-
| RetrievedOperationFromCache | Called once an operation has been retrieved from the `OperationCache`. |
172-
| RetrievedDocumentFromStorage | Called once a document has been retrieved from an operation document storage. |
173-
| ExecutorCreated | Called once a request executor has been created. Executors are created once per schema during the first request. |
174-
| ExecutorEvicted | Called once a request executor is evicted, which can happen if the schema or executor configuration changes. |
175-
176-
(\*): The `ResolveFieldValue` event is not invoked by default because it would add too much overhead for each resolver in a query. Override the `EnableResolveFieldValue` property to enable it:
147+
| Method name | Description |
148+
| ---------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
149+
| ExecuteRequest | Scope that encloses the entire GraphQL request execution. Also the first diagnostic event raised during a request. |
150+
| RequestError | Called within the `ExecuteRequest` scope if an exception aborts the request, or within the `ParseDocument` scope if the document cannot be parsed. |
151+
| ParseDocument | Scope that encloses the parsing of a document. |
152+
| ValidateDocument | Scope that encloses the validation of a document. |
153+
| ValidationErrors | Called if errors occurred during document validation. |
154+
| CoerceVariables | Called when starting to coerce variables for a request. |
155+
| AnalyzeOperationCost | Scope that encloses the cost analysis of an operation. |
156+
| OperationCost | Called within the `AnalyzeOperationCost` scope, reports the field cost and type cost of the operation. |
157+
| CompileOperation | Called when starting to compile the GraphQL operation from the syntax tree. |
158+
| ExecuteOperation | Called when starting to execute the GraphQL operation and its resolvers. |
159+
| StartProcessing | Called when the execution engine starts or resumes running execution tasks. |
160+
| StopProcessing | Called if the execution engine pauses while execution tasks, such as resolvers, are still running. |
161+
| RunTask | Scope that encloses the execution of an execution task, such as a deferred fragment. Field resolvers raise `ResolveFieldValue` instead. (\*) |
162+
| TaskError | Called if an execution task produced an error. |
163+
| ResolveFieldValue | Scope that encloses the execution of a specific field resolver. (\*) |
164+
| ResolverError | Called if a specific field resolver produces an error. |
165+
| ExecuteSubscription | Scope that encloses the execution of a subscription query. Created when a client subscribes and disposed when the subscription ends. |
166+
| OnSubscriptionEvent | Scope that encloses the computation of a subscription result once the event stream yields a new payload. |
167+
| SubscriptionEventError | Called if the computation of the subscription result produced an error. |
168+
| AddedDocumentToCache | Called once a document has been added to `DocumentCache`. |
169+
| RetrievedDocumentFromCache | Called once a document has been retrieved from the `DocumentCache`. |
170+
| AddedOperationToCache | Called once an operation has been added to the `OperationCache`. |
171+
| RetrievedOperationFromCache | Called once an operation has been retrieved from the `OperationCache`. |
172+
| RetrievedDocumentFromStorage | Called once a document has been retrieved from an operation document storage. |
173+
| DocumentNotFoundInStorage | Called if the document of a persisted operation cannot be found in the operation document storage. |
174+
| UntrustedDocumentRejected | Called if a request is rejected because it carries a document that is not a persisted operation while only persisted operations are allowed. |
175+
| ExecutorCreated | Called once a request executor has been created. Executors are created once per schema during the first request. |
176+
| ExecutorEvicted | Called once a request executor is evicted, which can happen if the schema or executor configuration changes. |
177+
178+
(\*): The `ResolveFieldValue` and `RunTask` events are not invoked by default because they would add too much overhead for each resolver and task in a query. Override the `EnableResolveFieldValue` property to enable them:
177179

178180
```csharp
179181
public class MyExecutionEventListener : ExecutionDiagnosticEventListener
@@ -204,13 +206,17 @@ public class MyDataLoaderEventListener : DataLoaderDiagnosticEventListener
204206

205207
The following methods can be overridden:
206208

207-
| Method name | Description |
208-
| --------------------- | -------------------------------------------------------------------------------------------------------- |
209-
| ExecuteBatch | Scope that encloses a batch operation, resolving a specific set of keys. |
210-
| BatchResults | Called once a batch operation has completed and all items for a specific set of keys have been resolved. |
211-
| BatchError | Called if a batch operation has failed. |
212-
| BatchItemError | Called for a specific item that contained an error within a batch operation. |
213-
| ResolvedTaskFromCache | Called once a task to resolve an item by its key has been added or retrieved from the `TaskCache`. |
209+
| Method name | Description |
210+
| --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
211+
| ResolvedTaskFromCache | Called once the task that resolves an item by its key has been retrieved from the `PromiseCache`. |
212+
| ExecuteBatch | Scope that encloses a batch operation, resolving a specific set of keys. |
213+
| BatchResults | Called once a batch operation has completed and all items for a specific set of keys have been resolved. |
214+
| BatchError | Called if a batch operation has failed. |
215+
| BatchItemError | Called for a specific item that contained an error within a batch operation. |
216+
| RunBatchDispatchCoordinator | Scope that encloses a run of the batch dispatch coordinator, which decides when open batches are dispatched. |
217+
| BatchEvaluated | Called within the RunBatchDispatchCoordinator scope if an evaluation of the open batches dispatches none of them, reports the number of open batches. |
218+
| BatchDispatched | Called within the RunBatchDispatchCoordinator scope once one or more batches have been dispatched, reports their number. |
219+
| BatchDispatchError | Called if the batch dispatch coordinator fails with an exception. |
214220

215221
# OpenTelemetry
216222

0 commit comments

Comments
 (0)