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/samples/ConsoleApp/ConsoleApp.csproj b/samples/ConsoleApp/ConsoleApp.csproj index 0e2134f5a6..bc181c6875 100644 --- a/samples/ConsoleApp/ConsoleApp.csproj +++ b/samples/ConsoleApp/ConsoleApp.csproj @@ -15,7 +15,10 @@ - + + + + diff --git a/src/OpenTelemetry.ClrProfiler.Managed/Configuration/ConfigurationKeys.cs b/src/OpenTelemetry.ClrProfiler.Managed/Configuration/ConfigurationKeys.cs index 63e2e866f7..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"; @@ -42,7 +43,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"; diff --git a/src/OpenTelemetry.ClrProfiler.Managed/Configuration/EnvironmentConfigurationHelper.cs b/src/OpenTelemetry.ClrProfiler.Managed/Configuration/EnvironmentConfigurationHelper.cs index 4d5abeb8f7..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; @@ -75,16 +73,13 @@ 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: break; default: - throw new ArgumentOutOfRangeException("The exporter name is not recognised"); + throw new ArgumentOutOfRangeException("The exporter name is not recognized"); } return builder; 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;