Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure ./run-example.sh adds bytecode instr. #1383

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dev/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions dev/envvars.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand All @@ -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}
13 changes: 5 additions & 8 deletions dev/otel-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,6 @@ receivers:
protocols:
grpc:
http:
jaeger:
protocols:
grpc:
thrift_binary:
thrift_compact:
thrift_http:
zipkin:

processors:
batch:
Expand All @@ -32,11 +25,15 @@ exporters:
service:
pipelines:
traces:
receivers: [otlp, jaeger, zipkin]
receivers: [otlp]
processors: [batch]
exporters: [jaeger, logging]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Jaeger supports OTLP by default. We should be able to drop jaeger protocol here.

Probably separate PR. Ref: https://www.jaegertracing.io/docs/1.38/apis/#opentelemetry-protocol-stable

metrics:
receivers: [otlp]
processors: [batch]
exporters: [prometheus, logging]
logs:
receivers: [otlp]
processors: [batch]
exporters: [logging]
extensions: [health_check, zpages]
11 changes: 3 additions & 8 deletions run-example.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
{
Expand Down