diff --git a/src/OpenTelemetry.Exporter.Jaeger/CHANGELOG.md b/src/OpenTelemetry.Exporter.Jaeger/CHANGELOG.md index 57062584dd3..1aa49f60713 100644 --- a/src/OpenTelemetry.Exporter.Jaeger/CHANGELOG.md +++ b/src/OpenTelemetry.Exporter.Jaeger/CHANGELOG.md @@ -2,6 +2,12 @@ ## Unreleased +* When using OpenTelemetry.Extensions.Hosting you can now bind + `JaegerExporterOptions` to `IConfiguration` using the `Configure` extension + (ex: + `services.Configure(this.Configuration.GetSection("Jaeger"));`). + ([#1889](https://github.com/open-telemetry/opentelemetry-dotnet/pull/1889)) + ## 1.1.0-beta1 Released 2021-Mar-19 diff --git a/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/CHANGELOG.md b/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/CHANGELOG.md index 5e8e5fb7e5c..0d14c37089e 100644 --- a/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/CHANGELOG.md +++ b/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/CHANGELOG.md @@ -13,6 +13,11 @@ please check the latest changes [spec](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/common/common.md). ([#1919](https://github.com/open-telemetry/opentelemetry-dotnet/pull/1919)) +* When using OpenTelemetry.Extensions.Hosting you can now bind + `OtlpExporterOptions` to `IConfiguration` using the `Configure` extension (ex: + `services.Configure(this.Configuration.GetSection("Otlp"));`). + ([#1942](https://github.com/open-telemetry/opentelemetry-dotnet/pull/1942)) + ## 1.1.0-beta1 Released 2021-Mar-19 diff --git a/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/OpenTelemetry.Exporter.OpenTelemetryProtocol.csproj b/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/OpenTelemetry.Exporter.OpenTelemetryProtocol.csproj index fe31c2db339..124904c1630 100644 --- a/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/OpenTelemetry.Exporter.OpenTelemetryProtocol.csproj +++ b/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/OpenTelemetry.Exporter.OpenTelemetryProtocol.csproj @@ -49,6 +49,7 @@ + diff --git a/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/OtlpTraceExporterHelperExtensions.cs b/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/OtlpTraceExporterHelperExtensions.cs index c8ad06d0ecf..ebb9e8f8d8f 100644 --- a/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/OtlpTraceExporterHelperExtensions.cs +++ b/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/OtlpTraceExporterHelperExtensions.cs @@ -37,7 +37,19 @@ public static TracerProviderBuilder AddOtlpExporter(this TracerProviderBuilder b throw new ArgumentNullException(nameof(builder)); } - var exporterOptions = new OtlpExporterOptions(); + if (builder is IDeferredTracerProviderBuilder deferredTracerProviderBuilder) + { + return deferredTracerProviderBuilder.Configure((sp, builder) => + { + AddOtlpExporter(builder, sp.GetOptions(), configure); + }); + } + + return AddOtlpExporter(builder, new OtlpExporterOptions(), configure); + } + + private static TracerProviderBuilder AddOtlpExporter(TracerProviderBuilder builder, OtlpExporterOptions exporterOptions, Action configure = null) + { configure?.Invoke(exporterOptions); var otlpExporter = new OtlpTraceExporter(exporterOptions); diff --git a/src/OpenTelemetry.Exporter.Zipkin/CHANGELOG.md b/src/OpenTelemetry.Exporter.Zipkin/CHANGELOG.md index 9324a71df9b..0992c14bcfc 100644 --- a/src/OpenTelemetry.Exporter.Zipkin/CHANGELOG.md +++ b/src/OpenTelemetry.Exporter.Zipkin/CHANGELOG.md @@ -2,6 +2,12 @@ ## Unreleased +* When using OpenTelemetry.Extensions.Hosting you can now bind + `JaegerExporterOptions` to `IConfiguration` using the `Configure` extension + (ex: + `services.Configure(this.Configuration.GetSection("Zipkin"));`). + ([#1889](https://github.com/open-telemetry/opentelemetry-dotnet/pull/1889)) + ## 1.1.0-beta1 Released 2021-Mar-19