- 필수 기능
- 시작하기
- Glossary
- 표준 속성
- Guides
- Agent
- 통합
- 개방형텔레메트리
- 개발자
- API
- Datadog Mobile App
- CoScreen
- Cloudcraft
- 앱 내
- 서비스 관리
- 인프라스트럭처
- 애플리케이션 성능
- APM
- Continuous Profiler
- 스팬 시각화
- 데이터 스트림 모니터링
- 데이터 작업 모니터링
- 디지털 경험
- 소프트웨어 제공
- 보안
- AI Observability
- 로그 관리
- 관리
serverless-init
, see Instrument Azure App Service - Linux Container with serverless-init.This instrumentation method uses Azure’s Sidecar pattern to monitor containerized Linux Azure App Service workloads.
Add the following lines to the Dockerfile for your main application:
RUN mkdir -p /datadog/tracer
RUN mkdir -p /home/LogFiles/dotnet
ADD https://github.com/DataDog/dd-trace-dotnet/releases/download/v2.51.0/datadog-dotnet-apm-2.49.0.tar.gz /datadog/tracer
RUN cd /datadog/tracer && tar -zxf datadog-dotnet-apm-2.49.0.tar.gz
This installs and configures the Datadog tracer within your application container.
Build the image and push it to your preferred container registry.
# Stage 1: Build the application
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
WORKDIR /app
# Copy the project file and restore dependencies
COPY *.csproj ./
RUN dotnet restore
# Copy the remaining source code
COPY . .
# Build the application
RUN dotnet publish -c Release -o out
# Stage 2: Create a runtime image
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS runtime
WORKDIR /app
# Copy the build output from stage 1
COPY --from=build /app/out ./
# Datadog specific
RUN mkdir -p /datadog/tracer
RUN mkdir -p /home/LogFiles/dotnet
ADD https://github.com/DataDog/dd-trace-dotnet/releases/download/v2.49.0/datadog-dotnet-apm-2.49.0.tar.gz /datadog/tracer
RUN cd /datadog/tracer && tar -zxf datadog-dotnet-apm-2.49.0.tar.gz
# Set the entry point for the application
ENTRYPOINT ["dotnet", "<your dotnet app>.dll"]
In the Azure portal, select your app.
In the left menu, select Configuration > Application settings.
Add the following environment variables as application settings.
DD_API_KEY
(Required)DD_SITE
datadoghq.com
.DD_SERVICE
DD_ENV
staging
or prod
. See Unified Service Tagging.DD_SERVERLESS_LOG_PATH
/home/Logfile/*.log
DD_DOTNET_TRACER_HOME
(Required)/datadog/tracer
DD_TRACE_LOG_DIRECTORY
(Required)/home/Logfiles/dotnet
CORECLR_ENABLE_PROFILING
(Required)1
CORECLR_PROFILER
(Required){846F5F1C-F9AE-4B07-969E-05C26BC060D8}
CORECLR_PROFILER_PATH
(Required)/datadog/tracer/Datadog.Trace.ClrProfiler.Native.so
datadog
Docker Hub
or another registrysitecontainerssampleacr.azurecr.io
datadog-dotnet:2.0
8126
After you finish instrumenting your application, go to the Serverless > Azure page in Datadog to see your observability data. Your application logs are available in Log Explorer, and your traces are available in Trace Explorer.