You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The whole thing looks a bit like this (authentication code is left out. we also set context tags for application insights and filter some requests from the tracing, left out for brevity):
Although we set AutoCollectRequests and AutoCollectDependencies and autoDependencyCorrelation to true and we're using W3C correlation, there is no correlation between the incoming requests to the gateway and incoming requests on the subgraph(s). The subgraphs get correlation headers on their incoming requests, but the traceId differs from the traceId that's reported by the apollo-gateway.
This issue becomes most visible, when looking at the azure application map. No requests between the apollo-gateway and the subgraphs can be observed, instead the subgraphs appear as external dependencies on the map.
When debugging through the applicationinsights code I can observe, that the error exists on the apollo gateway. The traceIds for the incoming and the outgoing request differ in AutoCollectHttpRequests.trackRequest in HttpRequest.ts (for the incoming request) and in AutoCollectHttpDependencies.trackRequest in HttpDependencies.ts (for the outgoing request). Consequently, the headers for the outgoing request (which the subgraph receives) contain an unrelated traceId and correlation is not performed in Azure monitor.
I have tested with DistributedTracingModes.AI and wasn't able to get the correlation to work either, although I didn't analyze the error through debugging in this case. I'm assuming the behaviour is very similar.
Is this a bug in ApplicationInsights-node.js or are we missing something in the configuration of the apollo gateway?
The text was updated successfully, but these errors were encountered:
We're trying to use request correlation in apollo gateway. We want to correlate federated graphql requests in order to identify slow subgraphs.
Here's what we did: We set up an apollo-gateway as described in the federation documentation. And before anything else is called, we configure the applicationinsights as described in the node.js documentation for application insights.
The whole thing looks a bit like this (authentication code is left out. we also set context tags for application insights and filter some requests from the tracing, left out for brevity):
Although we set AutoCollectRequests and AutoCollectDependencies and autoDependencyCorrelation to true and we're using W3C correlation, there is no correlation between the incoming requests to the gateway and incoming requests on the subgraph(s). The subgraphs get correlation headers on their incoming requests, but the traceId differs from the traceId that's reported by the apollo-gateway.
This issue becomes most visible, when looking at the azure application map. No requests between the apollo-gateway and the subgraphs can be observed, instead the subgraphs appear as external dependencies on the map.
When debugging through the applicationinsights code I can observe, that the error exists on the apollo gateway. The traceIds for the incoming and the outgoing request differ in
AutoCollectHttpRequests.trackRequest
inHttpRequest.ts
(for the incoming request) and inAutoCollectHttpDependencies.trackRequest
inHttpDependencies.ts
(for the outgoing request). Consequently, the headers for the outgoing request (which the subgraph receives) contain an unrelated traceId and correlation is not performed in Azure monitor.I have tested with
DistributedTracingModes.AI
and wasn't able to get the correlation to work either, although I didn't analyze the error through debugging in this case. I'm assuming the behaviour is very similar.Is this a bug in ApplicationInsights-node.js or are we missing something in the configuration of the apollo gateway?
The text was updated successfully, but these errors were encountered: