We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fc0beaa commit 82a943aCopy full SHA for 82a943a
datadog_lambda/wrapper.py
@@ -56,10 +56,16 @@
56
if profiling_env_var:
57
from ddtrace.profiling import profiler
58
59
+llmobs_api_key = None
60
llmobs_env_var = os.environ.get("DD_LLMOBS_ENABLED", "false").lower() in ("true", "1")
61
if llmobs_env_var:
62
+ from datadog_lambda.api import init_api
63
+ from datadog import api
64
from ddtrace.llmobs import LLMObs
65
66
+ init_api()
67
+ llmobs_api_key = api._api_key
68
+
69
logger = logging.getLogger(__name__)
70
71
DD_FLUSH_TO_LOG = "DD_FLUSH_TO_LOG"
@@ -229,7 +235,10 @@ def __init__(self, func):
229
235
230
236
# Enable LLM Observability
231
237
232
- LLMObs.enable()
238
+ LLMObs.enable(
239
+ agentless_enabled=True,
240
+ api_key=llmobs_api_key,
241
+ )
233
242
234
243
logger.debug("datadog_lambda_wrapper initialized")
244
except Exception as e:
0 commit comments