From b45be344b341745c895b3eaf0bd61e1303a0cf30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Kie=C5=82kowicz?= Date: Wed, 10 Apr 2024 17:02:44 +0200 Subject: [PATCH] PR feedback --- .../OtlpExporterOptions.cs | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/OtlpExporterOptions.cs b/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/OtlpExporterOptions.cs index 41f5d4f0f1d..7c14310d17f 100644 --- a/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/OtlpExporterOptions.cs +++ b/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/OtlpExporterOptions.cs @@ -37,8 +37,6 @@ public class OtlpExporterOptions : IOtlpExporterOptions internal readonly Func DefaultHttpClientFactory; - private const string UserAgentProduct = "OTel-OTLP-Exporter-Dotnet"; - private OtlpExportProtocol? protocol; private Uri? endpoint; private int? timeoutMilliseconds; @@ -226,15 +224,8 @@ internal OtlpExporterOptions ApplyDefaults(OtlpExporterOptions defaultExporterOp private static string GetUserAgentString() { - try - { - var assembly = typeof(OtlpExporterOptions).Assembly; - return $"{UserAgentProduct}/{assembly.GetPackageVersion()}"; - } - catch (Exception) - { - return UserAgentProduct; - } + var assembly = typeof(OtlpExporterOptions).Assembly; + return $"OTel-OTLP-Exporter-Dotnet/{assembly.GetPackageVersion()}"; } private void ApplyConfiguration(