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

[Logs] Support dependency injection in logging build-up #3504

Merged
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
8d9bb6c
Support dependency injection in logging. Add AddOpenTelemetryEventSou…
CodeBlanch Jul 29, 2022
a3616bb
Merge branch 'main' into loggerprovider-dependencyinjection
CodeBlanch Jul 29, 2022
0836b09
CHANGELOG update.
CodeBlanch Jul 29, 2022
013ab59
Bug fixes and a test.
CodeBlanch Jul 29, 2022
9ee35f2
More fixes and more tests.
CodeBlanch Jul 29, 2022
c0fe823
Tweak comments for clarity.
CodeBlanch Jul 29, 2022
5b4ffc1
Added OpenTelemetryLoggerOptions.Services xml detail remarks.
CodeBlanch Jul 29, 2022
a1fe108
More tests.
CodeBlanch Jul 29, 2022
d2ba768
More tests.
CodeBlanch Jul 29, 2022
a8f8238
Test fix.
CodeBlanch Jul 29, 2022
6daf110
More tests.
CodeBlanch Jul 29, 2022
71cdfbf
Tests and fixes.
CodeBlanch Jul 29, 2022
0c73626
Warning cleanup.
CodeBlanch Jul 29, 2022
c5c93e0
Added resource test.
CodeBlanch Jul 29, 2022
3632366
Smooth out multiple resource configurations.
CodeBlanch Jul 29, 2022
e78734c
Resource chaining fix.
CodeBlanch Jul 29, 2022
8aeb08e
Remove throw for additional SetResourceBuilder calls.
CodeBlanch Jul 29, 2022
570ab37
Warning fixes.
CodeBlanch Jul 29, 2022
813bacc
Moved OpenTelemetryEventSourceLogEmitter extension to OpenTelemetryLo…
CodeBlanch Jul 30, 2022
6ffd623
Tweaks.
CodeBlanch Jul 30, 2022
fad5a6c
Switched from static to builder pattern.
CodeBlanch Aug 1, 2022
d477d8d
Tweaks.
CodeBlanch Aug 1, 2022
2c4195d
More tests.
CodeBlanch Aug 1, 2022
ce2a932
Merge remote-tracking branch 'upstream/main' into loggerprovider-depe…
CodeBlanch Aug 4, 2022
6284ff1
Fix CHANGELOG for release.
CodeBlanch Aug 4, 2022
d416e1b
Merge remote-tracking branch 'upstream/main' into loggerprovider-depe…
CodeBlanch Aug 5, 2022
2b26cb0
Tweaks.
CodeBlanch Aug 5, 2022
280ad5d
Test updates.
CodeBlanch Aug 5, 2022
251ff81
Added a detached configuration option.
CodeBlanch Aug 5, 2022
5f2b5b5
Prevent double registration to be consistent with tracer builder patt…
CodeBlanch Aug 5, 2022
28301d8
API review.
CodeBlanch Aug 5, 2022
e389a5d
Merge remote-tracking branch 'upstream/main' into loggerprovider-depe…
CodeBlanch Aug 5, 2022
7cc2865
Warning cleanup.
CodeBlanch Aug 5, 2022
8ecfdaf
Build fixes.
CodeBlanch Aug 5, 2022
7057343
Test fix.
CodeBlanch Aug 5, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/LoggingExtensions/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

var resourceBuilder = ResourceBuilder.CreateDefault().AddService("Examples.LoggingExtensions");

var openTelemetryLoggerProvider = new OpenTelemetryLoggerProvider(options =>
var openTelemetryLoggerProvider = OpenTelemetryLoggerProvider.Create(options =>
Copy link
Member

Choose a reason for hiding this comment

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

Would a static method on Sdk make sense? Like Sdk.CreateMeterProviderBuilder and Sdk.CreateTracerProviderBuilder

Copy link
Member Author

Choose a reason for hiding this comment

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

Good idea I like it! At the moment the mechanics are slightly different in that there is no Build method for OpenTelemetryLoggerProvider. I could introduce a small class LoggerProviderBuilder so it matches more closely what we have to metrics + traces. Thoughts on that?

Copy link
Member

Choose a reason for hiding this comment

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

If folks aren't thrilled by that idea, then I think Sdk.CreateLoggerProvider (i.e., w/o Builder) wouldn't be terrible.

But, consistency would have a nice feel to it, so my vote is a simple class enabling Sdk.CreateLoggerProviderBuilder(...).Build()

Copy link
Member Author

Choose a reason for hiding this comment

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

@alanwest OK this now has more of a builder pattern. Updated the description. LMK what you think!

{
options.IncludeFormattedMessage = true;
options
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#nullable enable
OpenTelemetry.Logs.OpenTelemetryEventSourceLogEmitter
OpenTelemetry.Logs.OpenTelemetryEventSourceLogEmitter.OpenTelemetryEventSourceLogEmitter(OpenTelemetry.Logs.OpenTelemetryLoggerProvider! openTelemetryLoggerProvider, System.Func<string!, System.Diagnostics.Tracing.EventLevel?>! shouldListenToFunc, bool disposeProvider = true) -> void
OpenTelemetry.Logs.OpenTelemetryEventSourceServiceCollectionExtensions
override OpenTelemetry.Logs.OpenTelemetryEventSourceLogEmitter.Dispose() -> void
static OpenTelemetry.Logs.OpenTelemetryEventSourceServiceCollectionExtensions.AddOpenTelemetryEventSourceLogEmitter(this Microsoft.Extensions.DependencyInjection.IServiceCollection! services, System.Func<string!, System.Diagnostics.Tracing.EventLevel?>! shouldListenToFunc) -> Microsoft.Extensions.DependencyInjection.IServiceCollection!
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#nullable enable
OpenTelemetry.Logs.OpenTelemetryEventSourceLogEmitter
OpenTelemetry.Logs.OpenTelemetryEventSourceLogEmitter.OpenTelemetryEventSourceLogEmitter(OpenTelemetry.Logs.OpenTelemetryLoggerProvider! openTelemetryLoggerProvider, System.Func<string!, System.Diagnostics.Tracing.EventLevel?>! shouldListenToFunc, bool disposeProvider = true) -> void
OpenTelemetry.Logs.OpenTelemetryEventSourceServiceCollectionExtensions
override OpenTelemetry.Logs.OpenTelemetryEventSourceLogEmitter.Dispose() -> void
static OpenTelemetry.Logs.OpenTelemetryEventSourceServiceCollectionExtensions.AddOpenTelemetryEventSourceLogEmitter(this Microsoft.Extensions.DependencyInjection.IServiceCollection! services, System.Func<string!, System.Diagnostics.Tracing.EventLevel?>! shouldListenToFunc) -> Microsoft.Extensions.DependencyInjection.IServiceCollection!
1 change: 1 addition & 0 deletions src/OpenTelemetry.Extensions.EventSource/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
using System.Runtime.CompilerServices;

[assembly: CLSCompliant(false)]
[assembly: InternalsVisibleTo("OpenTelemetry.Extensions.EventSource.Tests" + AssemblyInfo.PublicKey)]
[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2" + AssemblyInfo.MoqPublicKey)]

#if SIGNED
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
// <copyright file="OpenTelemetryEventSourceServiceCollectionExtensions.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>

using System;
using System.Collections.Generic;
using System.Diagnostics.Tracing;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using OpenTelemetry.Internal;

namespace OpenTelemetry.Logs
{
/// <summary>
/// Contains extension methods for registering OpenTelemetry EventSource utilities into application services.
/// </summary>
public static class OpenTelemetryEventSourceServiceCollectionExtensions
{
/// <summary>
/// Registers into application services an <see cref="EventListener"/>
/// which will convert <see cref="EventSource"/> events into
/// OpenTelemetry logs.
/// </summary>
/// <param name="services"><see cref="IServiceCollection"/>.</param>
/// <param name="shouldListenToFunc">Callback function used to decide if
/// events should be captured for a given <see
/// cref="EventSource.Name"/>. Return <see langword="null"/> if no
/// events should be captured.</param>
/// <returns>Supplied <see cref="IServiceCollection"/> for chaining calls.</returns>
public static IServiceCollection AddOpenTelemetryEventSourceLogEmitter(
this IServiceCollection services,
Func<string, EventLevel?> shouldListenToFunc)
{
Guard.ThrowIfNull(services);
Guard.ThrowIfNull(shouldListenToFunc);

services.TryAddSingleton<EventSourceManager>();

services.Configure<OpenTelemetryLoggerOptions>(options =>
{
options.Configure((sp, provider) =>
{
var manager = sp.GetRequiredService<EventSourceManager>();

manager.Emitters.Add(
new OpenTelemetryEventSourceLogEmitter(provider, shouldListenToFunc, disposeProvider: false));
});
});

return services;
}

internal sealed class EventSourceManager : IDisposable
{
public List<OpenTelemetryEventSourceLogEmitter> Emitters { get; } = new();

public void Dispose()
{
foreach (var emitter in this.Emitters)
{
emitter.Dispose();
}

this.Emitters.Clear();
}
}
}
}
33 changes: 31 additions & 2 deletions src/OpenTelemetry.Extensions.EventSource/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,38 @@ dotnet add package OpenTelemetry.Extensions.EventSource --prerelease

## Usage Example

### Configured using dependency injection

```csharp
IHost host = Host.CreateDefaultBuilder(args)
.ConfigureLogging(builder =>
{
builder.ClearProviders();

// Step 1: Configure OpenTelemetry logging...
builder.AddOpenTelemetry(options =>
{
options
.SetResourceBuilder(ResourceBuilder.CreateDefault().AddService("MyService"))
CodeBlanch marked this conversation as resolved.
Show resolved Hide resolved
.AddConsoleExporter();
});
})
.ConfigureServices((hostContext, services) =>
{
// Step 2: Register OpenTelemetryEventSourceLogEmitter to listen to events...
services.AddOpenTelemetryEventSourceLogEmitter(
(name) => name == MyEventSource.Name ? EventLevel.Informational : null);
})
.Build();

host.Run();
```

### Configured manually

```csharp
// Step 1: Configure OpenTelemetryLoggerProvider...
var openTelemetryLoggerProvider = new OpenTelemetryLoggerProvider(options =>
var openTelemetryLoggerProvider = OpenTelemetryLoggerProvider.Create(options =>
{
options
.SetResourceBuilder(ResourceBuilder.CreateDefault().AddService("MyService"))
Expand All @@ -29,7 +58,7 @@ var openTelemetryLoggerProvider = new OpenTelemetryLoggerProvider(options =>
// Step 2: Create OpenTelemetryEventSourceLogEmitter to listen to events...
using var openTelemetryEventSourceLogEmitter = new OpenTelemetryEventSourceLogEmitter(
openTelemetryLoggerProvider,
(name) => name.StartsWith("OpenTelemetry") ? EventLevel.LogAlways : null,
(name) => name == MyEventSource.Name ? EventLevel.Informational : null,
disposeProvider: true);
```

Expand Down
2 changes: 1 addition & 1 deletion src/OpenTelemetry.Extensions.Serilog/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ dotnet add package OpenTelemetry.Extensions.Serilog --prerelease

```csharp
// Step 1: Configure OpenTelemetryLoggerProvider...
var openTelemetryLoggerProvider = new OpenTelemetryLoggerProvider(options =>
var openTelemetryLoggerProvider = OpenTelemetryLoggerProvider.Create(options =>
{
options
.SetResourceBuilder(ResourceBuilder.CreateDefault().AddService("MyService"))
Expand Down
9 changes: 7 additions & 2 deletions src/OpenTelemetry/.publicApi/net462/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,19 @@ OpenTelemetry.Logs.LogRecord.Timestamp.set -> void
OpenTelemetry.Logs.LogRecord.TraceFlags.set -> void
OpenTelemetry.Logs.LogRecord.TraceId.set -> void
OpenTelemetry.Logs.LogRecord.TraceState.set -> void
OpenTelemetry.Logs.OpenTelemetryLoggerOptions.AddProcessor<T>() -> OpenTelemetry.Logs.OpenTelemetryLoggerOptions!
OpenTelemetry.Logs.OpenTelemetryLoggerOptions.Configure(System.Action<System.IServiceProvider!, OpenTelemetry.Logs.OpenTelemetryLoggerProvider!>! configure) -> OpenTelemetry.Logs.OpenTelemetryLoggerOptions!
OpenTelemetry.Logs.OpenTelemetryLoggerOptions.ConfigureResource(System.Action<OpenTelemetry.Resources.ResourceBuilder!>! configure) -> OpenTelemetry.Logs.OpenTelemetryLoggerOptions!
OpenTelemetry.Logs.OpenTelemetryLoggerOptions.Services.get -> Microsoft.Extensions.DependencyInjection.IServiceCollection?
OpenTelemetry.Logs.OpenTelemetryLoggerProvider.AddProcessor(OpenTelemetry.BaseProcessor<OpenTelemetry.Logs.LogRecord!>! processor) -> OpenTelemetry.Logs.OpenTelemetryLoggerProvider!
OpenTelemetry.Logs.OpenTelemetryLoggerProvider.ForceFlush(int timeoutMilliseconds = -1) -> bool
OpenTelemetry.Logs.OpenTelemetryLoggerProvider.OpenTelemetryLoggerProvider() -> void
OpenTelemetry.Logs.OpenTelemetryLoggerProvider.OpenTelemetryLoggerProvider(System.Action<OpenTelemetry.Logs.OpenTelemetryLoggerOptions!>! configure) -> void
OpenTelemetry.Logs.OpenTelemetryLoggerOptions.ConfigureResource(System.Action<OpenTelemetry.Resources.ResourceBuilder!>! configure) -> OpenTelemetry.Logs.OpenTelemetryLoggerOptions!
*REMOVED*static Microsoft.Extensions.Logging.OpenTelemetryLoggingExtensions.AddOpenTelemetry(this Microsoft.Extensions.Logging.ILoggingBuilder! builder, System.Action<OpenTelemetry.Logs.OpenTelemetryLoggerOptions!>? configure = null) -> Microsoft.Extensions.Logging.ILoggingBuilder!
OpenTelemetry.Logs.OpenTelemetryLoggerProvider.OpenTelemetryLoggerProvider(Microsoft.Extensions.Options.IOptionsMonitor<OpenTelemetry.Logs.OpenTelemetryLoggerOptions!>! options, System.IServiceProvider! serviceProvider) -> void
static Microsoft.Extensions.Logging.OpenTelemetryLoggingExtensions.AddOpenTelemetry(this Microsoft.Extensions.Logging.ILoggingBuilder! builder) -> Microsoft.Extensions.Logging.ILoggingBuilder!
static Microsoft.Extensions.Logging.OpenTelemetryLoggingExtensions.AddOpenTelemetry(this Microsoft.Extensions.Logging.ILoggingBuilder! builder, OpenTelemetry.Logs.OpenTelemetryLoggerProvider! openTelemetryLoggerProvider) -> Microsoft.Extensions.Logging.ILoggingBuilder!
static Microsoft.Extensions.Logging.OpenTelemetryLoggingExtensions.AddOpenTelemetry(this Microsoft.Extensions.Logging.ILoggingBuilder! builder, OpenTelemetry.Logs.OpenTelemetryLoggerProvider! openTelemetryLoggerProvider, bool disposeProvider) -> Microsoft.Extensions.Logging.ILoggingBuilder!
static Microsoft.Extensions.Logging.OpenTelemetryLoggingExtensions.AddOpenTelemetry(this Microsoft.Extensions.Logging.ILoggingBuilder! builder, System.Action<OpenTelemetry.Logs.OpenTelemetryLoggerOptions!>? configure) -> Microsoft.Extensions.Logging.ILoggingBuilder!
static OpenTelemetry.Logs.OpenTelemetryLoggerProvider.Create(System.Action<OpenTelemetry.Logs.OpenTelemetryLoggerOptions!>? configure = null) -> OpenTelemetry.Logs.OpenTelemetryLoggerProvider!
~static OpenTelemetry.Metrics.MeterProviderBuilderExtensions.ConfigureResource(this OpenTelemetry.Metrics.MeterProviderBuilder meterProviderBuilder, System.Action<OpenTelemetry.Resources.ResourceBuilder> configure) -> OpenTelemetry.Metrics.MeterProviderBuilder
~static OpenTelemetry.Trace.TracerProviderBuilderExtensions.ConfigureResource(this OpenTelemetry.Trace.TracerProviderBuilder tracerProviderBuilder, System.Action<OpenTelemetry.Resources.ResourceBuilder> configure) -> OpenTelemetry.Trace.TracerProviderBuilder
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,19 @@ OpenTelemetry.Logs.LogRecord.Timestamp.set -> void
OpenTelemetry.Logs.LogRecord.TraceFlags.set -> void
OpenTelemetry.Logs.LogRecord.TraceId.set -> void
OpenTelemetry.Logs.LogRecord.TraceState.set -> void
OpenTelemetry.Logs.OpenTelemetryLoggerOptions.AddProcessor<T>() -> OpenTelemetry.Logs.OpenTelemetryLoggerOptions!
OpenTelemetry.Logs.OpenTelemetryLoggerOptions.Configure(System.Action<System.IServiceProvider!, OpenTelemetry.Logs.OpenTelemetryLoggerProvider!>! configure) -> OpenTelemetry.Logs.OpenTelemetryLoggerOptions!
OpenTelemetry.Logs.OpenTelemetryLoggerOptions.ConfigureResource(System.Action<OpenTelemetry.Resources.ResourceBuilder!>! configure) -> OpenTelemetry.Logs.OpenTelemetryLoggerOptions!
OpenTelemetry.Logs.OpenTelemetryLoggerOptions.Services.get -> Microsoft.Extensions.DependencyInjection.IServiceCollection?
OpenTelemetry.Logs.OpenTelemetryLoggerProvider.AddProcessor(OpenTelemetry.BaseProcessor<OpenTelemetry.Logs.LogRecord!>! processor) -> OpenTelemetry.Logs.OpenTelemetryLoggerProvider!
OpenTelemetry.Logs.OpenTelemetryLoggerProvider.ForceFlush(int timeoutMilliseconds = -1) -> bool
OpenTelemetry.Logs.OpenTelemetryLoggerProvider.OpenTelemetryLoggerProvider() -> void
OpenTelemetry.Logs.OpenTelemetryLoggerProvider.OpenTelemetryLoggerProvider(System.Action<OpenTelemetry.Logs.OpenTelemetryLoggerOptions!>! configure) -> void
*REMOVED*static Microsoft.Extensions.Logging.OpenTelemetryLoggingExtensions.AddOpenTelemetry(this Microsoft.Extensions.Logging.ILoggingBuilder! builder, System.Action<OpenTelemetry.Logs.OpenTelemetryLoggerOptions!>? configure = null) -> Microsoft.Extensions.Logging.ILoggingBuilder!
OpenTelemetry.Logs.OpenTelemetryLoggerProvider.OpenTelemetryLoggerProvider(Microsoft.Extensions.Options.IOptionsMonitor<OpenTelemetry.Logs.OpenTelemetryLoggerOptions!>! options, System.IServiceProvider! serviceProvider) -> void
static Microsoft.Extensions.Logging.OpenTelemetryLoggingExtensions.AddOpenTelemetry(this Microsoft.Extensions.Logging.ILoggingBuilder! builder) -> Microsoft.Extensions.Logging.ILoggingBuilder!
static Microsoft.Extensions.Logging.OpenTelemetryLoggingExtensions.AddOpenTelemetry(this Microsoft.Extensions.Logging.ILoggingBuilder! builder, OpenTelemetry.Logs.OpenTelemetryLoggerProvider! openTelemetryLoggerProvider) -> Microsoft.Extensions.Logging.ILoggingBuilder!
static Microsoft.Extensions.Logging.OpenTelemetryLoggingExtensions.AddOpenTelemetry(this Microsoft.Extensions.Logging.ILoggingBuilder! builder, OpenTelemetry.Logs.OpenTelemetryLoggerProvider! openTelemetryLoggerProvider, bool disposeProvider) -> Microsoft.Extensions.Logging.ILoggingBuilder!
static Microsoft.Extensions.Logging.OpenTelemetryLoggingExtensions.AddOpenTelemetry(this Microsoft.Extensions.Logging.ILoggingBuilder! builder, System.Action<OpenTelemetry.Logs.OpenTelemetryLoggerOptions!>? configure) -> Microsoft.Extensions.Logging.ILoggingBuilder!
static OpenTelemetry.Logs.OpenTelemetryLoggerProvider.Create(System.Action<OpenTelemetry.Logs.OpenTelemetryLoggerOptions!>? configure = null) -> OpenTelemetry.Logs.OpenTelemetryLoggerProvider!
~static OpenTelemetry.Metrics.MeterProviderBuilderExtensions.ConfigureResource(this OpenTelemetry.Metrics.MeterProviderBuilder meterProviderBuilder, System.Action<OpenTelemetry.Resources.ResourceBuilder> configure) -> OpenTelemetry.Metrics.MeterProviderBuilder
~static OpenTelemetry.Trace.TracerProviderBuilderExtensions.ConfigureResource(this OpenTelemetry.Trace.TracerProviderBuilder tracerProviderBuilder, System.Action<OpenTelemetry.Resources.ResourceBuilder> configure) -> OpenTelemetry.Trace.TracerProviderBuilder
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,19 @@ OpenTelemetry.Logs.LogRecord.Timestamp.set -> void
OpenTelemetry.Logs.LogRecord.TraceFlags.set -> void
OpenTelemetry.Logs.LogRecord.TraceId.set -> void
OpenTelemetry.Logs.LogRecord.TraceState.set -> void
OpenTelemetry.Logs.OpenTelemetryLoggerOptions.AddProcessor<T>() -> OpenTelemetry.Logs.OpenTelemetryLoggerOptions!
OpenTelemetry.Logs.OpenTelemetryLoggerOptions.Configure(System.Action<System.IServiceProvider!, OpenTelemetry.Logs.OpenTelemetryLoggerProvider!>! configure) -> OpenTelemetry.Logs.OpenTelemetryLoggerOptions!
OpenTelemetry.Logs.OpenTelemetryLoggerOptions.Services.get -> Microsoft.Extensions.DependencyInjection.IServiceCollection?
OpenTelemetry.Logs.OpenTelemetryLoggerProvider.AddProcessor(OpenTelemetry.BaseProcessor<OpenTelemetry.Logs.LogRecord!>! processor) -> OpenTelemetry.Logs.OpenTelemetryLoggerProvider!
OpenTelemetry.Logs.OpenTelemetryLoggerProvider.ForceFlush(int timeoutMilliseconds = -1) -> bool
OpenTelemetry.Logs.OpenTelemetryLoggerProvider.OpenTelemetryLoggerProvider() -> void
OpenTelemetry.Logs.OpenTelemetryLoggerProvider.OpenTelemetryLoggerProvider(System.Action<OpenTelemetry.Logs.OpenTelemetryLoggerOptions!>! configure) -> void
OpenTelemetry.Logs.OpenTelemetryLoggerOptions.ConfigureResource(System.Action<OpenTelemetry.Resources.ResourceBuilder!>! configure) -> OpenTelemetry.Logs.OpenTelemetryLoggerOptions!
*REMOVED*static Microsoft.Extensions.Logging.OpenTelemetryLoggingExtensions.AddOpenTelemetry(this Microsoft.Extensions.Logging.ILoggingBuilder! builder, System.Action<OpenTelemetry.Logs.OpenTelemetryLoggerOptions!>? configure = null) -> Microsoft.Extensions.Logging.ILoggingBuilder!
OpenTelemetry.Logs.OpenTelemetryLoggerProvider.OpenTelemetryLoggerProvider(Microsoft.Extensions.Options.IOptionsMonitor<OpenTelemetry.Logs.OpenTelemetryLoggerOptions!>! options, System.IServiceProvider! serviceProvider) -> void
static Microsoft.Extensions.Logging.OpenTelemetryLoggingExtensions.AddOpenTelemetry(this Microsoft.Extensions.Logging.ILoggingBuilder! builder) -> Microsoft.Extensions.Logging.ILoggingBuilder!
static Microsoft.Extensions.Logging.OpenTelemetryLoggingExtensions.AddOpenTelemetry(this Microsoft.Extensions.Logging.ILoggingBuilder! builder, OpenTelemetry.Logs.OpenTelemetryLoggerProvider! openTelemetryLoggerProvider) -> Microsoft.Extensions.Logging.ILoggingBuilder!
static Microsoft.Extensions.Logging.OpenTelemetryLoggingExtensions.AddOpenTelemetry(this Microsoft.Extensions.Logging.ILoggingBuilder! builder, OpenTelemetry.Logs.OpenTelemetryLoggerProvider! openTelemetryLoggerProvider, bool disposeProvider) -> Microsoft.Extensions.Logging.ILoggingBuilder!
static Microsoft.Extensions.Logging.OpenTelemetryLoggingExtensions.AddOpenTelemetry(this Microsoft.Extensions.Logging.ILoggingBuilder! builder, System.Action<OpenTelemetry.Logs.OpenTelemetryLoggerOptions!>? configure) -> Microsoft.Extensions.Logging.ILoggingBuilder!
static OpenTelemetry.Logs.OpenTelemetryLoggerProvider.Create(System.Action<OpenTelemetry.Logs.OpenTelemetryLoggerOptions!>? configure = null) -> OpenTelemetry.Logs.OpenTelemetryLoggerProvider!
~static OpenTelemetry.Metrics.MeterProviderBuilderExtensions.ConfigureResource(this OpenTelemetry.Metrics.MeterProviderBuilder meterProviderBuilder, System.Action<OpenTelemetry.Resources.ResourceBuilder> configure) -> OpenTelemetry.Metrics.MeterProviderBuilder
~static OpenTelemetry.Trace.TracerProviderBuilderExtensions.ConfigureResource(this OpenTelemetry.Trace.TracerProviderBuilder tracerProviderBuilder, System.Action<OpenTelemetry.Resources.ResourceBuilder> configure) -> OpenTelemetry.Trace.TracerProviderBuilder
Loading