IMPORTANT NOTICE: This package replaces the deprecated https://github.com/DataDog/datadog-lambda-go repository.
Datadog Lambda Library for Go enables enhanced Lambda metrics, distributed tracing, and custom metric submission from AWS Lambda functions.
If you are upgrading from the legacy github.com/DataDog/datadog-lambda-go repository, this guide will walk you through the migration process with code examples.
-
Update Dependencies. Update your
go.modfile by replacing the old package with the new one:# Remove the old package go get github.com/DataDog/datadog-lambda-go@none # Install the new v2 package go get github.com/DataDog/dd-trace-go/contrib/aws/datadog-lambda-go/v2
-
Update Import Statements. Update your
datadog-lambda-goimport path:Before (v1):
import ( ddlambda "github.com/DataDog/datadog-lambda-go" )
After (v2):
import ( ddlambda "github.com/DataDog/dd-trace-go/contrib/aws/datadog-lambda-go/v2" )
The API is compatible between v1 and v2, so your handler code remains unchanged.
-
(Optional) Update dd-trace-go from v1 to v2. If you're also using
dd-trace-gofor tracing, you can optionally upgrade from v1 to v2. For details on tracer changes, see the general dd-trace-go v1 to v2 migration guide. -
Deploy and Configure. After updating your code, follow the Datadog AWS Lambda Instrumentation for Go guide to configure the Datadog Lambda Extension and environment variables for your Lambda function.
Follow the installation instructions, and view your function's enhanced metrics, traces and logs in Datadog.
See the advanced configuration options to tag your telemetry, capture request/response payloads, filter or scrub sensitive information from logs or traces, and more.
Note: The Datadog Extension handles trace stats server-side. Therefore this Lambda wrapper always disables client-side trace stats computation when initializing the tracer, regardless of DD_TRACE_STATS_COMPUTATION_ENABLED.
If you encounter a bug with this package, we want to hear about it. Before opening a new issue, search the existing issues to avoid duplicates.
When opening an issue, include the datadog-lambda-go version, go version, and stack trace if available. In addition, include the steps to reproduce when appropriate.
You can also open an issue for a feature request.
If you find an issue with this package and have a fix, please feel free to open a pull request following the procedures.
For product feedback and questions, join the #serverless channel in the Datadog community on Slack.
Unless explicitly stated otherwise all files in this package are licensed under the Apache License Version 2.0.
This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2021 Datadog, Inc.