diff --git a/dev/docker-compose.yaml b/dev/docker-compose.yaml index f7c56f77f8..40fb43185b 100644 --- a/dev/docker-compose.yaml +++ b/dev/docker-compose.yaml @@ -15,7 +15,7 @@ services: - "9090:9090" otel-collector: - image: otel/opentelemetry-collector-contrib:0.57.2 + image: otel/opentelemetry-collector-contrib:0.61.0 volumes: - ./otel-config.yaml:/etc/otel/config.yaml command: --config /etc/otel/config.yaml diff --git a/dev/envvars.sh b/dev/envvars.sh index 797e7d1bb0..6f0c0f5d1c 100644 --- a/dev/envvars.sh +++ b/dev/envvars.sh @@ -34,11 +34,11 @@ OS=$(uname_os) ENABLE_PROFILING=${ENABLE_PROFILING:-1} # Enable .NET Framework Profiling API -export COR_ENABLE_PROFILING="${ENABLE_PROFILING}" -export COR_PROFILER="{918728DD-259F-4A6A-AC2B-B85E1B658318}" -export COR_PROFILER_PATH="${CURDIR}/bin/tracer-home/OpenTelemetry.AutoInstrumentation.Native.${SUFIX}" if [ "$OS" == "windows" ] then + export COR_ENABLE_PROFILING="${ENABLE_PROFILING}" + export COR_PROFILER="{918728DD-259F-4A6A-AC2B-B85E1B658318}" + export COR_PROFILER_PATH="${CURDIR}/bin/tracer-home/OpenTelemetry.AutoInstrumentation.Native.${SUFIX}" # Set paths for both bitness on Windows, see https://docs.microsoft.com/en-us/dotnet/core/run-time-config/debugging-profiling#profiler-location export COR_PROFILER_PATH_64="${CURDIR}/bin/tracer-home/win-x64/OpenTelemetry.AutoInstrumentation.Native.${SUFIX}" export COR_PROFILER_PATH_32="${CURDIR}/bin/tracer-home/win-x86/OpenTelemetry.AutoInstrumentation.Native.${SUFIX}" @@ -65,8 +65,8 @@ export OTEL_DOTNET_AUTO_HOME="${CURDIR}/bin/tracer-home" export OTEL_DOTNET_AUTO_INTEGRATIONS_FILE="${CURDIR}/bin/tracer-home/integrations.json" export OTEL_DOTNET_AUTO_DEBUG="1" export OTEL_DOTNET_AUTO_DUMP_ILREWRITE_ENABLED="0" -export OTEL_DOTNET_AUTO_EXCLUDE_PROCESSES="dotnet.exe,dotnet" +export OTEL_DOTNET_AUTO_EXCLUDE_PROCESSES=${OTEL_DOTNET_AUTO_EXCLUDE_PROCESSES:-dotnet.exe,dotnet} # Enable console exporters -export OTEL_DOTNET_AUTO_TRACES_CONSOLE_EXPORTER_ENABLED="true" -export OTEL_DOTNET_AUTO_METRICS_CONSOLE_EXPORTER_ENABLED="true" +export OTEL_DOTNET_AUTO_TRACES_CONSOLE_EXPORTER_ENABLED=${OTEL_DOTNET_AUTO_TRACES_CONSOLE_EXPORTER_ENABLED:-true} +export OTEL_DOTNET_AUTO_METRICS_CONSOLE_EXPORTER_ENABLED=${OTEL_DOTNET_AUTO_METRICS_CONSOLE_EXPORTER_ENABLED:-true} diff --git a/dev/otel-config.yaml b/dev/otel-config.yaml index 35f0cc8bc2..d87c77d01b 100644 --- a/dev/otel-config.yaml +++ b/dev/otel-config.yaml @@ -8,13 +8,6 @@ receivers: protocols: grpc: http: - jaeger: - protocols: - grpc: - thrift_binary: - thrift_compact: - thrift_http: - zipkin: processors: batch: @@ -32,11 +25,15 @@ exporters: service: pipelines: traces: - receivers: [otlp, jaeger, zipkin] + receivers: [otlp] processors: [batch] exporters: [jaeger, logging] metrics: receivers: [otlp] processors: [batch] exporters: [prometheus, logging] + logs: + receivers: [otlp] + processors: [batch] + exporters: [logging] extensions: [health_check, zpages] diff --git a/run-example.sh b/run-example.sh index 50c6d41beb..e1b40302ff 100644 --- a/run-example.sh +++ b/run-example.sh @@ -12,15 +12,10 @@ keepContainers=${keepContainers:-false} # Defaults for selected dotnet CLI commands. configuration=${configuration:-Release} aspNetAppTargetFramework=${aspNetAppTargetFramework:-netcoreapp3.1} +vendorPluginTargetFramework=${aspNetAppTargetFramework} exampleAppTargetFramework=${exampleAppTargetFramework:-netcoreapp3.1} exampleApp=${exampleApp:-ConsoleApp} -if [[ $aspNetAppTargetFramework == net462 ]]; -then - vendorPluginTargetFramework=${exampleAppTargetFramework:-net462} -else - vendorPluginTargetFramework=${exampleAppTargetFramework:-netcoreapp3.1} -fi # Handle the differences between launching a dll and exe exampleAppExt="dll" @@ -60,12 +55,12 @@ docker-compose -f ./dev/docker-compose.yaml -f ./examples/docker-compose.yaml up # instrument and run HTTP server app in background export OTEL_DOTNET_AUTO_PLUGINS="Examples.AspNetCoreMvc.OtelSdkPlugin, Examples.AspNetCoreMvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null:Examples.Vendor.Distro.Plugin, Examples.Vendor.Distro, Version=0.0.1.0, Culture=neutral, PublicKeyToken=null" -ENABLE_PROFILING=${enableProfiling} OTEL_DOTNET_AUTO_METRICS_ADDITIONAL_SOURCES="MyCompany.MyProduct.MyLibrary" OTEL_SERVICE_NAME="aspnet-server" OTEL_TRACES_EXPORTER=${tracesExporter} OTEL_METRICS_EXPORTER=${metricsExporter} ./dev/instrument.sh ASPNETCORE_URLS="http://127.0.0.1:8080/" dotnet ./examples/AspNetCoreMvc/bin/${configuration}/${aspNetAppTargetFramework}/Examples.AspNetCoreMvc.dll & +ENABLE_PROFILING=${enableProfiling} OTEL_DOTNET_AUTO_METRICS_ADDITIONAL_SOURCES="MyCompany.MyProduct.MyLibrary" OTEL_SERVICE_NAME="aspnet-server" OTEL_TRACES_EXPORTER=${tracesExporter} OTEL_METRICS_EXPORTER=${metricsExporter} OTEL_DOTNET_AUTO_EXCLUDE_PROCESSES=none ./dev/instrument.sh ASPNETCORE_URLS="http://127.0.0.1:8080/" dotnet ./examples/AspNetCoreMvc/bin/${configuration}/${aspNetAppTargetFramework}/Examples.AspNetCoreMvc.dll & unset OTEL_DOTNET_AUTO_PLUGINS ./dev/wait-local-port.sh 8080 # instrument and run HTTP client app -ENABLE_PROFILING=${enableProfiling} OTEL_SERVICE_NAME=${exampleApp} OTEL_TRACES_EXPORTER=${tracesExporter} OTEL_DOTNET_AUTO_LOAD_TRACER_AT_STARTUP=${exampleAppInjectSDK} ./dev/instrument.sh $exampleAppDotnetCli ./examples/${exampleApp}/bin/$configuration/${exampleAppTargetFramework}/Examples.${exampleApp}.${exampleAppExt} +ENABLE_PROFILING=${enableProfiling} OTEL_SERVICE_NAME=${exampleApp} OTEL_TRACES_EXPORTER=${tracesExporter} OTEL_DOTNET_AUTO_LOAD_TRACER_AT_STARTUP=${exampleAppInjectSDK} OTEL_DOTNET_AUTO_EXCLUDE_PROCESSES=none ./dev/instrument.sh $exampleAppDotnetCli ./examples/${exampleApp}/bin/$configuration/${exampleAppTargetFramework}/Examples.${exampleApp}.${exampleAppExt} # verify if it works {