opentelemetry-lambda-extension

command module
v0.0.0-...-18b0a71 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 7, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

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 inside an AWS Extension Layer. 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:<AWS REGION>:297975325230:layer:opentelemetry-lambda-extension:8

Alternatively, to configure the OpenTelemetry Lambda Extension via SAM, add the following configuration:

  Function:
    Type: AWS::Serverless::Function
    Properties:
      Layers:
        - arn:aws:lambda:<AWS REGION>: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:

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:

  Function:
    Type: AWS::Serverless::Function
    Properties:
      ...
      Environment:
        Variables:
          OPENTELEMETRY_COLLECTOR_CONFIG_FILE: /var/task/collector.yaml

Made with @ Lightstep

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL