Skip to content

tracing: append the OTLP signal path to a path-less endpoint - #1001

Merged
mzihlmann merged 1 commit into
mainfrom
otlp-endpoint-signal-path
Aug 12, 2026
Merged

tracing: append the OTLP signal path to a path-less endpoint#1001
mzihlmann merged 1 commit into
mainfrom
otlp-endpoint-signal-path

Conversation

@mzihlmann

@mzihlmann mzihlmann commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

otlptracehttp 1.45.0 changed WithEndpointURL: a URL with no path now targets the root path instead of having /v1/traces appended. Upstream calls this out as a breaking change (open-telemetry/opentelemetry-go#8538), aligning it with otlploghttp and with OTEL_EXPORTER_OTLP_TRACES_ENDPOINT.

We document KANIKO_TELEMETRY_ENDPOINT as a collector base URL (README.md, docs/telemetry.md), so every path-less endpoint started POSTing to / and getting a 404. Nothing failed: the export error only reaches OTel's global error handler, never logrus, so builds kept passing while emitting no traces. Our own CI stopped delivering spans the moment #996 merged and nobody noticed for 11 hours.

Appending the path only when the endpoint carries none keeps both forms working, so an endpoint that already ends in /v1/traces is not doubled.

Verified end-to-end against a real collector + ClickHouse, with a build run through the executor:

KANIKO_TELEMETRY_ENDPOINT before after
http://host:4318 404 Not Found, 0 spans 9 spans, root span present
http://host:4318/v1/traces 9 spans 9 spans

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Improved OTLP tracing endpoint handling by automatically appending the required /v1/traces path when no specific path is provided.
    • Preserved existing custom endpoint paths.

@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: fb6e7462-9b6c-4cd5-bc58-a63d9706054f

📥 Commits

Reviewing files that changed from the base of the PR and between dc9a0e2 and aadbf8a.

📒 Files selected for processing (1)
  • pkg/tracing/tracing.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • pkg/tracing/tracing.go

📝 Walkthrough

Walkthrough

Tracing initialization now normalizes OTLP endpoints before exporter creation. It appends /v1/traces to endpoints with no path or only /. Other paths and invalid URLs remain unchanged.

Changes

OTLP endpoint normalization

Layer / File(s) Summary
Normalize OTLP trace endpoint
pkg/tracing/tracing.go
The tracing setup parses the OTLP endpoint, appends /v1/traces for empty or root paths, and passes the normalized endpoint to the exporter. Other paths and invalid URLs preserve the original endpoint.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: appending the OTLP signal path to path-less endpoints.
Description check ✅ Passed The description explains the problem, solution, impact, and end-to-end verification with concrete results.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch otlp-endpoint-signal-path

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@mzihlmann mzihlmann added the regression Behavior that worked in a prior release and broke label Aug 12, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
pkg/tracing/tracing.go (1)

85-88: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Add or verify regression tests for endpoint normalization.

Cover path-less endpoints, /, /v1/traces, another explicit path, and parse failures. Assert the endpoint behavior before exporter creation. This protects the compatibility contract across future exporter or URL-parsing changes.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pkg/tracing/tracing.go` around lines 85 - 88, Add or verify regression tests
around the endpoint normalization logic before exporter creation, covering
path-less endpoints, "/", "/v1/traces", another explicit path, and URL parse
failures. Assert that only path-less or root endpoints receive "/v1/traces",
while explicit paths and parse failures preserve the existing endpoint behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@pkg/tracing/tracing.go`:
- Around line 85-88: Add or verify regression tests around the endpoint
normalization logic before exporter creation, covering path-less endpoints, "/",
"/v1/traces", another explicit path, and URL parse failures. Assert that only
path-less or root endpoints receive "/v1/traces", while explicit paths and parse
failures preserve the existing endpoint behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: dc0eeb5a-1b81-4d34-a3eb-0c4ead60f1b8

📥 Commits

Reviewing files that changed from the base of the PR and between 5708427 and dc9a0e2.

📒 Files selected for processing (1)
  • pkg/tracing/tracing.go

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@mzihlmann
mzihlmann force-pushed the otlp-endpoint-signal-path branch from dc9a0e2 to aadbf8a Compare August 12, 2026 08:44
@codecov

codecov Bot commented Aug 12, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 50.00000% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pkg/tracing/tracing.go 50.00% 2 Missing and 2 partials ⚠️

📢 Thoughts on this report? Let us know!

@mzihlmann
mzihlmann merged commit b7d6f5c into main Aug 12, 2026
13 checks passed
@mzihlmann
mzihlmann deleted the otlp-endpoint-signal-path branch August 12, 2026 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

regression Behavior that worked in a prior release and broke

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant