Skip to content

Latest commit

 

History

History
78 lines (52 loc) · 1.6 KB

README.md

File metadata and controls

78 lines (52 loc) · 1.6 KB

aws-lambda-go-otel-poc

Proof of concept using aws-lambda-go and OpenTelemetry.

This may interest you if you use AWS, Lambdas, Golang, and OpenTelemetry … or if you're looking to emulate AppSync Serverless GraphQL locally and do not wish to pay for a LocalStack license.

Getting started

Step 0: Prerequisites

All you need is Docker and pkgx.

Step 1: Run everything

pkgx task@latest run

Step 2: Invoking the Lambda

(With the CLI)

pkgx awslocal@latest \
  lambda invoke \
    --function-name my-lambda \
    --cli-binary-format raw-in-base64-out \
    --payload '{"body": "{\"id\": \"10\"}" }' \
    output.txt

(With HTTP)

pkgx http \
  http://localhost:4566/2015-03-31/functions/my-lambda/invocations \
  id="4"

(With GraphQL)

mutation {
  invokeLambda(input: {id: "1"}) {
    id
  }
}

Step 3: Viewing the trace

Open the Jaeger UI.

Miscellaneous

Remaining Questions

  • ADOT: Do we need to use the AWS Distro of OTel Collector?

Environment Variables

The default OTel env vars should be fine.

See their “OTLP Exporter Configuration” guide.