File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
src/OpenTelemetry.Exporter.OpenTelemetryProtocol Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ public class OtlpExporterOptions : IOtlpExporterOptions
4141 private int ? timeoutMilliseconds ;
4242 private Func < HttpClient > ? httpClientFactory ;
4343 private string ? userAgentProductIdentifier ;
44+ private string baseUserAgent = $ "OpenTelemetry-OtlpExporter/{ typeof ( OtlpExporterOptions ) . Assembly . GetName ( ) . Version } ";
4445
4546 /// <summary>
4647 /// Initializes a new instance of the <see cref="OtlpExporterOptions"/> class.
@@ -70,7 +71,10 @@ internal OtlpExporterOptions(
7071
7172 this . DefaultHttpClientFactory = ( ) =>
7273 {
73- return new HttpClient { Timeout = TimeSpan . FromMilliseconds ( this . TimeoutMilliseconds ) , } ;
74+ return new HttpClient
75+ {
76+ Timeout = TimeSpan . FromMilliseconds ( this . TimeoutMilliseconds ) ,
77+ } ;
7478 } ;
7579
7680 this . BatchExportProcessorOptions = defaultBatchOptions ! ;
@@ -232,9 +236,6 @@ internal OtlpExporterOptions ApplyDefaults(OtlpExporterOptions defaultExporterOp
232236
233237 private string GetUserAgentString ( )
234238 {
235- var assembly = typeof ( OtlpExporterOptions ) . Assembly ;
236- var baseUserAgent = $ "OTel-OTLP-Exporter-Dotnet/{ assembly . GetPackageVersion ( ) } ";
237-
238239 return ! string . IsNullOrEmpty ( this . userAgentProductIdentifier ) ? $ "{ this . userAgentProductIdentifier } { baseUserAgent } " : baseUserAgent ;
239240 }
240241
You can’t perform that action at this time.
0 commit comments