|
1 | 1 | // Copyright The OpenTelemetry Authors
|
2 | 2 | // SPDX-License-Identifier: Apache-2.0
|
3 | 3 |
|
4 |
| -using Microsoft.Extensions.Configuration; |
| 4 | +using System.Diagnostics; |
5 | 5 | using OpenTelemetry.Exporter.OpenTelemetryProtocol.Implementation;
|
6 | 6 | using OpenTelemetry.Exporter.OpenTelemetryProtocol.Implementation.Transmission;
|
7 | 7 | using OpenTelemetry.Metrics;
|
@@ -32,21 +32,18 @@ public OtlpMetricExporter(OtlpExporterOptions options)
|
32 | 32 | /// <summary>
|
33 | 33 | /// Initializes a new instance of the <see cref="OtlpMetricExporter"/> class.
|
34 | 34 | /// </summary>
|
35 |
| - /// <param name="options">Configuration options for the export.</param> |
| 35 | + /// <param name="exporterOptions"><see cref="OtlpExporterOptions"/>.</param> |
36 | 36 | /// <param name="experimentalOptions"><see cref="ExperimentalOptions"/>.</param>
|
37 | 37 | /// <param name="transmissionHandler"><see cref="OtlpExporterTransmissionHandler{T}"/>.</param>
|
38 | 38 | internal OtlpMetricExporter(
|
39 |
| - OtlpExporterOptions options, |
| 39 | + OtlpExporterOptions exporterOptions, |
40 | 40 | ExperimentalOptions experimentalOptions,
|
41 | 41 | OtlpExporterTransmissionHandler<OtlpCollector.ExportMetricsServiceRequest> transmissionHandler = null)
|
42 | 42 | {
|
43 |
| - // Each of the Otlp exporters: Traces, Metrics, and Logs set the same |
44 |
| - // value for |
45 |
| - // `OpenTelemetryConfigurationExtensions.LogInvalidEnvironmentVariable` |
46 |
| - // so it should be fine even if these exporters are used together. |
47 |
| - OpenTelemetryConfigurationExtensions.LogInvalidEnvironmentVariable = OpenTelemetryProtocolExporterEventSource.Log.InvalidEnvironmentVariable; |
| 43 | + Debug.Assert(exporterOptions != null, "exporterOptions was null"); |
| 44 | + Debug.Assert(experimentalOptions != null, "experimentalOptions was null"); |
48 | 45 |
|
49 |
| - this.transmissionHandler = transmissionHandler ?? options.GetMetricsExportTransmissionHandler(experimentalOptions); |
| 46 | + this.transmissionHandler = transmissionHandler ?? exporterOptions.GetMetricsExportTransmissionHandler(experimentalOptions); |
50 | 47 | }
|
51 | 48 |
|
52 | 49 | internal OtlpResource.Resource ProcessResource => this.processResource ??= this.ParentProvider.GetResource().ToOtlpResource();
|
|
0 commit comments