Switch to Python Profiling v2 from v1 by rithikanarayan · Pull Request #674 · DataDog/datadog-lambda-python

What does this PR do?

Includes ./python/lib/$runtime/site-packages/ddtrace/internal/datadog/profiling/stack_v2/_stack_v2.*.so in Python Lambda layer to enable python profiling v2.

Motivation

The profiling team is planning on deprecating profiling v1 in the dd-trace-py 4.x release. We want to move lambdas to v2 before this happens.

Testing Guidelines

Tested profiling on a API Gateway -> Lambda -> SQS -> Lambda setup using custom lambda layer arn:aws:lambda:us-west-2:425362996713:layer:Python313-profilingv2-rithika:1. Invoked producer lambda repeatedly in a short timespan to generate profiles. Inspected profiles in the Datadog UI and checked logs to ensure that "failing back to v1 stack sampler" warning log no longer appears. Profiles for producer lambda

Additional Notes

Types of Changes

  • Bug fix
  • New feature
  • Breaking change
  • Misc (docs, refactoring, dependency upgrade, etc.)

Check all that apply

  • This PR's description is comprehensive
  • This PR contains breaking changes that are documented in the description
  • This PR introduces new APIs or parameters that are documented and unlikely to change in the foreseeable future
  • This PR impacts documentation, and it has been updated (or a ticket has been logged)
  • This PR's changes are covered by the automated tests
  • This PR collects user input/sensitive content into Datadog
  • This PR passes the integration tests (ask a Datadog member to run the tests)