feat(stream): expose OTLP base URL on source API response (Phase 3)#2596
Closed
jordanrburger wants to merge 1 commit into
Closed
feat(stream): expose OTLP base URL on source API response (Phase 3)#2596jordanrburger wants to merge 1 commit into
jordanrburger wants to merge 1 commit into
Conversation
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>
6 tasks
Contributor
|
closing in favor of #2598 |
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.
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-uiand the docs repos, not here.Changes
Source.FormatOTLPSourceURL(publicURL)— mirrorsFormatHTTPSourceURLbut with the/otlp/path prefix. Returns the base URL only; the OTel SDK appends/v1/logs,/v1/metrics,/v1/tracesitself when givenOTEL_EXPORTER_OTLP_ENDPOINT.api.HTTPSource.OtlpURLfield in the Goa design — regenerated server stubs, OpenAPI v3 / v2 JSON / YAML.mapper.NewSourceResponseandmapper.NewAggregationSourceResponsepopulate the new field.otlpUrlalongsideurlinside theirhttpblocks.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/...passesgo vetcleanFormatOTLPSourceURL(canonical case, trailing-slash normalization, invalid-URL error path)Out of scope
otel_logs/otel_metrics/otel_traces(no Stream-side template system to land them in; better delivered as docs or UI fixtures)🤖 Generated with Claude Code