From c18adf07eda05354a913962450a231d72a314303 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Kie=C5=82kowicz?= Date: Mon, 31 Jan 2022 13:16:46 +0100 Subject: [PATCH 1/7] typo fix --- .../Configuration/EnvironmentConfigurationHelper.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OpenTelemetry.ClrProfiler.Managed/Configuration/EnvironmentConfigurationHelper.cs b/src/OpenTelemetry.ClrProfiler.Managed/Configuration/EnvironmentConfigurationHelper.cs index 4d5abeb8f7..925ee64320 100644 --- a/src/OpenTelemetry.ClrProfiler.Managed/Configuration/EnvironmentConfigurationHelper.cs +++ b/src/OpenTelemetry.ClrProfiler.Managed/Configuration/EnvironmentConfigurationHelper.cs @@ -84,7 +84,7 @@ private static TracerProviderBuilder SetExporter(this TracerProviderBuilder buil case null: break; default: - throw new ArgumentOutOfRangeException("The exporter name is not recognised"); + throw new ArgumentOutOfRangeException("The exporter name is not recognized"); } return builder; From fe17b23d91a72f07fa72fa5386e7afafc9b19a10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Kie=C5=82kowicz?= Date: Mon, 31 Jan 2022 13:18:35 +0100 Subject: [PATCH 2/7] typo fix --- .../Configuration/ConfigurationKeys.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OpenTelemetry.ClrProfiler.Managed/Configuration/ConfigurationKeys.cs b/src/OpenTelemetry.ClrProfiler.Managed/Configuration/ConfigurationKeys.cs index 63e2e866f7..e31f869787 100644 --- a/src/OpenTelemetry.ClrProfiler.Managed/Configuration/ConfigurationKeys.cs +++ b/src/OpenTelemetry.ClrProfiler.Managed/Configuration/ConfigurationKeys.cs @@ -42,7 +42,7 @@ public class ConfigurationKeys public const string DisabledInstrumentations = "OTEL_DOTNET_TRACER_DISABLED_INSTRUMENTATIONS"; /// - /// Configuration key for colon (:) separated list of plugins repesented by . + /// Configuration key for colon (:) separated list of plugins represented by . /// public const string ProviderPlugins = "OTEL_DOTNET_TRACER_INSTRUMENTATION_PLUGINS"; From acc2ea835dee8ad513c03fbefd77e6551c3a6bad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Kie=C5=82kowicz?= Date: Mon, 31 Jan 2022 13:25:25 +0100 Subject: [PATCH 3/7] remove workaround for #290 it was fixed in #294 --- .../Configuration/EnvironmentConfigurationHelper.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/OpenTelemetry.ClrProfiler.Managed/Configuration/EnvironmentConfigurationHelper.cs b/src/OpenTelemetry.ClrProfiler.Managed/Configuration/EnvironmentConfigurationHelper.cs index 925ee64320..04bc468541 100644 --- a/src/OpenTelemetry.ClrProfiler.Managed/Configuration/EnvironmentConfigurationHelper.cs +++ b/src/OpenTelemetry.ClrProfiler.Managed/Configuration/EnvironmentConfigurationHelper.cs @@ -75,10 +75,7 @@ private static TracerProviderBuilder SetExporter(this TracerProviderBuilder buil // See: https://docs.microsoft.com/aspnet/core/grpc/troubleshoot#call-insecure-grpc-services-with-net-core-client AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2UnencryptedSupport", true); #endif - builder.AddOtlpExporter(options => - { - options.ExportProcessorType = ExportProcessorType.Simple; // workaround for https://github.com/open-telemetry/opentelemetry-dotnet-instrumentation/issues/290 - }); + builder.AddOtlpExporter(); break; case "": case null: From f6192b74e4f5df3897181ec8ac2b43e203951264 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Kie=C5=82kowicz?= Date: Mon, 31 Jan 2022 13:32:02 +0100 Subject: [PATCH 4/7] remove redundant usings --- .../Configuration/EnvironmentConfigurationHelper.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/OpenTelemetry.ClrProfiler.Managed/Configuration/EnvironmentConfigurationHelper.cs b/src/OpenTelemetry.ClrProfiler.Managed/Configuration/EnvironmentConfigurationHelper.cs index 04bc468541..fd5fb7536a 100644 --- a/src/OpenTelemetry.ClrProfiler.Managed/Configuration/EnvironmentConfigurationHelper.cs +++ b/src/OpenTelemetry.ClrProfiler.Managed/Configuration/EnvironmentConfigurationHelper.cs @@ -1,8 +1,6 @@ using System; using System.Collections.Generic; -using System.Diagnostics; using System.Linq; -using System.Reflection; using OpenTelemetry.Resources; using OpenTelemetry.Trace; From dfe9048acdf2a80dd82ea29c739cc63205268c53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Kie=C5=82kowicz?= Date: Mon, 31 Jan 2022 13:34:42 +0100 Subject: [PATCH 5/7] make OTLP standard exporter for .NET (Core) Zipkin remains for .NET Framework --- dev/envvars.sh | 1 - docs/USAGE.md | 2 +- .../Configuration/ConfigurationKeys.cs | 3 ++- .../Configuration/Settings.cs | 8 +++++++- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/dev/envvars.sh b/dev/envvars.sh index 31b8b5313f..86c9105cb3 100644 --- a/dev/envvars.sh +++ b/dev/envvars.sh @@ -58,7 +58,6 @@ fi export OTEL_DOTNET_TRACER_HOME="${CURDIR}/bin/tracer-home" export OTEL_INTEGRATIONS="${CURDIR}/bin/tracer-home/integrations.json" export OTEL_TRACE_DEBUG="1" -export OTEL_EXPORTER="zipkin" export OTEL_DUMP_ILREWRITE_ENABLED="0" export OTEL_CLR_ENABLE_INLINING="1" export OTEL_PROFILER_EXCLUDE_PROCESSES="dotnet.exe,dotnet" diff --git a/docs/USAGE.md b/docs/USAGE.md index e5746faf42..bef5d4a23d 100644 --- a/docs/USAGE.md +++ b/docs/USAGE.md @@ -65,7 +65,7 @@ The exporter is used to output the telemetry. | Environment variable | Description | Default | |-|-|-| -| `OTEL_EXPORTER` | The exporter to be used. The Tracer uses it to encode and dispatch traces. Available values are: `zipkin`, `jeager`, `otlp`. | | +| `OTEL_EXPORTER` | The exporter to be used. The Tracer uses it to encode and dispatch traces. Available values are: `zipkin`, `jeager`, `otlp`. | `otlp` for .NET (Core), `zipkin` for .NET Framework | | `OTEL_EXPORTER_JAEGER_AGENT_HOST` | Hostname for the Jaeger agent. | `localhost` | | `OTEL_EXPORTER_JAEGER_AGENT_PORT` | Port for the Jaeger agent. | `6831` | | `OTEL_EXPORTER_OTLP_ENDPOINT` | Target endpoint for OTLP exporter. More details [here](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md). | `http://localhost:4318` | diff --git a/src/OpenTelemetry.ClrProfiler.Managed/Configuration/ConfigurationKeys.cs b/src/OpenTelemetry.ClrProfiler.Managed/Configuration/ConfigurationKeys.cs index e31f869787..f32a33d623 100644 --- a/src/OpenTelemetry.ClrProfiler.Managed/Configuration/ConfigurationKeys.cs +++ b/src/OpenTelemetry.ClrProfiler.Managed/Configuration/ConfigurationKeys.cs @@ -22,7 +22,8 @@ public class ConfigurationKeys /// /// Configuration key for the exporter to be used. The Tracer uses it to encode and /// dispatch traces. - /// Default is "Zipkin". + /// Default is "otlp" for .NET (Core). + /// Default is "Zipkin" for .NET Framework. /// public const string Exporter = "OTEL_EXPORTER"; diff --git a/src/OpenTelemetry.ClrProfiler.Managed/Configuration/Settings.cs b/src/OpenTelemetry.ClrProfiler.Managed/Configuration/Settings.cs index 7606383e67..47990f0aa9 100644 --- a/src/OpenTelemetry.ClrProfiler.Managed/Configuration/Settings.cs +++ b/src/OpenTelemetry.ClrProfiler.Managed/Configuration/Settings.cs @@ -23,7 +23,13 @@ private Settings(IConfigurationSource source) throw new ArgumentNullException(nameof(source)); } - Exporter = source.GetString(ConfigurationKeys.Exporter); + Exporter = source.GetString(ConfigurationKeys.Exporter) ?? +#if NETFRAMEWORK + "zipkin"; +#else + "otlp"; +#endif + LoadTracerAtStartup = source.GetBool(ConfigurationKeys.LoadTracerAtStartup) ?? true; ConsoleExporterEnabled = source.GetBool(ConfigurationKeys.ConsoleExporterEnabled) ?? true; From 259f112e089ff595617c84804c2f059777abc28b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Kie=C5=82kowicz?= Date: Tue, 1 Feb 2022 13:44:07 +0100 Subject: [PATCH 6/7] bump Microsoft.Extensions.Logging.Abstractions to 3.0.3 in ConsoleApp make the version compatible with OtelExporter (Grpc.Net.Client) --- samples/ConsoleApp/ConsoleApp.csproj | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/samples/ConsoleApp/ConsoleApp.csproj b/samples/ConsoleApp/ConsoleApp.csproj index 0e2134f5a6..cfdad5aad6 100644 --- a/samples/ConsoleApp/ConsoleApp.csproj +++ b/samples/ConsoleApp/ConsoleApp.csproj @@ -1,4 +1,4 @@ - + Exe @@ -15,7 +15,8 @@ - + + From cc7b2b708cfab109eb509f8244a071a5b6fb0b3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Kie=C5=82kowicz?= Date: Tue, 1 Feb 2022 13:51:09 +0100 Subject: [PATCH 7/7] load Grpc.Net.Client for .NET 5.0 from local directory instead of Grpc.Net.Client for .NET Standard 2.1 from tracer-home --- samples/ConsoleApp/ConsoleApp.csproj | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/samples/ConsoleApp/ConsoleApp.csproj b/samples/ConsoleApp/ConsoleApp.csproj index cfdad5aad6..bc181c6875 100644 --- a/samples/ConsoleApp/ConsoleApp.csproj +++ b/samples/ConsoleApp/ConsoleApp.csproj @@ -1,4 +1,4 @@ - + Exe @@ -17,6 +17,8 @@ + +