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

Auto instrumentation parameters #3864

Merged
merged 19 commits into from
May 30, 2024
Merged

Conversation

jeremydvoss
Copy link
Contributor

@jeremydvoss jeremydvoss commented Apr 18, 2024

Description

Currently, the only way for custom Configurators to configure is through setting or defaulting environment variables. While it makes sense for customers to configure autoinstrumentation with env vars, there is no reason Configurators should not be able to directly configure start up (exporters, samplers...etc). Exposing autoinstrumentation configuration of otel via env var defaults is invasive, confusing, and easy for users to mess up. For instance, even a blank env var or a left-over setting from previous run could interfere with a distro starting up.

In this approach, configurators can pass kwargs to _initialize_components to easily configure autoinstrumentation which currently only considers env vars.

Precedence of params over env vars

Params would be preferred over (or merged with) env vars. This follows the approach towards env vars elsewhere in OTel Python. And doing so would be necessary for custom distros to guarantee certain behavior.

In this approach, exporters given by params would be ADDED to those from env vars. Resource attributes would be merged with those from env vars and resource detectors. Since there's only 1 sampler, param would take precedence. Same for logging_enabled.

@jeremydvoss jeremydvoss requested a review from a team as a code owner April 18, 2024 23:17
@jeremydvoss jeremydvoss changed the title Auto instrumentation parameter proposal DO NOT MERGE: Auto instrumentation parameter proposal Apr 18, 2024
@jeremydvoss jeremydvoss changed the title DO NOT MERGE: Auto instrumentation parameter proposal Auto instrumentation parameter proposal May 23, 2024
@jeremydvoss jeremydvoss changed the title Auto instrumentation parameter proposal Auto instrumentation parameters May 23, 2024
CHANGELOG.md Outdated Show resolved Hide resolved
Copy link
Contributor

@tammy-baylis-swi tammy-baylis-swi left a comment

Choose a reason for hiding this comment

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

Lgtm, posted one idea. Thanks for presenting this at multiple sig meetings.

.codespellrc Outdated Show resolved Hide resolved
@jeremydvoss jeremydvoss force-pushed the auto-params branch 2 times, most recently from 36fab8c to c6980b5 Compare May 28, 2024 20:42
Copy link
Contributor

@lzchen lzchen left a comment

Choose a reason for hiding this comment

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

Approved pending name changes.

@lzchen lzchen merged commit c6edd0f into open-telemetry:main May 30, 2024
233 checks passed
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.

None yet

4 participants