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

fix(envier): support multiple sources #12535

Draft
wants to merge 2 commits into
base: munir/bump-lib-datadog
Choose a base branch
from

Conversation

mabdinur
Copy link
Contributor

Currently envier.Env supports reading environment variables from one source (usually os.enviorn). This PR introduces EnvDD which will add support for loading environment variables from multiple sources.

This will be used to load configurations from files and through the DatadogUI.

Note - This PR attempts to support multiple configuration sources without updating the envier library. This approach will be refactored when stable support configurations is GA 🤞.

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

CODEOWNERS have been resolved as:

ddtrace/internal/native/__init__.py                                     @DataDog/apm-core-python
ddtrace/internal/remoteconfig/client.py                                 @DataDog/remote-config @DataDog/apm-core-python
ddtrace/settings/_core.py                                               @DataDog/apm-core-python
ddtrace/settings/_database_monitoring.py                                @DataDog/apm-core-python
ddtrace/settings/_telemetry.py                                          @DataDog/apm-core-python
ddtrace/settings/asm.py                                                 @DataDog/asm-python
ddtrace/settings/code_origin.py                                         @DataDog/apm-core-python
ddtrace/settings/crashtracker.py                                        @DataDog/apm-core-python
ddtrace/settings/dynamic_instrumentation.py                             @DataDog/debugger-python
ddtrace/settings/exception_replay.py                                    @DataDog/apm-core-python
ddtrace/settings/live_debugging.py                                      @DataDog/apm-core-python
ddtrace/settings/symbol_db.py                                           @DataDog/apm-core-python
ddtrace/settings/third_party.py                                         @DataDog/apm-core-python

set,
"includes",
default=set(),
help_type="List",
help="List of modules/packages to include in the symbol uploads",
)
_includes_re = En.d(re.Pattern, lambda c: re.compile("(" + "|".join(f"^{p}$|^{p}[.]" for p in c.includes) + ")"))
_includes_re = EnvDD.d(re.Pattern, lambda c: re.compile("(" + "|".join(f"^{p}$|^{p}[.]" for p in c.includes) + ")"))
Copy link
Contributor

Choose a reason for hiding this comment

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

🟠 Code Quality Violation

use f-string or .format to format strings (...read more)

Concatenation of multiple strings is not efficient and make the code hard to read and understand.

Instead of concatenating multiple strings, use an f-string or a format string.

Learn More

View in Datadog  Leave us feedback  Documentation

@pr-commenter
Copy link

pr-commenter bot commented Feb 26, 2025

Benchmarks

Benchmark execution time: 2025-02-26 23:35:32

Comparing candidate commit 748ab59 in PR branch munir/support-stable-config-in-envier with baseline commit 44b3fcd in branch munir/bump-lib-datadog.

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

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

Successfully merging this pull request may close these issues.

1 participant