add ddtrace
This commit is contained in:
parent
38d0244793
commit
df1a381909
@ -1,6 +1,7 @@
|
||||
import os
|
||||
import time
|
||||
from datadog import initialize, api
|
||||
from ddtrace import tracer
|
||||
|
||||
class Metrics:
|
||||
send_metrics = False
|
||||
@ -11,6 +12,12 @@ class Metrics:
|
||||
Metrics.send_metrics = True
|
||||
initialize()
|
||||
api.Event.create(title="Backend start", text="", tags=["server:backend", f"host:{os.environ['HOST']}"], alert_type="info")
|
||||
if "DD_TRACE_AGENT_HOST" in os.environ and "DD_TRACE_AGENT_PORT" in os.environ:
|
||||
tracer.configure(
|
||||
https=False,
|
||||
hostname=os.environ["DD_TRACE_AGENT_HOST"],
|
||||
port=os.environ["DD_TRACE_AGENT_PORT"],
|
||||
)
|
||||
else:
|
||||
print("Datadog not configured")
|
||||
|
||||
|
@ -8,4 +8,5 @@ six==1.16.0
|
||||
pytest==7.1.1
|
||||
requests==2.27.1
|
||||
discord-webhook==0.15.0
|
||||
datadog==0.44.0
|
||||
datadog==0.44.0
|
||||
ddtrace==0.60.1
|
Loading…
Reference in New Issue
Block a user