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

[Instrumentation.Owin] Add IConfiguration support #1973

Merged
merged 4 commits into from
Jul 25, 2024

Conversation

CodeBlanch
Copy link
Member

@CodeBlanch CodeBlanch commented Jul 24, 2024

Relates to #1960

Changes

  • Updates Owin to retrieve OTEL_DOTNET_EXPERIMENTAL_OWIN_DISABLE_URL_QUERY_REDACTION using IConfiguration

Merge requirement checklist

  • CONTRIBUTING guidelines followed (license requirements, nullable enabled, static analysis, etc.)
  • Unit tests added/updated
  • Appropriate CHANGELOG.md files updated for non-trivial changes
  • Changes in public API reviewed (if applicable)

@CodeBlanch CodeBlanch requested a review from a team July 24, 2024 20:04
@github-actions github-actions bot added the comp:instrumentation.owin Things related to OpenTelemetry.Instrumentation.Owin label Jul 24, 2024
Copy link

codecov bot commented Jul 25, 2024

Codecov Report

Attention: Patch coverage is 80.76923% with 5 lines in your changes missing coverage. Please review.

Project coverage is 85.79%. Comparing base (71655ce) to head (8e384fe).
Report is 368 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##             main    #1973       +/-   ##
===========================================
+ Coverage   73.91%   85.79%   +11.88%     
===========================================
  Files         267        8      -259     
  Lines        9615      169     -9446     
===========================================
- Hits         7107      145     -6962     
+ Misses       2508       24     -2484     
Flag Coverage Δ
unittests-Instrumentation.Owin 85.79% <80.76%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...umentation.Owin/TracerProviderBuilderExtensions.cs 100.00% <100.00%> (+16.66%) ⬆️
...Instrumentation.Owin/OwinInstrumentationOptions.cs 84.61% <75.00%> (-15.39%) ⬇️
...n/Implementation/OwinInstrumentationEventSource.cs 29.41% <0.00%> (-9.05%) ⬇️

... and 266 files with indirect coverage changes

@@ -17,18 +18,20 @@ public class OwinInstrumentationOptions
/// Initializes a new instance of the <see cref="OwinInstrumentationOptions"/> class.
/// </summary>
public OwinInstrumentationOptions()
: this(new ConfigurationBuilder().AddEnvironmentVariables().Build())
Copy link
Contributor

@rajkumar-rangaraj rajkumar-rangaraj Jul 25, 2024

Choose a reason for hiding this comment

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

Wouldn't it be the best option to take IConfiguration from the user instead of building it with environment variables ourselves? Is the intention here to avoid a public API change?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ya this is just about backwards compatibility and not breaking the public API. Nothing should be using this ctor but there is a chance some user is calling it. Perhaps in a test. But this is a prerelease package so we could break it and remove this ctor leaving just have the internal one. LMK what you think.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm fine with this approach.

@Kielek Kielek changed the title [owin] Add iconfiguration support [owin] Add IConfiguration support Jul 25, 2024
@Kielek Kielek changed the title [owin] Add IConfiguration support [Instrumentation.Owin] Add IConfiguration support Jul 25, 2024
@Kielek Kielek merged commit 73328b1 into open-telemetry:main Jul 25, 2024
54 checks passed
@CodeBlanch CodeBlanch deleted the owin-iconfiguration-support branch July 25, 2024 17:27
ezhang6811 pushed a commit to ezhang6811/opentelemetry-dotnet-contrib that referenced this pull request Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:instrumentation.owin Things related to OpenTelemetry.Instrumentation.Owin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants