docs(contrib/aws/datadog-lambda-go): add README with migration guidance#4378
docs(contrib/aws/datadog-lambda-go): add README with migration guidance#4378Dogbu-cyber wants to merge 8 commits intomainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files🚀 New features to boost your workflow:
|
BenchmarksBenchmark execution time: 2026-02-03 22:06:44 Comparing candidate commit 9dc3f5e in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 156 metrics, 8 unstable metrics. |
| 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. |
There was a problem hiding this comment.
This only includes migrating the tracer. It does not include migrating any datadog-lambda-go code.
There was a problem hiding this comment.
@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
3834015 to
d36a736
Compare
|
✅ Tests 🎉 All green!❄️ No new flaky tests detected 🔗 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. |
There was a problem hiding this comment.
Can we give these as code samples as well? Hold their hand through it.
| go get github.com/DataDog/datadog-lambda-go | ||
| ``` | ||
| with | ||
| ```go |
There was a problem hiding this comment.
| ```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. |
There was a problem hiding this comment.
If this is another step that they must take, then we should make this a numbered list.
d1eac5d to
af43cea
Compare
|
|
||
| ### 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: |
There was a problem hiding this comment.
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/) |
There was a problem hiding this comment.
This might be better to replace Step 3 above. Tell people at that step to go through this migration guide.
|
Can we update the PR title? There's an edit button in the upper right of the page. Should just be something like |
| 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" |
There was a problem hiding this comment.
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/). |
There was a problem hiding this comment.
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/). |
There was a problem hiding this comment.
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
somethingAfter
1. **Do a thing.** Something
1. **Do another thing.** Something
1. **Do this last thing.** Something45df222 to
03ea6d2
Compare
…go): add README with migration guidance
…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>
This reverts commit 07d7503.
…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.
…optional tracer upgrade
03ea6d2 to
9dc3f5e
Compare
…go): add README with migration guidance
What does this PR do?
This PR adds a README to the Go Lambda package in
dd-trace-goand documents therecommended 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-gorepository by adding clear documentation and links to theGo tracer v2 migration guide.
Reviewer's Checklist
./scripts/lint.shlocally.Unsure? Have a question? Request a review!