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

[logging] UseOpenTelemetry extension & WithLogging default behavior #5072

Merged

Conversation

CodeBlanch
Copy link
Member

@CodeBlanch CodeBlanch commented Nov 22, 2023

Follow-up to #4958
Fixes #4985
Relates to #4433

Changes

  • Adds ILoggingBuilder.UseOpenTelemetry experimental APIs. This brings full parity w.r.t. IServiceCollection / IServiceProvider that we have with metrics & tracing to logging.
  • Updates OpenTelemetryBuilder.WithLogging experimental API to automatically register the ILoggerProvider integration. This mirrors what WithMetrics does (for IMetricsListener integration).

Merge requirement checklist

  • CONTRIBUTING guidelines followed (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 as a code owner November 22, 2023 01:37
@CodeBlanch CodeBlanch added pkg:OpenTelemetry Issues related to OpenTelemetry NuGet package pkg:OpenTelemetry.Extensions.Hosting Issues related to OpenTelemetry.Extensions.Hosting NuGet package labels Nov 22, 2023
Copy link

codecov bot commented Nov 22, 2023

Codecov Report

Merging #5072 (6051870) into main (4f73d2b) will increase coverage by 0.28%.
Report is 1 commits behind head on main.
The diff coverage is 100.00%.

❗ Current head 6051870 differs from pull request most recent head d8833d2. Consider uploading reports for the commit d8833d2 to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #5072      +/-   ##
==========================================
+ Coverage   83.02%   83.31%   +0.28%     
==========================================
  Files         296      296              
  Lines       12315    12320       +5     
==========================================
+ Hits        10225    10264      +39     
+ Misses       2090     2056      -34     
Flag Coverage Δ
unittests 83.31% <100.00%> (+0.28%) ⬆️

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

Files Coverage Δ
...lemetry.Extensions.Hosting/OpenTelemetryBuilder.cs 100.00% <100.00%> (ø)
...try/Logs/ILogger/OpenTelemetryLoggingExtensions.cs 95.23% <100.00%> (+0.50%) ⬆️

... and 5 files with indirect coverage changes

@utpilla utpilla merged commit a47b222 into open-telemetry:main Nov 29, 2023
77 of 78 checks passed
@CodeBlanch CodeBlanch deleted the hosting-withlogging-defaultbehavior branch November 29, 2023 23:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg:OpenTelemetry.Extensions.Hosting Issues related to OpenTelemetry.Extensions.Hosting NuGet package pkg:OpenTelemetry Issues related to OpenTelemetry NuGet package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Default host behavior for OpenTelemetryBuilder With* extensions
3 participants