Repository navigation
fix(AIC-3596): name the [otel] extra in the missing-OTel warning - #186
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dakotasanchez
approved these changes
Oct 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes AIC-3596.
Why
When the OpenTelemetry packages are missing,
init_client()logs a warning telling users to runpip install opentelemetry-sdk. That isn't enough. Telemetry also needsopentelemetry-exporter-otlp-proto-http, so someone who follows the hint gets the same warning again. The READMEs already give the right command,pip install "launchdarkly-ai-server[otel]", which installs both packages. This PR makes the warning match. The JS SDK is getting the same fix: its warning will point at@launchdarkly/ai-otel.Fix
packages/client/src/launchdarkly_ai_server/lifecycle.py: the warning now saysRun `pip install "launchdarkly-ai-server[otel]"` to enable telemetry.packages/client/tests/test_lifecycle.py:test_emits_warning_onceused to replace_setup_telemetrywith a stub that logged its own text, so it never checked the real message. It now forces the real import to fail (sys.modules["opentelemetry.sdk.trace"] = None) and checks that exactly one warning appears and that it contains the[otel]install command.Testing
assert 'pip install "launchdarkly-ai-server[otel]"' in 'OpenTelemetry packages not installed. Runpip install opentelemetry-sdkto enable telemetry.'make test: 2544 passed, 14 skipped.make typecheck: no issues in 75 source files.make lint: all checks passed.Related: launchdarkly/js-ai-sdk#144
🤖 Generated with Claude Code
Note
Overview
When OpenTelemetry isn’t installed,
init_clientnow tells users to runpip install "launchdarkly-ai-server[otel]"instead of onlyopentelemetry-sdk, so the hint matches the extra that pulls in the OTLP exporter as well.test_emits_warning_onceno longer stubs_setup_telemetrywith fake log text; it forces the real OTel import to fail and asserts a single warning that includes the[otel]install command.Reviewed by Cursor Bugbot for commit 3c06259. Bugbot is set up for automated code reviews on this repo. Configure here.