Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Opentelemetry Propagation Traceresponse Laravel Package

open-telemetry/opentelemetry-propagation-traceresponse

Adds TraceResponse propagation support to the OpenTelemetry PHP SDK, letting services extract and inject trace context using the draft TraceResponse format. Useful when integrating with systems that emit or expect this header, keeping distributed traces connected across service boundaries.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit

  • The package is a single-purpose TextMapPropagator implementation for the draft traceresponse HTTP header. It slots into the OpenTelemetry PHP SDK's propagator chain (CompositePropagator) alongside tracecontext and baggage; it is not a tracer, exporter, or instrumentation library, so it adds no new pipeline stage.
  • Fit with a Laravel service is narrow and conditional. It only pays off if something downstream or upstream actually reads the traceresponse header — a partner API, a browser-side RUM agent, a third-party edge/WAF, or an internal client SDK. Absent a named consumer, this is header decoration with no correlating counterpart.
  • Semantically it overlaps traceparent. Running both is fine but doubles context surface on every response and invites confusion about which header is authoritative for support/debugging workflows.

Integration feasibility

  • Mechanically trivial: one Composer require, one line in the propagator configuration (OTEL_PROPAGATORS=tracecontext,baggage,traceresponse or the SDK builder equivalent), plus a Laravel middleware to ensure the header is emitted on responses generated outside the auto-instrumentation path (exception handlers, abort(), early-return middleware).
  • No framework coupling, no service provider, no config publish step. PHP 8.x + opentelemetry-api 1.x, consistent with the rest of the OTel PHP stack.
  • The real work is not installation, it is the response-side plumbing in Laravel: the auto-instrumentation typically propagates on outbound HTTP calls, while traceresponse must be injected into the response returned to the caller. That is a kernel-level middleware decision and needs ordering review under Octane and under Route::fallback/error paths.

Technical risk

  • Spec status. traceresponse is a draft in the W3C distributed-tracing orbit, not a ratified standard. Header name, encoding, and semantics can move. Treat any adoption as reversible and behind a flag.
  • Package status. Marked [READONLY] and living in a contrib-* repo — this is the classic "absorbed into the monorepo / frozen" signal. It will not receive features, and its future is a re-publish from the consolidated contrib repository under a possibly different constraint set.
  • Maturity signals. 1 star, 0 dependents, low composite score (14.8) with a much higher opportunity score (62.5) — that spread says "plausible idea, unproven adoption." There is effectively no community evidence of production use to lean on.
  • Header hygiene. Browser clients will not see the header without Access-Control-Expose-Headers; CDNs and reverse proxies may strip or cache it; some gateways reject unknown response headers.
  • Correctness envelope. Propagator code runs on the hot path for every request. Extraction must be defensive against malformed/absent headers and must never throw into the request lifecycle.

Key questions

  1. Who is the consuming party for traceresponse, and can they commit to it in writing? If the answer is "no one yet," defer.
  2. Does the frozen contrib-* package have a documented successor package and migration note in the main contrib repo?
  3. What is the exit cost if the draft header changes — is it one config line, or does it leak into client contracts and support runbooks?
  4. Are we prepared to own the response-injection middleware ourselves, including error and streaming responses?
  5. Does our edge/CDN/WAF preserve unknown traceresponse headers end to end?

Integration Approach

Stack fit

  • Fits the standard OTel PHP shape: SDK + auto-instrumentation extension or open-telemetry/opentelemetry-auto-laravel, TextMapPropagator registered in the composite. Nothing Laravel-specific is required from the package, which is a positive for portability and a negative for out-of-the-box ergonomics.
  • Complements, rather than replaces, tracecontext/baggage. Recommended chain: tracecontext,baggage,traceresponse.

Migration path

  • Because it is READONLY, plan the dependency as provisional. Pin to an exact version, isolate the require behind a single composer.json entry, and wrap the propagator registration in a config flag (OTEL_TRACERESPONSE_ENABLED) so the swap to a successor package is a one-line change plus a config toggle.
  • Expect the eventual move to a package published out of the consolidated contrib monorepo. Budget a half-day migration ticket, not a project.
  • If already on tracecontext, this is additive; no cutover sequencing is required. Do not build client-facing contracts on the header before the spec stabilizes.

Compatibility

  • Verify against the pinned opentelemetry-api/opentelemetry-sdk versions in the app; contrib packages in this ecosystem historically lag the API's minor releases during breaking-change windows.
  • Verify behavior under Octane/Swoole long-running workers — the propagator itself is stateless, but any middleware you write to stash context must be request-scoped, not singleton-scoped.
  • Confirm interaction with Laravel's response pipeline: TerminateMiddleware, StreamedResponse, and exception rendering each take a different path.

Sequencing

  1. Confirm the consumer and the business reason (support correlation, cross-vendor tracing) — gate here.
  2. Spike: enable the propagator in staging, add response-injection middleware, verify header presence on 200/4xx/5xx and through the CDN.
  3. Roll out behind a flag to one internal consumer; instrument whether the header is actually read.
  4. Only after demonstrated use, promote to production and add the successor-package migration to the platform backlog.

Operational Impact

Maintenance

  • Near-zero code maintenance (the package is frozen and tiny), but non-zero ownership maintenance: someone must track (a) the draft spec's evolution and (b) the package's successor in the contrib monorepo. Assign that explicitly; unowned frozen dependencies are how surprise breakages happen.
  • Our own response-injection middleware becomes the maintained artifact. Scope it to <50 lines and test it.

Support

  • Low support surface, but debugging is asymmetric: the observable symptom of a bug here is a missing or malformed header, which nobody notices until a trace correlation fails during an incident. Add a smoke check that asserts header presence on a canary route.
  • On-call runbooks should state plainly that traceparent is authoritative and traceresponse is supplementary, so responders don't chase the wrong header.

Scaling

  • Negligible CPU and allocation cost — one header serialize/parse per request. No new network hops, no exporter, no sidecar.
  • Watch response header size and proxy header-count limits only if the composite propagator grows substantially; not a concern at current scope.

Failure modes

  • Malformed inbound header → extraction must degrade to "no context," never throw. Validate this with a fuzz-ish test.
  • Duplicate/conflicting headers when both tracecontext and traceresponse are present → define precedence and document it.
  • Stripping by CDN/WAF → silent loss of correlation; test through the real edge, not just the local app.
  • Middleware ordering bug under Octane or on exception paths → missing header on exactly the responses you most want to correlate.
  • Package abandonment without a successor → mitigated by the pin + flag strategy above.

Ramp-up

  • Very low for engineers: one require, one config line, one small middleware. A mid-level engineer familiar with the OTel SDK can spike this in under a day.
  • The non-obvious load is organizational: securing the consumer commitment and defining header precedence. Budget TPM time there, not engineering time.
  • Given 0 dependents and READONLY status, default recommendation is defer unless a concrete consumer exists; if one does, proceed as a flagged, pinned, reversible enhancement rather than a platform standard.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
coleus/frame
thtg88/journalism
filagora/filagora-ai-forums
rlacerda83/query-parser
socialdept/atp-orm
cboxdk/laravel-assistant-client
socialdept/atp-resolver
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings