- 필수 기능
- 시작하기
- Glossary
- 표준 속성
- Guides
- Agent
- 통합
- 개방형텔레메트리
- 개발자
- Administrator's Guide
- API
- Datadog Mobile App
- CoScreen
- Cloudcraft
- 앱 내
- 서비스 관리
- 인프라스트럭처
- 애플리케이션 성능
- APM
- Continuous Profiler
- 스팬 시각화
- 데이터 스트림 모니터링
- 데이터 작업 모니터링
- 디지털 경험
- 소프트웨어 제공
- 보안
- AI Observability
- 로그 관리
- 관리
",t};e.buildCustomizationMenuUi=t;function n(e){let t='
",t}function s(e){let n=e.filter.currentValue||e.filter.defaultValue,t='${e.filter.label}
`,e.filter.options.forEach(s=>{let o=s.id===n;t+=``}),t+="${e.filter.label}
`,t+=`This page describes how to instrument your Linux Azure App Service application with the Datadog Agent. The procedure on this page makes use of a sidecar container and Application Settings for Linux Azure App Service to instrument the application and manage its configuration.
If you would prefer to not use the sidecar approach (Not Recommended), you can instead follow the instructions to Instrument Azure App Service - Linux Code Deployment with the Datadog wrapper.
Supported runtimes: Java, Node.js, .NET, PHP, Python
If you haven’t already, install the Datadog-Azure integration to collect metrics and logs.
Install the tracing library for your language:
Java supports adding instrumentation code through the use of a command line argument, javaagent
.
azure-webapp-maven
plugin, you can add the Java tracing library as a resource entry with type lib
.JAVA_OPTS
with --javaagent:/home/site/lib/dd-java-agent.jar
. When your application is deployed, the Java tracer is copied to /home/site/lib/dd-java-agent.jar
.Instrumentation starts when the application is launched.
ddtrace
package to your project using your package manager.NODE_OPTIONS
with --require=dd-trace/init
const tracer = require('dd-trace').init({ logInjection: true, });
Add the Datadog.Trace.Bundle
Nuget package to your project. See the Nuget package page for more details.
For example:
dotnet add package Datadog.Trace.Bundle --version 3.21.0
Run the following script to install Datadog’s PHP tracing library: startup.sh:
#!/usr/bin/env bash
echo "Setting up Datadog tracing for PHP"
DD_PHP_TRACER_VERSION=1.8.3
DD_PHP_TRACER_URL=https://github.com/DataDog/dd-trace-php/releases/download/${DD_PHP_TRACER_VERSION}/datadog-setup.php
echo "Installing PHP tracer from ${DD_PHP_TRACER_URL}"
if curl -LO --fail "${DD_PHP_TRACER_URL}"; then
eval "php datadog-setup.php --php-bin=all"
else
echo "Downloading the tracer was unsuccessful"
return
fi
# This line is can be uncommented if the project contains an nginx configuration in the project root
# cp /home/site/wwwroot/default /etc/nginx/sites-available/default && service nginx reload
service nginx reload
This bash script is intended to run as the startup command, which installs the tracing module into PHP and then restarts the NGINX service.
Add ddtrace
to your project.
Modify your startup command. Your new command should run ddtrace-run
with your old command as an argument. That is: if your startup command is foo
, modify it to run ddtrace-run foo
.
For example:
ddtrace-run gunicorn --bind=0.0.0.0 --timeout 600 quickstartproject.wsgi
First, install the Datadog CLI and Azure CLI.
Login to your Azure account using the Azure CLI:
az login
Then, run the following command to set up the sidecar container:
export DD_API_KEY=<DATADOG_API_KEY>
export DD_SITE=<DATADOG_SITE>
datadog-ci aas instrument -s <subscription-id> -g <resource-group-name> -n <app-service-name>
Set your Datadog site to . Defaults to
datadoghq.com
.
Additional flags, like --service
and --env
, can be used to set the service and environment tags. For a full list of options, run datadog-ci aas instrument --help
.
DD_API_KEY
DD_SITE
datadoghq.com
.DD_SERVICE
package.json
.service
tag.DD_ENV
env
tag.DD_VERSION
version
tag.DD_SERVERLESS_LOG_PATH
/home/LogFiles/*.log
or /home/LogFiles/myapp/*.log
.DD_AAS_INSTANCE_LOGGING_ENABLED
true
, log collection is automatically configured for the additional file path: /home/LogFiles/*$COMPUTERNAME*.log
$COMPUTERNAME
variable. This ensures that log tailing does not create duplicate logs from multiple instances that are reading the same file. Enabling this feature variable also prevents DD_SERVERLESS_LOG_PATH
from being set. This is to prevent ingesting duplicate logs.WEBSITES_ENABLE_APP_SERVICE_STORAGE
true
true
allows the /home/
mount to persist and be shared with the sidecar.For .NET applications, the following environment variables are required. See the Datadog.Tracer.Bundle
Nuget package README file for more details.
DD_DOTNET_TRACER_HOME
/home/site/wwwroot/datadog
DD_TRACE_LOG_DIRECTORY
/home/LogFiles/dotnet
CORECLR_ENABLE_PROFILING
1
CORECLR_PROFILER
{846F5F1C-F9AE-4B07-969E-05C26BC060D8}
CORECLR_PROFILER_PATH
/home/site/wwwroot/datadog/
linux-x64/Datadog.Trace.ClrProfiler.Native.so
(single line)Configure a sidecar container for Datadog.
index.docker.io
datadog/serverless-init:latest
Restart your application.
If you modified a startup command, restart your application. Azure automatically restarts the application when new Application Settings are saved.
After your application restarts, go to Datadog’s APM Service page and search for the service name you set for your application (DD_SERVICE
).
To configure your application to submit custom metrics, follow the appropriate steps for your runtime:
To enable the Continuous Profiler, set the environment variable DD_PROFILING_ENABLED=true
. For more information, see the Continuous Profiler documentation.
Datadog 계측을 제로 다운타임으로 업데이트하려면 배포 슬롯을 사용합니다. Azure CLI용 GitHub Action을 활용하는 워크플로우를 생성할 수 있습니다.
샘플 GitHub 워크플로우를 참조하세요.
If you are not receiving traces or custom metric data as expected, enable agent debug logging by setting DD_LOG_LEVEL
in the sidecar configuration options. For tracer debugging set DD_TRACE_DEBUG
to true. This generates logs additional debug logs for the sidecar and tracing library.
Be sure to enable App Service logs to receive debugging logs.
Share the content of the Log stream with Datadog Support.
추가 유용한 문서, 링크 및 기사: