We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bd285f4 commit 2884d9cCopy full SHA for 2884d9c
trace.py
@@ -0,0 +1,13 @@
1
+import os
2
+
3
+from ddtrace import patch_all, tracer
4
5
6
+def patch():
7
+ """设置 datadog tracer,需要保证环境内有 DD_AGENT_HOST、DD_TRACE_AGENT_PORT 环境变量"""
8
+ patch_all()
9
+ if os.environ.get("DD_AGENT_HOST", None) and os.environ.get("DD_TRACE_AGENT_PORT", None):
10
+ tracer.configure(hostname=os.environ['DD_AGENT_HOST'],
11
+ port=os.environ['DD_TRACE_AGENT_PORT'])
12
+ else:
13
+ print("WARNING: or DD_TRACE_AGENT_PORT not set, ignore configuring datadog tracer.")
0 commit comments