Step 1: Add the below lines in Docker file next to base image.
ADD https://s3.amazonaws.com/ARC_PUBLIC/dotnet-agent.sh dotnet-agent.sh
RUN apt-get update && apt-get install -y unzip && OTEL_DOTNET_AUTO_HOME="/otel-dotnet-auto" sh dotnet-agent.sh
Sample Dockerfile
Step 2: Add the following environment variables to your YAML file
OTEL_SERVICE_NAME="<AGENT_NAME>"
OTEL_EXPORTER_OTLP_ENDPOINT="http://<APPLICARE_CONTROLLER_IP>:4318"
CORECLR_ENABLE_PROFILING="1"
OTEL_DOTNET_AUTO_ENABLED="1"
CORECLR_PROFILER="{918728DD-259F-4A6A-AC2B-B85E1B658318}"
CORECLR_PROFILER_PATH="/otel-dotnet-auto/OpenTelemetry.AutoInstrumentation.Native.so"
DOTNET_ADDITIONAL_DEPS="/otel-dotnet-auto/AdditionalDeps"
DOTNET_SHARED_STORE="/otel-dotnet-auto/store"
DOTNET_STARTUP_HOOKS="/otel-dotnet-auto/netcoreapp3.1/OpenTelemetry.AutoInstrumentation.StartupHook.dll"
OTEL_DOTNET_AUTO_HOME="/otel-dotnet-auto"
OTEL_DOTNET_AUTO_LOAD_METER_AT_STARTUP="false"
Replace <AGENT_NAME> with a unique name to identify your application.
Replace <APPLICARE_CONTROLLER_IP> with the IP address of the Application Controller.
Sample YAML file
Step 3: After applying the above changes, build the new Docker image and start the container.
Comments
0 comments
Please sign in to leave a comment.