Skip to content

Commit 70bef98

Browse files
committed
fix(api): Remove workaround for #752
1 parent 28d27e4 commit 70bef98

File tree

1 file changed

+1
-17
lines changed

1 file changed

+1
-17
lines changed

source/Gnomeshade.WebApi/Configuration/OpenTelemetryExtensions.cs

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// Licensed under the GNU Affero General Public License v3.0 or later.
33
// See LICENSE.txt file in the project root for full license information.
44

5-
using System;
65
using System.Collections.Generic;
76

87
using Gnomeshade.WebApi.Configuration.Options;
@@ -75,22 +74,7 @@ internal static IServiceCollection AddGnomeshadeOpenTelemetry(
7574

7675
services.AddLogging(builder => builder.AddOpenTelemetry(options =>
7776
{
78-
options.AddOtlpExporter((exporterOptions, loggerOptions) =>
79-
{
80-
loggerOptions.ExportProcessorType = ExportProcessorType.Simple;
81-
82-
// HACK: Force the open telemetry endpoint environment variable to be populated even if
83-
// the value is already provided through other configuration means.
84-
//
85-
// https://github.com/open-telemetry/opentelemetry-dotnet/issues/4014
86-
87-
var defaultOptions = new OpenTelemetryOptions();
88-
var endpoint = configuration.GetValue<Uri>($"{OpenTelemetryOptions.SectionName}:{nameof(OpenTelemetryOptions.ExporterEndpoint)}") ?? defaultOptions.ExporterEndpoint;
89-
var protocol = configuration.GetValue<OtlpExportProtocol>($"{OpenTelemetryOptions.SectionName}:{nameof(OpenTelemetryOptions.ExportProtocol)}");
90-
91-
exporterOptions.Endpoint = endpoint;
92-
exporterOptions.Protocol = protocol;
93-
});
77+
options.AddOtlpExporter((_, loggerOptions) => loggerOptions.ExportProcessorType = ExportProcessorType.Simple);
9478
options.SetResourceBuilder(resourceBuilder);
9579
options.IncludeScopes = true;
9680
options.IncludeFormattedMessage = true;

0 commit comments

Comments
 (0)