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
tl;dr I want to be able to call my distributed APQ cache with the trace id from the GraphQL HTTP request
A customer is adding a Redis cluster to their pipeline for APQ requests. Today it is not possible to access the operationContext while making a fetch to Redis because the call to .get only passes in the simple key.
This by design due to the simple nature of @apollo/utils.keyvaluecache which only accepts the key for .get calls.
However, inside the context in the requestContext we store a DataDog span that we would like to activate and create a custom DD span to have metrics for the request to the redis cluster.
Since we are not able to continue the span with the same trace id from the request the spans look like this and are detached from the GraphQL request:
Instead we would like to be able to read the trace id from the request context which means we need some way of passing extra info to the .get call. Some small tweaks to the existing package like this could work but open for feedback
exportinterfaceKeyValueCache<V=string>{get(key: string): Promise<V|undefined>;// Optional new method so it is not breakingget?(key: string,options?: {}): Promise<V|undefined>;set(key: string,value: V,options?: KeyValueCacheSetOptions): Promise<void>;delete(key: string): Promise<boolean|void>;}
The text was updated successfully, but these errors were encountered:
tl;dr I want to be able to call my distributed APQ cache with the trace id from the GraphQL HTTP request
A customer is adding a Redis cluster to their pipeline for APQ requests. Today it is not possible to access the
operationContext
while making a fetch to Redis because the call to.get
only passes in the simple key.apollo-server/packages/server/src/requestPipeline.ts
Line 145 in 1b940cf
This by design due to the simple nature of @apollo/utils.keyvaluecache which only accepts the key for
.get
calls.However, inside the context in the requestContext we store a DataDog span that we would like to activate and create a custom DD span to have metrics for the request to the redis cluster.
Since we are not able to continue the span with the same trace id from the request the spans look like this and are detached from the GraphQL request:
Instead we would like to be able to read the trace id from the request context which means we need some way of passing extra info to the
.get
call. Some small tweaks to the existing package like this could work but open for feedbackThe text was updated successfully, but these errors were encountered: