apollographql/apollo-server#5923
- Clone or download repo locally
- Run
npm i
both in root directory and incdk/
I have a local express server that runs the handler by simulating an API Gateway request and context. You'll see that OpenTelemetry works in the local environment as you should see logs printing to the console.
- Run
npm run build
from the root path - Run
npm run start
- Visit Apollo Studio sandbox and give
http://localhost:3000
as the endpoint
When the Lambda is deployed, nothing is pushed to CloudWatch logs from OpenTelemetry (the default behavior for console.log). Interestingly, I was originally testing this with Apollo Federation, and I found that the Gateway actually did show trace data in CloudWatch, but none of the Subgraph Lambdas did.
- Setup CDK with the AWS CDK docs
- Run the CDK bootstrap command to bootstrap your AWS account
- From the
cdk/
path, runcdk deploy
to deploy it. I have it set to deploy to us-west-2, but you can change this incdk/bin/cdk.ts
file.