- 필수 기능
- 시작하기
- Glossary
- 표준 속성
- Guides
- Agent
- 통합
- 개방형텔레메트리
- 개발자
- Administrator's Guide
- API
- Datadog Mobile App
- CoScreen
- Cloudcraft
- 앱 내
- 서비스 관리
- 인프라스트럭처
- 애플리케이션 성능
- APM
- Continuous Profiler
- 스팬 시각화
- 데이터 스트림 모니터링
- 데이터 작업 모니터링
- 디지털 경험
- 소프트웨어 제공
- 보안
- AI Observability
- 로그 관리
- 관리
For a full list of Datadog’s Python version and framework support (including legacy and maintenance versions), read the Compatibility Requirements page.
Before you begin, make sure you’ve already installed and configured the Agent.
After you install and configure your Datadog Agent, the next step is to add the tracing library directly in the application to instrument it. Read more about compatibility information.
To begin tracing applications written in Python, install the Datadog Tracing library, ddtrace
, using pip:
pip install ddtrace
Note: This command requires pip version 18.0.0
or greater. For Ubuntu, Debian, or another package manager, update your pip version with the following command:
pip install --upgrade pip
Then to instrument your Python application use the included ddtrace-run
command. To use it, prefix your Python entry-point command with ddtrace-run
.
For example, if your application is started with python app.py
then:
ddtrace-run python app.py
Once you’ve finished setup and are running the tracer with your application, you can run ddtrace-run --info
to check that configurations are working as expected. Note that the output from this command does not reflect configuration changes made during runtime in code.
If needed, configure the tracing library to send application performance telemetry data as you require, including setting up Unified Service Tagging. Read Library Configuration for details.
The connection for traces can also be configured in code:
from ddtrace import tracer
# Network sockets
tracer.configure(
https=False,
hostname="custom-hostname",
port="1234",
)
# Unix domain socket configuration
tracer.configure(
uds_path="/var/run/datadog/apm.socket",
)
The connection for stats can also be configured in code:
from ddtrace import tracer
# Network socket
tracer.configure(
dogstatsd_url="udp://localhost:8125",
)
# Unix domain socket configuration
tracer.configure(
dogstatsd_url="unix:///var/run/datadog/dsd.socket",
)
If you are upgrading to ddtrace v1, review the upgrade guide and the release notes in the library documentation for full details.