Skip to content

feat(stream): expose OTLP base URL on source API response (Phase 3)#2596

Closed
jordanrburger wants to merge 1 commit into
feat/stream-otlp-logs-phase1from
feat/stream-otlp-phase3-source-url
Closed

feat(stream): expose OTLP base URL on source API response (Phase 3)#2596
jordanrburger wants to merge 1 commit into
feat/stream-otlp-logs-phase1from
feat/stream-otlp-phase3-source-url

Conversation

@jordanrburger
Copy link
Copy Markdown

Stacked on top of #2595. Targets feat/stream-otlp-logs-phase1; rebase to main after that merges.

Summary

Surfaces the OTLP/HTTP endpoint URL alongside the existing stream URL on every source API response so the UI can display it without reconstructing it client-side. Closes the "Phase 3" backend scope from the design doc — the remaining Phase 3 items (one-click UI button, column-mapping JSON templates, quickstart docs) live in keboola-ui and the docs repos, not here.

Changes

  • Source.FormatOTLPSourceURL(publicURL) — mirrors FormatHTTPSourceURL but with the /otlp/ path prefix. Returns the base URL only; the OTel SDK appends /v1/logs, /v1/metrics, /v1/traces itself when given OTEL_EXPORTER_OTLP_ENDPOINT.
  • api.HTTPSource.OtlpURL field in the Goa design — regenerated server stubs, OpenAPI v3 / v2 JSON / YAML.
  • mapper.NewSourceResponse and mapper.NewAggregationSourceResponse populate the new field.
  • 15 E2E response fixtures updated to include otlpUrl alongside url inside their http blocks.

Example

$ curl https://stream.keboola.com/v1/branches/123/sources/my-source
{
  ...
  \"http\": {
    \"url\":     \"https://stream-in.keboola.com/stream/12345/my-source/abc...\",
    \"otlpUrl\": \"https://stream-in.keboola.com/otlp/12345/my-source/abc...\"
  },
  ...
}

User then sets one env var and any OTel SDK works:

export OTEL_EXPORTER_OTLP_ENDPOINT=https://stream-in.keboola.com/otlp/12345/my-source/abc...

Test plan

  • go build ./internal/pkg/service/stream/... passes
  • go vet clean
  • Unit test for FormatOTLPSourceURL (canonical case, trailing-slash normalization, invalid-URL error path)
  • E2E tests against API in CI (existing test suite — fixtures updated, mapper change wired through)
  • Manual smoke: create a source via API, confirm both fields appear in the response

Out of scope

  • One-click "Create OTel Source" wizard in the Keboola UI (separate repo)
  • Pre-built column-mapping JSON templates for otel_logs / otel_metrics / otel_traces (no Stream-side template system to land them in; better delivered as docs or UI fixtures)
  • Quickstart guide / column mapping reference docs (docs repo)

🤖 Generated with Claude Code

Adds Source.FormatOTLPSourceURL, mirroring FormatHTTPSourceURL but with
the /otlp/ path prefix. The OTel SDK appends /v1/logs, /v1/metrics, and
/v1/traces to the OTEL_EXPORTER_OTLP_ENDPOINT base URL automatically, so
this method returns the base only.

Exposes the URL as otlpUrl on api.HTTPSource. UI surfaces (source detail
pages, source lists, aggregation views) can now display the OTLP endpoint
next to the existing stream URL without having to construct it.

Updates the Goa design, regenerated server stubs, OpenAPI definitions,
and the 15 E2E response fixtures that include the http source URL.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Matovidlo
Copy link
Copy Markdown
Contributor

closing in favor of #2598

@Matovidlo Matovidlo closed this May 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants