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

Document app.config limitation #2070

Merged
merged 4 commits into from
Jan 25, 2023
Merged

Conversation

pellared
Copy link
Member

@pellared pellared commented Jan 24, 2023

Why

Fixes #1429

After discussion with @andrewlock and @Kielek we decided that it is safer and probably good enough NOT to support all configuration via env vars. The main problem are the configuration read by the .NET Profiler which does not know anything about app.config. We could try "refreshing" the native configuration after the managed layer has loaded the app.config. However, that would probably require PInvoke and additional synchronization. Still this might result in race conditions.

Moreover, that env vars are per-process, but web.config can be per-appdomain; e.g.

  • App1 and App2 are web apps running in IIS
  • App1 sets OTEL_SOME_SETTING=1 in web.config
  • App2 sets OTEL_SOME_SETTING=0 in web.config
  • App1 sets the env var OTEL_SOME_SETTING=1 and Pinvokes to notify the profiler
  • App2 sets the env var OTEL_SOME_SETTING=0 and Pinvokes to notify the profiler
    Profiler doesn't know what to think
    Essentially you'd have to check the appdomain for each callback, and some parts of the profiler are agnostic to that
    So things will get complicated quickly.

At last this functionality would hopefully be not needed for the "happy path". The usual scenario would be use the app config to set the service name and other resource attributes, configure the exporter(s).

What

Document app.config and web.config limitation.

Tests

Manually by modyfing integration tests and test applications

Checklist

  • CHANGELOG.md is updated.
  • Documentation is updated.
  • New features are covered by tests.

@github-actions github-actions bot requested a review from theletterf January 24, 2023 11:24
Comment on lines +21 to +26
- `OTEL_DOTNET_AUTO_HOME`
- `OTEL_DOTNET_AUTO_EXCLUDE_PROCESSES`
- `OTEL_DOTNET_AUTO_INTEGRATIONS_FILE`
- `OTEL_DOTNET_AUTO_[TRACES|METRICS|LOGS]_[ENABLED|DISABLED]_INSTRUMENTATIONS`
- `OTEL_DOTNET_AUTO_LOG_DIRECTORY`
- `OTEL_DOTNET_AUTO_DEBUG`
Copy link
Member

Choose a reason for hiding this comment

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

Might require some extra work, but I'm thinking now of re-doing the settings tables so that they have the following columns:

  • Setting (env var)
  • App.config / Web.config supported
  • Description
  • Default

Copy link
Member Author

Choose a reason for hiding this comment

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

Can we keep as it is for this PR (it makes also reviewing easier)? We can change the formatting/structure it in a separate PR.

@theletterf
Copy link
Member

@pellared Perhaps we can be more prescriptive as to when a method should be used instead of another? If there's choice, that is. Of course one can use env vars for everything, but when should they use app.config instead?

@pellared
Copy link
Member Author

@pellared Perhaps we can be more prescriptive as to when a method should be used instead of another? If there's choice, that is. Of course one can use env vars for everything, but when should they use app.config instead?

#2071

Co-authored-by: Fabrizio Ferri-Benedetti <fferribenedetti@splunk.com>
@pellared pellared marked this pull request as ready for review January 24, 2023 12:04
@pellared pellared requested a review from a team January 24, 2023 12:04
Copy link
Contributor

@zacharycmontoya zacharycmontoya left a comment

Choose a reason for hiding this comment

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

LGTM with very small comments

Kielek and others added 2 commits January 25, 2023 07:57
Co-authored-by: Zach Montoya <zach.montoya@datadoghq.com>
@pellared pellared requested a review from RassK January 25, 2023 08:14
@Kielek Kielek enabled auto-merge (squash) January 25, 2023 08:22
@Kielek Kielek merged commit 4f61a89 into open-telemetry:main Jan 25, 2023
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.

Improve configuration via app/web.config
5 participants