Skip to content
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

feat(config): support libdatadog's library_config for config through file #12260

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

BaptisteFoy
Copy link
Contributor

@BaptisteFoy BaptisteFoy commented Feb 7, 2025

Description of changes

Most changes were taken from #11839

  • Bumps libdatadog to v16.0.2
  • Starts using the library_config component of libdatadog that allows reading configuration from a file with a higher precedence than environment variables

Supported config entries

As of libdatadog v16.0.2:

  • DD_APM_TRACING_ENABLED
  • DD_RUNTIME_METRICS_ENABLED
  • DD_LOGS_INJECTION
  • DD_PROFILING_ENABLED
  • DD_DATA_STREAMS_ENABLED
  • DD_APPSEC_ENABLED
  • DD_IAST_ENABLED
  • DD_DYNAMIC_INSTRUMENTATION_ENABLED
  • DD_DATA_JOBS_ENABLED
  • DD_APPSEC_SCA_ENABLED
  • DD_TRACE_DEBUG
  • DD_SERVICE
  • DD_ENV
  • DD_VERSION

Testing strategy

Added a unit test.

To test this PR, you can:

  1. Create a Linux VM
  2. Start this tracer version & ensure everything works well (non-regression)
  3. Create a file at the following path: /etc/datadog-agent/application_monitoring.yaml
  4. Write the following content in the file:
rules:
  - selectors:
      - origin: language
        matches:
          - python
        operator: equals
    configuration:
      DD_TRACE_DEBUG: true
  1. Start this tracer version
  2. Verify that debug logs are properly enabled

Additional concerns

Relevant system test: DataDog/system-tests#3982

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

Copy link
Contributor

github-actions bot commented Feb 7, 2025

CODEOWNERS have been resolved as:

src/native/library_config.rs                                            @DataDog/apm-core-python
tests/internal/test_native.py                                           @DataDog/apm-core-python
ddtrace/__init__.py                                                     @DataDog/apm-core-python
ddtrace/internal/native/__init__.py                                     @DataDog/apm-core-python
ddtrace/internal/native/_native.pyi                                     @DataDog/apm-core-python
src/native/Cargo.lock                                                   @DataDog/apm-core-python
src/native/Cargo.toml                                                   @DataDog/apm-core-python
src/native/lib.rs                                                       @DataDog/apm-core-python

@BaptisteFoy BaptisteFoy force-pushed the baptiste.foy/FA/library-config-libdatadog--2 branch from e4869ac to 56082d1 Compare February 7, 2025 16:19
@BaptisteFoy BaptisteFoy added the changelog/no-changelog A changelog entry is not required for this PR. label Feb 7, 2025
@datadog-dd-trace-py-rkomorn
Copy link

datadog-dd-trace-py-rkomorn bot commented Feb 7, 2025

Datadog Report

Branch report: baptiste.foy/FA/library-config-libdatadog--2
Commit report: 14950cf
Test service: dd-trace-py

✅ 0 Failed, 130 Passed, 1184 Skipped, 3m 25.74s Total duration (25m 43.72s time saved)

@BaptisteFoy BaptisteFoy force-pushed the baptiste.foy/FA/library-config-libdatadog--2 branch from 56082d1 to ca62de8 Compare February 7, 2025 16:48
Copy link

@paullegranddc paullegranddc left a comment

Choose a reason for hiding this comment

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

Ship it 🔥 🔥 🔥

tests/internal/test_native.py Show resolved Hide resolved
ddtrace/__init__.py Show resolved Hide resolved
@pr-commenter
Copy link

pr-commenter bot commented Feb 7, 2025

Benchmarks

Benchmark execution time: 2025-02-11 17:13:36

Comparing candidate commit 14950cf in PR branch baptiste.foy/FA/library-config-libdatadog--2 with baseline commit a604d93 in branch main.

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

scenario:iast_aspects-ospathbasename_aspect

  • 🟥 execution_time [+252.411ns; +299.090ns] or [+7.565%; +8.964%]

@BaptisteFoy BaptisteFoy force-pushed the baptiste.foy/FA/library-config-libdatadog--2 branch from 6f77853 to a40b960 Compare February 10, 2025 12:47
@BaptisteFoy BaptisteFoy marked this pull request as ready for review February 10, 2025 13:48
@BaptisteFoy BaptisteFoy requested a review from a team as a code owner February 10, 2025 13:48
@BaptisteFoy BaptisteFoy force-pushed the baptiste.foy/FA/library-config-libdatadog--2 branch 5 times, most recently from 471a266 to 1ebacb5 Compare February 11, 2025 15:20
@BaptisteFoy BaptisteFoy requested review from a team as code owners February 11, 2025 16:03
@BaptisteFoy BaptisteFoy force-pushed the baptiste.foy/FA/library-config-libdatadog--2 branch from 9fabaf0 to 1ebacb5 Compare February 11, 2025 16:04
@BaptisteFoy BaptisteFoy removed request for a team February 11, 2025 16:04
@BaptisteFoy BaptisteFoy force-pushed the baptiste.foy/FA/library-config-libdatadog--2 branch from 5b4cb54 to 1ebacb5 Compare February 11, 2025 16:06
@BaptisteFoy BaptisteFoy force-pushed the baptiste.foy/FA/library-config-libdatadog--2 branch from 1ebacb5 to 14950cf Compare February 11, 2025 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog/no-changelog A changelog entry is not required for this PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants