opentelemetry-dotnet icon indicating copy to clipboard operation
opentelemetry-dotnet copied to clipboard

[logs] Support OTel Logs Bridge API

Open CodeBlanch opened this issue 2 years ago • 5 comments

The OpenTelemetry Specification has been updated with some new logging APIs marked stable:

API: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/bridge-api.md SDK: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/sdk.md

This issue is for tracking the work to implement this in OTel .NET.

Note: This work has been made an experimental feature (see #4735). The APIs will be public in prerelease builds of OpenTelemetry .NET (starting with 1.6.0-alpha.1) but will be internal in stable builds.

  • [X] OpenTelemetry.Api updates
    • [X] Initial definition: #4422
    • [X] Drop class InstrumentationScope: #4436
    • [X] LogRecordSeverity enum: #4451
    • [X] Expose implementation publicly: #4552
    • [X] EmitLog API feedback: #4559
  • [X] OpenTelemetry.Api.ProviderBuilderExtensions updates (DI surface)
    • [X] Initial definition: #4434
    • [X] Updates for recent changes to tracing & metrics: #4531
    • [X] Expose implementation publicly: #4558
  • [X] OpenTelemetry (SDK) updates
    • [X] Define IServiceCollection builder: #4441
    • [X] Define BatchExportLogRecordProcessorOptions: #4446
    • [X] Define sdk builder: #4447
    • [X] Define builder extensions: #4450
    • [X] Define provider extensions: #4480
    • [X] Define LoggerProviderSdk: #4453
    • [X] Define LoggerSdk: #4455
    • [X] LogRecord updates: #4456
      • [X] Unit test: #4462
    • [X] Update BatchExportLogRecordProcessorOptions for spec stable: #4463
    • [X] Define Sdk.CreateLoggerProviderBuilder: #4464
    • [X] Add tests for sdk builder extensions & provider: #4467
    • [X] Update ILoggerProvider to use OTel LoggerProvider: #4473
      • [X] New API surface for passing LoggerProvider to ILogger integration: #5072
        • Proposal 1: #4496
        • Proposal 2: #4501
        • Proposal 3: #4502
        • Proposal 4: #4506
    • [x] Expose implementation publicly: #4568
    • [X] Instrumentation scope version fix: #4635
  • [X] OpenTelemetry.Extensions.Hosting updates
    • [X] Define WithLogging: #4483
    • [X] Remove auto-registration of ILogger: #4535
    • [X] Expose implementation publicly: #4735
  • [X] OpenTelemetry.Exporter.InMemory updates
    • [X] Add LoggerProviderBuilder registration extension: #4541
    • [X] Expose implementation publicly: #4584
  • [X] OpenTelemetry.Exporter.Console updates
    • [X] Add LoggerProviderBuilder registration extension: #4549
    • [X] Updates for LogRecord.Severity & LogRecord.SeverityText: #4568
    • [X] Expose implementation publicly: #4583
  • [X] OpenTelemetry.Exporter.OpenTelemetryProtocol.Logs updates
    • [X] Updates for LogRecord.Severity & LogRecord.SeverityText: #4568
    • [X] Add LoggerProviderBuilder registration extension: #5103
    • [X] Add support for Body set directly on LogRecord: #5268
    • [X] Add support for LogRecords without CategoryName set: #5300
  • [ ] Before marking stable future open/follow-up items:
    • [ ] LogRecord.Severity nullable: https://github.com/open-telemetry/opentelemetry-dotnet/pull/4456#discussion_r1183013068
    • [ ] Discuss obsoletions:
      • OpenTelemetryLoggerOptions.AddProcessor & OpenTelemetryLoggerOptions.SetResourceBuilder
      • InMemoryExporter, ConsoleExporter, & OtlpExporter OpenTelemetryLoggerOptions registration extensions
    • [X] Remove added InternalsVisibleTo
      • [X] OpenTelemetry.Api: #4552
      • [X] OpenTelemetry.Api.ProviderBuilderExtensions: #4558
      • [X] OpenTelemetry: #4568
    • [ ] Documentation updates
    • [ ] Example updates
    • [ ] Public API review

Relates to #4014

CodeBlanch avatar Apr 25 '23 16:04 CodeBlanch

Is there a PR to add .WithLogging(c => c.AddOtlpExporter());? didn't find it in the list.

alrz avatar Jun 06 '24 13:06 alrz

Is there a PR to add .WithLogging(c => c.AddOtlpExporter());? didn't find it in the list.

It is separate from Bridge itself. See https://github.com/open-telemetry/opentelemetry-dotnet/pull/5648

cijothomas avatar Jun 06 '24 14:06 cijothomas