Skip to content

docs(contrib/aws/datadog-lambda-go): add README with migration guidance#4378

Open
Dogbu-cyber wants to merge 8 commits intomainfrom
david.ogbureke/add-lambda-readme
Open

docs(contrib/aws/datadog-lambda-go): add README with migration guidance#4378
Dogbu-cyber wants to merge 8 commits intomainfrom
david.ogbureke/add-lambda-readme

Conversation

@Dogbu-cyber
Copy link

@Dogbu-cyber Dogbu-cyber commented Jan 26, 2026

…go): add README with migration guidance

What does this PR do?

This PR adds a README to the Go Lambda package in dd-trace-go and documents the
recommended use of Go tracer v2, including a link to the migration instructions
for upgrading from Go tracer v1 to v2.

Motivation

https://datadoghq.atlassian.net/browse/APMSVLS-315
Improve the migration experience for users moving from the deprecated
datadog-lambda-go repository by adding clear documentation and links to the
Go tracer v2 migration guide.

Reviewer's Checklist

  • Changed code has unit tests for its functionality at or near 100% coverage.
  • System-Tests covering this feature have been added and enabled with the va.b.c-dev version tag.
  • There is a benchmark for any new code, or changes to existing code.
  • If this interacts with the agent in a new way, a system test has been added.
  • New code is free of linting errors. You can check this by running ./scripts/lint.sh locally.
  • Add an appropriate team label so this PR gets put in the right place for the release notes.
  • Non-trivial go.mod changes, e.g. adding new modules, are reviewed by @DataDog/dd-trace-go-guild.

Unsure? Have a question? Request a review!

@github-actions github-actions bot added the apm:ecosystem contrib/* related feature requests or bugs label Jan 26, 2026
@codecov
Copy link

codecov bot commented Jan 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 55.23%. Comparing base (4183b8a) to head (9dc3f5e).

Additional details and impacted files

see 366 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pr-commenter
Copy link

pr-commenter bot commented Jan 26, 2026

Benchmarks

Benchmark execution time: 2026-02-03 22:06:44

Comparing candidate commit 9dc3f5e in PR branch david.ogbureke/add-lambda-readme with baseline commit 4183b8a in branch main.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 156 metrics, 8 unstable metrics.

Copy link
Contributor

@joeyzhao2018 joeyzhao2018 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Dogbu-cyber Dogbu-cyber marked this pull request as ready for review January 26, 2026 15:53
@Dogbu-cyber Dogbu-cyber requested a review from a team as a code owner January 26, 2026 15:53
Although Go tracer v1 remains available, Datadog recommends using v2, which is the
primary supported version. See the
[migration instructions](https://docs.datadoghq.com/tracing/trace_collection/custom_instrumentation/go/migration/#migration-instructions)
for guidance on upgrading from v1 to v2.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This only includes migrating the tracer. It does not include migrating any datadog-lambda-go code.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Dogbu-cyber can we change this paragraph to
Although Go tracer v1 remains available, Datadog recommends using v2, which is the
primary supported version.
If you are upgrading a Go AWS Lambda function that previously used the legacy
datadog-lambda-go repository, simply replace go get github.com/DataDog/datadog-lambda-go to go get github.com/DataDog/dd-trace-go/contrib/aws/datadog-lambda-go/v2 for installation and also replace any import references from github.com/DataDog/datadog-lambda-go to github.com/DataDog/dd-trace-go/contrib/aws/datadog-lambda-go/v2.
Please follow the installation instructions for more details.
For general migration from dd-trace-go v1 to v2, follow this migration instructions

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joeyzhao2018 I've made this change now.

@Dogbu-cyber Dogbu-cyber force-pushed the david.ogbureke/add-lambda-readme branch 2 times, most recently from 3834015 to d36a736 Compare January 26, 2026 21:49
@datadog-datadog-prod-us1
Copy link

datadog-datadog-prod-us1 bot commented Jan 26, 2026

✅ Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 9dc3f5e | Docs | Datadog PR Page | Was this helpful? Give us feedback!

```go
go get github.com/DataDog/dd-trace-go/contrib/aws/datadog-lambda-go/v2
```
for installation and also replace any import references from github.com/DataDog/datadog-lambda-go to github.com/DataDog/dd-trace-go/contrib/aws/datadog-lambda-go/v2.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we give these as code samples as well? Hold their hand through it.

go get github.com/DataDog/datadog-lambda-go
```
with
```go
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
```go
```bash

```
for installation and also replace any import references from github.com/DataDog/datadog-lambda-go to github.com/DataDog/dd-trace-go/contrib/aws/datadog-lambda-go/v2.

Follow the [installation instructions](https://docs.datadoghq.com/serverless/aws_lambda/instrumentation/go/?tab=datadogui) for more details.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is another step that they must take, then we should make this a numbered list.

@Dogbu-cyber Dogbu-cyber requested a review from a team as a code owner January 29, 2026 12:46
@Dogbu-cyber Dogbu-cyber force-pushed the david.ogbureke/add-lambda-readme branch from d1eac5d to af43cea Compare January 29, 2026 12:47

### Step 3: Update Handler Code (API remains the same)

The API is compatible, so your handler code remains largely unchanged. Here's the actual integration test code from both repositories showing the migration:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section is really confusing. Are there any differences between the two examples that I as a user need to be aware of? Instead, I'm left manually comparing each line by line. If there's nothing more to add, then we should delete this section.


### Additional Resources

- [General dd-trace-go v1 to v2 Migration Guide](https://docs.datadoghq.com/tracing/trace_collection/custom_instrumentation/go/migration/)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might be better to replace Step 3 above. Tell people at that step to go through this migration guide.

@purple4reina
Copy link
Contributor

Can we update the PR title? There's an edit button in the upper right of the page. Should just be something like docs(contrib/aws/datadog-lambda-go): add README with migration guidance

@Dogbu-cyber Dogbu-cyber changed the title docs(contrib/aws/datadog-lambda-go): docs(contrib/aws/datadog-lambda-… docs(contrib/aws/datadog-lambda-go): add README with migration guidance Feb 2, 2026
import (
ddlambda "github.com/DataDog/dd-trace-go/contrib/aws/datadog-lambda-go/v2"
"github.com/DataDog/dd-trace-go/v2/ddtrace/tracer"
httptrace "github.com/DataDog/dd-trace-go/contrib/net/http/v2"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest removing these last two import lines from the example. This step we just want people to change the imports of their datadog-lambda-go code.

)
```

The API is compatible between v1 and v2, so your handler code remains unchanged. For details on other changes in dd-trace-go v2, see the [general dd-trace-go v1 to v2 migration guide](https://docs.datadoghq.com/tracing/trace_collection/custom_instrumentation/go/migration/).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest turning this into its own step. You'll then list this as an optional step to update your tracer from v1 to v2.

)
```

The API is compatible between v1 and v2, so your handler code remains unchanged. For details on other changes in dd-trace-go v2, see the [general dd-trace-go v1 to v2 migration guide](https://docs.datadoghq.com/tracing/trace_collection/custom_instrumentation/go/migration/).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recommendation (not required): Instead of using headings for each step, use a markdown list. This way the numbering is managed for you.

Before

### Step 1: Do a thing

something

### Step 2: Do another thing

something

### Step 3: Do this last thing

something

After

1. **Do a thing.** Something
1. **Do another thing.** Something
1. **Do this last thing.** Something

@Dogbu-cyber Dogbu-cyber force-pushed the david.ogbureke/add-lambda-readme branch from 45df222 to 03ea6d2 Compare February 3, 2026 20:58
Dogbu-cyber and others added 8 commits February 3, 2026 16:43
…go): replaced migration instructions with joey's suggestion
…plete code examples

- Add step-by-step migration instructions (Steps 1-4)
- Include complete before/after migration code from real integration tests
Co-authored-by: Rey Abolofia <rey.abolofia@datadoghq.com>
…ving redundant code examples

   Remove confusing code comparison in state 3. Moved general migration guide link earlier in the document to where it's more useful.
@Dogbu-cyber Dogbu-cyber force-pushed the david.ogbureke/add-lambda-readme branch from 03ea6d2 to 9dc3f5e Compare February 3, 2026 21:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

apm:ecosystem contrib/* related feature requests or bugs mergequeue-status: removed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants