Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kevinmichaelchen/aws-lambda-go-otel-poc
Proof of Concept using AWS Lambda, Go, OpenTelemetry (OTel), as well as Tailcall as an alternative to AppSync Serverless GraphQL
https://github.com/kevinmichaelchen/aws-lambda-go-otel-poc
aws aws-lambda-go go graphql lambda opentelemetry otel tailcall
Last synced: 4 days ago
JSON representation
Proof of Concept using AWS Lambda, Go, OpenTelemetry (OTel), as well as Tailcall as an alternative to AppSync Serverless GraphQL
- Host: GitHub
- URL: https://github.com/kevinmichaelchen/aws-lambda-go-otel-poc
- Owner: kevinmichaelchen
- Created: 2024-06-09T16:28:19.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-06-10T02:19:15.000Z (7 months ago)
- Last Synced: 2024-12-16T07:31:57.865Z (7 days ago)
- Topics: aws, aws-lambda-go, go, graphql, lambda, opentelemetry, otel, tailcall
- Language: Go
- Homepage:
- Size: 19.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# aws-lambda-go-otel-poc
Proof of concept using [aws-lambda-go][aws-lambda-go] and [OpenTelemetry][otel].
This may interest you if you use AWS, Lambdas, Golang, and OpenTelemetry … or
if you're looking to emulate [AppSync Serverless GraphQL][appsync] locally and
do not wish to pay for a [LocalStack][localstack] license.[appsync]: https://aws.amazon.com/appsync/
[aws-lambda-go]: https://github.com/aws/aws-lambda-go
[localstack]: https://docs.localstack.cloud/user-guide/aws/appsync/
[otel]: https://opentelemetry.io/## Getting started
### Step 0: Prerequisites
All you need is [Docker][docker] and [pkgx][pkgx].
[docker]: https://www.docker.com/
[pkgx]: https://pkgx.sh/### Step 1: Run everything
```shell
pkgx task@latest run
```### Step 2: Invoking the Lambda
#### (With the CLI)
```shell
pkgx awslocal@latest \
lambda invoke \
--function-name my-lambda \
--cli-binary-format raw-in-base64-out \
--payload '{"body": "{\"id\": \"10\"}" }' \
output.txt
```#### (With HTTP)
```shell
pkgx http \
http://localhost:4566/2015-03-31/functions/my-lambda/invocations \
id="4"
```#### (With GraphQL)
```graphql
mutation {
invokeLambda(input: {id: "1"}) {
id
}
}
```### Step 3: Viewing the trace
Open the [Jaeger UI][jaeger-ui].
[jaeger-ui]: http://localhost:16686
## 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][guide].
[guide]: https://opentelemetry.io/docs/languages/sdk-configuration/otlp-exporter/