Problem
Current resolver treats any endpoint containing "/v1/" as a fully-qualified OTLP signal URL.
For backends like Opik (.../api/v1/private/otel), this prevents appending /v1/traces|metrics|logs, so exports go to wrong path. Discovered during testing on #12897 for #3201.
Current Behavior
- Endpoint:
https://www.comet.com/opik/api/v1/private/otel
- Resolver sees
/v1/ and returns it unchanged.
- Trace exporter posts to
/api/v1/private/otel instead of /api/v1/private/otel/v1/traces.
Expected Behavior
Base collector-like endpoints should append signal path:
/v1/traces
/v1/metrics
/v1/logs
Only skip append when endpoint is already signal-specific.
Proposed Fix
Replace endpoint.includes("/v1/") logic with strict path checks:
- if endpoint path ends with
/v1/traces|/v1/metrics|/v1/logs, keep as-is
- otherwise append requested signal path
Keep trailing slash normalization.
Optionally parse with new URL() when valid; fallback to string handling for non-URL inputs.
Problem
Current resolver treats any endpoint containing "/v1/" as a fully-qualified OTLP signal URL.
For backends like Opik (
.../api/v1/private/otel), this prevents appending/v1/traces|metrics|logs, so exports go to wrong path. Discovered during testing on #12897 for #3201.Current Behavior
https://www.comet.com/opik/api/v1/private/otel/v1/and returns it unchanged./api/v1/private/otelinstead of/api/v1/private/otel/v1/traces.Expected Behavior
Base collector-like endpoints should append signal path:
/v1/traces/v1/metrics/v1/logsOnly skip append when endpoint is already signal-specific.
Proposed Fix
Replace
endpoint.includes("/v1/")logic with strict path checks:/v1/traces|/v1/metrics|/v1/logs, keep as-isKeep trailing slash normalization.
Optionally parse with
new URL()when valid; fallback to string handling for non-URL inputs.