Skip to content

feat(dsm): context support for sqs -> lambda #13526

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
May 29, 2025

Conversation

michael-zhao459
Copy link
Contributor

@michael-zhao459 michael-zhao459 commented May 28, 2025

Added the proper support based on AWS message event format for sqs -> lambda.
This allows dsm to properly extract the neccessary context for lambda support
https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html

Checklist

  • PR author has checked that all the criteria below are met
  • The PR description includes an overview of the change
  • The PR description articulates the motivation for the change
  • The change includes tests OR the PR description describes a testing strategy
  • The PR description notes risks associated with the change, if any
  • Newly-added code is easy to change
  • The change follows the library release note guidelines
  • The change includes or references documentation updates if necessary
  • Backport labels are set (if applicable)

Reviewer Checklist

  • Reviewer has checked that all the criteria below are met
  • Title is accurate
  • All changes are related to the pull request's stated goal
  • Avoids breaking API changes
  • Testing strategy adequately addresses listed risks
  • Newly-added code is easy to change
  • Release note makes sense to a user of the library
  • If necessary, author has acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment
  • Backport labels are set in a manner that is consistent with the release branch maintenance policy

@michael-zhao459 michael-zhao459 requested a review from a team May 28, 2025 17:54
@michael-zhao459 michael-zhao459 requested a review from a team as a code owner May 28, 2025 17:54
Copy link
Contributor

github-actions bot commented May 28, 2025

CODEOWNERS have been resolved as:

releasenotes/notes/add-sqs-lambda-context-support-5062a60d81055ed7.yaml  @DataDog/apm-python
tests/datastreams/test_botocore.py                                      @DataDog/apm-core-python
ddtrace/internal/datastreams/botocore.py                                @DataDog/apm-core-python

Copy link
Contributor

github-actions bot commented May 28, 2025

Bootstrap import analysis

Comparison of import times between this PR and base.

Summary

The average import time from this PR is: 235 ± 3 ms.

The average import time from base is: 234 ± 3 ms.

The import time difference between this PR and base is: 0.3 ± 0.1 ms.

The difference is not statistically significant (z = 1.89).

Import time breakdown

The following import paths have shrunk:

ddtrace.auto 1.714 ms (0.73%)
ddtrace.bootstrap.sitecustomize 1.046 ms (0.45%)
ddtrace.bootstrap.preload 1.046 ms (0.45%)
ddtrace.internal.remoteconfig.client 0.530 ms (0.23%)
ddtrace 0.669 ms (0.29%)
ddtrace.internal._unpatched 0.023 ms (0.01%)

@pr-commenter
Copy link

pr-commenter bot commented May 28, 2025

Benchmarks

Benchmark execution time: 2025-05-29 18:02:01

Comparing candidate commit 8869b97 in PR branch michael.zhao/dsm-context with baseline commit ea609fd in branch main.

Found 0 performance improvements and 2 performance regressions! Performance is the same for 485 metrics, 5 unstable metrics.

scenario:iastaspects-swapcase_aspect

  • 🟥 execution_time [+209.376ns; +262.892ns] or [+8.413%; +10.563%]

scenario:iastaspectssplit-rsplit_aspect

  • 🟥 execution_time [+166.660ns; +202.901ns] or [+11.118%; +13.536%]

Copy link
Member

@brettlangdon brettlangdon left a comment

Choose a reason for hiding this comment

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

should we add a changelog entry for this?

we probably also want to change this to a feat(dsm): instead of a chore(dsm):

reno new

slug-name can be something like, "add-sqs-lambda-context-support" (just an example, go with what your heart desires, the name isn't that important)

Copy link
Member

@brettlangdon brettlangdon left a comment

Choose a reason for hiding this comment

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

very minor thought, and the suggestion for a changelog entry, otherwise lgtm

@michael-zhao459 michael-zhao459 changed the title chore(dsm): context support for sqs -> lambda feat(dsm): context support for sqs -> lambda May 29, 2025
@michael-zhao459 michael-zhao459 requested a review from a team as a code owner May 29, 2025 13:36
@michael-zhao459 michael-zhao459 enabled auto-merge (squash) May 29, 2025 14:04
@michael-zhao459
Copy link
Contributor Author

/merge

@dd-devflow
Copy link

dd-devflow bot commented May 29, 2025

View all feedbacks in Devflow UI.

2025-05-29 15:13:40 UTC ℹ️ Start processing command /merge


2025-05-29 15:13:57 UTC ℹ️ MergeQueue: waiting for PR to be ready

This merge request is not mergeable yet, because of pending checks/missing approvals. It will be added to the queue as soon as checks pass and/or get approvals.
Note: if you pushed new commits since the last approval, you may need additional approval.
You can remove it from the waiting list with /remove command.


2025-05-29 16:59:54 UTC ⚠️ MergeQueue: This merge request was unqueued

[email protected] unqueued this merge request

@michael-zhao459
Copy link
Contributor Author

/remove

@dd-devflow
Copy link

dd-devflow bot commented May 29, 2025

View all feedbacks in Devflow UI.

2025-05-29 16:59:47 UTC ℹ️ Start processing command /remove


2025-05-29 16:59:51 UTC ℹ️ Devflow: /remove

@michael-zhao459 michael-zhao459 merged commit 520cbf5 into main May 29, 2025
740 of 741 checks passed
@michael-zhao459 michael-zhao459 deleted the michael.zhao/dsm-context branch May 29, 2025 18:05
Copy link
Contributor

@piochelepiotr piochelepiotr left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants