在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):lifeomic/graphql-resolvers-xray-tracing开源软件地址(OpenSource Url):https://github.com/lifeomic/graphql-resolvers-xray-tracing开源编程语言(OpenSource Language):TypeScript 96.1%开源软件介绍(OpenSource Introduction):GraphQL Middleware to add X-Ray tracing for resolversTo enable X-Ray subsegment creation for GraphQL resolvers, add this package as a dependency of your project and use code like this: const traceResolvers = require('@lifeomic/graphql-resolvers-xray-tracing');
const schema = makeExecutableSchema( ... );
traceResolvers(schema); After enabling X-Ray tracing, you should see new subsegments in your X-Ray traces like this: Local DevelopmentIf you would like to run your GraphQL server without tracing the resolvers (such as during local development), you can use environment variables to conditionally wrap them. For example, the AWS Lambda runtime injects the const traceResolvers = require('@lifeomic/graphql-resolvers-xray-tracing');
const schema = makeExecutableSchema( ... );
if (process.env.AWS_LAMBDA_FUNCTION_NAME) {
traceResolvers(schema);
} AWS Segment Size LimitationAWS has a 64K upload limit when submitting segments to AWS see AWSXRay concepts segments. If you try and submit more than this limit you will see the following aws error message One approach to remove this error, is to reduce the size of the batch upload (eg.. setStreamingThreshold(0) which will send each subsegment on close). See SDK - nodejs - setStreamingThreshold. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论