-
Hello everyone 👋 I'm using Signoz from docker-compose following base on their document and it up and running. And my plan is to use that service from my dotnet application which also running in docker with OpenTelementry auto instrument. Problem is OpenTelementry is not running and no service, log, metrics were found in Signoz UI even though all services are running well. Let me drop my Dockerfile and docker-compose file in here. # Use the same SDK version for all stages
FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base
WORKDIR /app
EXPOSE 80
# Install instrumentation in build stage (where SDK is available)
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
# Continue with build
WORKDIR /src
COPY ["BlazingPizzaDemo.csproj", "."]
RUN dotnet restore "./BlazingPizzaDemo.csproj"
COPY . .
RUN dotnet build "./BlazingPizzaDemo.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "./BlazingPizzaDemo.csproj" -c Release -o /app/publish /p:UseAppHost=false
# Final stage
FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS final
WORKDIR /app
COPY --from=publish /app/publish .
# Download and install instrumentation
RUN apt-get update && apt-get install -y zip curl
RUN mkdir /otel
RUN curl -L -o /otel/otel-dotnet-install.sh https://github.com/open-telemetry/opentelemetry-dotnet-instrumentation/releases/download/v1.11.0/otel-dotnet-auto-install.sh
RUN chmod +x /otel/otel-dotnet-install.sh
ENV OTEL_DOTNET_AUTO_HOME=/otel
RUN /bin/bash /otel/otel-dotnet-install.sh
RUN chmod +x /otel/instrument.sh
ENTRYPOINT ["/bin/bash", "-c", "source /otel/instrument.sh && dotnet BlazingPizzaDemo.dll"] version: '3.8'
services:
blazingpizzademo:
build:
context: .
dockerfile: Dockerfile
# entrypoint: ["dotnet", "BlazingPizzaDemo.dll", "--urls", "http://0.0.0.0:5000"]
ports:
- "5000:80"
environment:
- OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318
- OTEL_SERVICE_NAME=BlazingPizzaDemoLocal
- OTEL_TRACES_EXPORTER=otlp
- OTEL_METRICS_EXPORTER=otlp
- OTEL_LOGS_EXPORTER=otlp
- CORECLR_PROFILER='{918728DD-259F-4A6A-AC2B-B85E1B658318}'
- OTEL_DOTNET_AUTO_HOME=/otel-dotnet-auto
- DOTNET_STARTUP_HOOKS=/otel-dotnet-auto/net/OpenTelemetry.AutoInstrumentation.StartupHook.dll
- DOTNET_ADDITIONAL_DEPS=/otel-dotnet-auto/AdditionalDeps
- DOTNET_SHARED_STORE=/otel-dotnet-auto/store
- CORECLR_PROFILER_PATH=/otel-dotnet-auto/linux-x64/OpenTelemetry.AutoInstrumentation.Native.so
- OTEL_DOTNET_AUTO_TRACES_INSTRUMENTATION_ENABLED=HttpClient,AspNetCore,SqlClient
networks:
- signoz-net
networks:
signoz-net:
external: true |
Beta Was this translation helpful? Give feedback.
Answered by
RassK
May 29, 2025
Replies: 1 comment
-
Hello, I'm noticing a few errors:
So:
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
hoesein
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
I'm noticing a few errors:
So:
RUN OTEL_DOTNET_AUTO_HOME=/otel-dotnet-auto/ /bin/bash /otel/otel-dotnet-install.sh