Enable LLM Observability with agentless_enabled=True by default with a parsed API key #572
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Enables LLM Observability with
agentless_enabled=Trueto ensure seamless compatibility with the agent used in the DD Extension layer. Previously, LLM Observability would try and use an agent proxy endpoint which doesn't exist on the trace agent used in thenextversion of the DD Extension layer.Since all we really use the proxy for outside of serverless is so that users don't have to re-state their API key, it should be fine to just use agentless for serverless environments by default (as LLM Observability now also still sends APM traces even if
agentless_enabled=Trueis set).To help enable this, I added a call to
init_apito get theDD_API_KEYfrom the secrets manager if it lives there, to make the experience even smoother. Otherwise, we can enforceDD_API_KEYin the lambda function's env varsMotivation
MLOB-2225
Testing Guidelines
Built the layer with the
build_layersscript, and verified against our LLM Observability lambda functions with onlyDD_LLMOBS_ENABLEDDD_LLMOBS_ML_APPDD_API_KEYset, and verified traces showed up in the UI.
Additional Notes
Happy to remove the
init_apipart if it would be too much of a burden on the code path for a serverless env. I saw it was available, and only used for metrics, but decided to re-use. It can be revisited later if needed and we can enforceDD_API_KEYbeing set directly instead.Types of Changes
Check all that apply