File tree Expand file tree Collapse file tree 1 file changed +1
-17
lines changed
source/Gnomeshade.WebApi/Configuration Expand file tree Collapse file tree 1 file changed +1
-17
lines changed Original file line number Diff line number Diff line change 2
2
// Licensed under the GNU Affero General Public License v3.0 or later.
3
3
// See LICENSE.txt file in the project root for full license information.
4
4
5
- using System ;
6
5
using System . Collections . Generic ;
7
6
8
7
using Gnomeshade . WebApi . Configuration . Options ;
@@ -75,22 +74,7 @@ internal static IServiceCollection AddGnomeshadeOpenTelemetry(
75
74
76
75
services . AddLogging ( builder => builder . AddOpenTelemetry ( options =>
77
76
{
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 ) ;
94
78
options . SetResourceBuilder ( resourceBuilder ) ;
95
79
options . IncludeScopes = true ;
96
80
options . IncludeFormattedMessage = true ;
You can’t perform that action at this time.
0 commit comments