fix(otel): preserve Splunk Observability Cloud trace OTLP endpoint - #26183
Conversation
Splunk ingest uses /v2/trace/otlp; _normalize_otel_endpoint must not append /v1/traces. - Return trace endpoints unchanged when they match Splunk OTLP path patterns - Add unit tests for observability.splunkcloud.com, signalfx.com, and /trace/otlp suffix - Set OTEL_EXPORTER_OTLP_PROTOCOL in protocol selection tests (from_env precedence over OTEL_EXPORTER) Made-with: Cursor
Made-with: Cursor
Greptile SummaryThis PR fixes a bug in Confidence Score: 5/5Safe to merge — targeted bug fix with no backwards-incompatible changes and full test coverage for the new code paths. The guard is minimal and correctly scoped: it only fires for No files require special attention.
|
| Filename | Overview |
|---|---|
| litellm/integrations/opentelemetry.py | Four-line guard added to _normalize_otel_endpoint to skip rewriting when the endpoint contains /v2/trace/otlp; fix is correctly placed after the trailing-slash strip and before the standard path logic. |
| tests/test_litellm/integrations/test_opentelemetry.py | Adds parameterized tests for Splunk/SignalFx OTLP URLs; existing protocol tests updated to use OTEL_EXPORTER_OTLP_PROTOCOL for determinism; new fallback tests added to preserve OTEL_EXPORTER regression coverage. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["_normalize_otel_endpoint(endpoint, signal_type)"] --> B{signal_type valid?}
B -- No --> C[Return endpoint unchanged]
B -- Yes --> D[Strip trailing slash]
D --> E{traces signal AND\ncontains /v2/trace/otlp?}
E -- Yes --> F[Return endpoint unchanged\nSplunk OTLP path preserved]
E -- No --> G{Already ends with\n/v1/signal_type?}
G -- Yes --> H[Return endpoint]
G -- No --> I{Ends with another\n/v1/signal path?}
I -- Yes --> J[Replace signal segment and return]
I -- No --> K[Append /v1/signal_type and return]
Reviews (3): Last reviewed commit: "test(otel): cover OTEL_EXPORTER fallback..." | Re-trigger Greptile
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Made-with: Cursor
Made-with: Cursor
* fix(otel): preserve Splunk Observability Cloud trace OTLP endpoint (#26183) * fix(otel): preserve Splunk Observability Cloud trace OTLP URL Splunk ingest uses /v2/trace/otlp; _normalize_otel_endpoint must not append /v1/traces. - Return trace endpoints unchanged when they match Splunk OTLP path patterns - Add unit tests for observability.splunkcloud.com, signalfx.com, and /trace/otlp suffix - Set OTEL_EXPORTER_OTLP_PROTOCOL in protocol selection tests (from_env precedence over OTEL_EXPORTER) Made-with: Cursor * test(otel): use parameterized.expand for Splunk OTLP URL cases Made-with: Cursor * fix(otel): narrow Splunk trace URL guard to /v2/trace/otlp only Made-with: Cursor * test(otel): cover OTEL_EXPORTER fallback when OTLP protocol env unset Made-with: Cursor * Add Openrouter Opus 4.7 Entry (#26130) --------- Co-authored-by: milan-berri <milan@berri.ai> Co-authored-by: Matt Greathouse <matt5316@gmail.com>
* fix(otel): preserve Splunk Observability Cloud trace OTLP endpoint (BerriAI#26183) * fix(otel): preserve Splunk Observability Cloud trace OTLP URL Splunk ingest uses /v2/trace/otlp; _normalize_otel_endpoint must not append /v1/traces. - Return trace endpoints unchanged when they match Splunk OTLP path patterns - Add unit tests for observability.splunkcloud.com, signalfx.com, and /trace/otlp suffix - Set OTEL_EXPORTER_OTLP_PROTOCOL in protocol selection tests (from_env precedence over OTEL_EXPORTER) Made-with: Cursor * test(otel): use parameterized.expand for Splunk OTLP URL cases Made-with: Cursor * fix(otel): narrow Splunk trace URL guard to /v2/trace/otlp only Made-with: Cursor * test(otel): cover OTEL_EXPORTER fallback when OTLP protocol env unset Made-with: Cursor * Add Openrouter Opus 4.7 Entry (BerriAI#26130) --------- Co-authored-by: milan-berri <milan@berri.ai> Co-authored-by: Matt Greathouse <matt5316@gmail.com>
Splunk ingest uses /v2/trace/otlp; _normalize_otel_endpoint must not append /v1/traces.
Relevant issues
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
tests/test_litellm/directory, Adding at least 1 test is a hard requirement - see detailsmake test-unit@greptileaiand received a Confidence Score of at least 4/5 before requesting a maintainer reviewCI (LiteLLM team)
Branch creation CI run
Link:
CI run for the last commit
Link:
Merge / cherry-pick CI run
Links:
Screenshots / Proof of Fix
Type
🐛 Bug Fix
✅ Test
Changes
Changes