Skip to content
This repository has been archived by the owner on Oct 3, 2023. It is now read-only.

Span status has no analogue in extension #196

Open
klibbbs opened this issue Jul 18, 2018 · 0 comments
Open

Span status has no analogue in extension #196

klibbbs opened this issue Jul 18, 2018 · 0 comments

Comments

@klibbbs
Copy link
Contributor

klibbbs commented Jul 18, 2018

The span data maintained by the extension (in opencensus_trace_span_t) has no field corresponding with the status property on OpenCensus\Trace\Span. This discrepancy is exposed when a trace is reported on shutdown, because OpenCensus\Trace\RequestHandler::addCommonRequestAttributes sets the outgoing HTTP response code on the root span.

The status field can only be set directly on an OpenCensus\Trace\Span object itself, unlike attributes, timeEvents, and links, which are set with methods on OpenCensus\Trace\Tracer. OpenCensus\Trace\Tracer\ExtensionTracer wraps extension built-ins for setting these other properties (e.g. opencensus_trace_add_attribute).

I think the idiomatic way to fix this would be to add a OpenCensus\Trace\Tracer::setStatus method (as well as the corresponding methods on the TracerInterface implementers) that would allow a new opencensus_trace_set_status built-in to be invoked in the same way.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant