https://github.com/lightstep/opentelemetry-lambda-extension
OpenTelemetry AWS Lambda Extension
https://github.com/lightstep/opentelemetry-lambda-extension
Last synced: 5 months ago
JSON representation
OpenTelemetry AWS Lambda Extension
- Host: GitHub
- URL: https://github.com/lightstep/opentelemetry-lambda-extension
- Owner: lightstep
- License: apache-2.0
- Archived: true
- Created: 2020-11-14T00:27:17.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2020-12-07T22:56:05.000Z (over 5 years ago)
- Last Synced: 2024-06-20T09:42:16.070Z (almost 2 years ago)
- Language: Go
- Size: 136 KB
- Stars: 8
- Watchers: 57
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# OpenTelemetry AWS Lambda Extension
*NOTE: This repo has been moved to: https://github.com/open-telemetry/opentelemetry-lambda-extension*
*NOTE: This is an experimental AWS Lambda Extension for OpenTelemetry*
The OpenTelemetry Lambda Extension provides a mechanism to export telemetry aynchronously from AWS Lambdas. It does this by embedding an [OpenTelemetry Collector](https://github.com/open-telemetry/opentelemetry-collector) inside an [AWS Extension Layer](https://aws.amazon.com/blogs/compute/introducing-aws-lambda-extensions-in-preview/). This allows lambdas to use the OpenTelemetry Collector Exporter to send traces and metrics to any configured backend.
## Installing
To install the OpenTelemetry Lambda Extension to an existing Lambda function using the `aws` CLI:
```
aws lambda update-function-configuration --function-name Function --layers arn:aws:lambda::297975325230:layer:opentelemetry-lambda-extension:8
```
Alternatively, to configure the OpenTelemetry Lambda Extension via SAM, add the following configuration:
```yaml
Function:
Type: AWS::Serverless::Function
Properties:
Layers:
- arn:aws:lambda::297975325230:layer:opentelemetry-lambda-extension:8
...
Environment:
Variables:
OPENTELEMETRY_COLLECTOR_CONFIG_FILE: /var/task/collector.yaml
```
## Configuration
The OpenTelemetry Collector uses yaml for configuration. To configure the collector, add a `collector.yaml` to your function and specifiy its location via the `OPENTELEMETRY_COLLECTOR_CONFIG_FILE` environment file.
Here is a sample configuration file:
```yaml
receivers:
otlp:
protocols:
grpc:
http:
exporters:
otlp:
endpoint: destination:1234
headers: {"header1":"value1"}
processors:
batch:
service:
extensions:
pipelines:
traces:
receivers: [otlp]
processors: [batch]
exporters: [otlp]
```
Once the file has been deployed with a Lambda, configuring the `OPENTELEMETRY_COLLECTOR_CONFIG_FILE` will tell the OpenTelemetry extension where to find the collector configuration:
```
aws lambda update-function-configuration --function-name Function --environment Variables={OPENTELEMETRY_COLLECTOR_CONFIG_FILE=/var/task/collector.yaml}
```
You can configure environment variables via yaml as well:
```yaml
Function:
Type: AWS::Serverless::Function
Properties:
...
Environment:
Variables:
OPENTELEMETRY_COLLECTOR_CONFIG_FILE: /var/task/collector.yaml
```
------
*Made with*  *@ [Lightstep](http://lightstep.com/)*