이 페이지는 아직 한국어로 제공되지 않으며 번역 작업 중입니다. 번역에 관한 질문이나 의견이 있으시면 언제든지 저희에게 연락해 주십시오.
Compatibility requirements
The latest Python Tracer supports CPython versions 2.7 and 3.5-3.11.
For a full list of Datadog’s Python version and framework support (including legacy and maintenance versions), read the Compatibility Requirements page.
Getting started
Before you begin, make sure you’ve already installed and configured the Agent.
Choose your instrumentation method
After you deploy or install and configure your Datadog Agent, the next step is to instrument your application. You can do this in the following ways, depending on the infrastructure your app runs on, the language it’s written in, and the level of configuration you require.
See the following pages for supported deployment scenarios and languages:
Instrument your application
If you are collecting traces from a Kubernetes application, as an alternative to the following instructions, you can inject the tracing library into your application using the Cluster Agent Admission Controller. Read
Injecting Libraries Using Admission Controller for instructions.
Once the agent is installed, to begin tracing applications written in Python, install the Datadog Tracing library, ddtrace
, using pip:
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.
Configuration
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",
)
Upgrading to v1
If you are upgrading to ddtrace v1, review the upgrade guide and the release notes in the library documentation for full details.
Further reading
Additional helpful documentation, links, and articles: