dd-trace-py icon indicating copy to clipboard operation
dd-trace-py copied to clipboard

Configuration improvements

Open Kyle-Verhoog opened this issue 3 years ago • 0 comments

Existing configuration issues

  1. Well defined initialization point. A lot (almost all) existing configuration is done implicitly at import as modules are loaded. This makes it hard to know when configuration is established or if it can still be modified or will be overwritten.
  2. Knowledge of whether a value is user-defined.
  3. Typing. Currently the configuration is not typed or guarded. (eg. ddtrace.config.servce = "my-svc" does not raise an error and will silently fail).
  4. Inconsistent parity of programmatic and environment variable configuration. There are many options available in the library that can only be configured via environment variable xor programmatic.
  5. Documentation. Configuration options are not standardized and so there is no established process to document them. In particular, programmatic configurations are not documented well or consistently.

Requirements

  1. Support each feature provided by the library. The configuration has to be decoupled from each feature in the event that a feature has to be disabled or is not available.
  2. Support for run-time changes (RCM)

TODO

Proposed API

Challenges

  • Have to be backwards compatible with the current configuration system. Probably means that the old configuration has to live on and we have to support the old and new systems until 2.0.

Links

  • Previous proposal for improvements to IntegrationConfig: https://github.com/DataDog/dd-trace-py/pull/1309
  • An example of a declarative configuration API: https://github.com/Kyle-Verhoog/datadog-python#proposed-api

Kyle-Verhoog avatar May 10 '22 18:05 Kyle-Verhoog