This is a simple quick start on how to configure a Node.js lambda function API to use OpenTelemetry instrumentation with traces and Tracetest for enhancing your E2E and integration tests with trace-based testing. The infrastructure will use Jaeger as the trace data store and Terraform to provision the required AWS infrastructure (Fargate/Lambda).
- Install the tracetest CLI
- Run
terraform init
,terraform apply
and accept the changes - From the terraform outputs, grab the
tracetes_url
and runtracetest configure --server-url <tracetest_url>
on a terminal to configure the CLI to send all commands to that address - From the terraform outputs, grab the
api_endpoint
and update the<your_api_endpoint>
section fromtest/test.yaml
- Test if it works by running:
tracetest run test -f tests/test.yaml
. This would execute a test against the Node.js API Gateway endpoint that will send spans to Jaeger to be fetched from the Tracetest server.
Feel free to check out the docs, and join our Slack Community for more info!