Skip to content

Add BeforeEnd to have a callback where the span is still writeable #1089

@gugahoa

Description

@gugahoa

What are you trying to achieve?
Set an attribute to all spans in a trace

What did you expect to see?
Writeable spans on SpanProcessor's OnEnd(Span)

Additional context.
What I tried to implement is a feature called trace field in Honeycomb (reference: AddFieldToTrace)

For that I first tried to use SpanProcessor, but soon found out that OnEnd(Span) is not writeable.

The solution I arrived was to write a custom exporter which was able to read from a thread-local storage (at the time of the implementation, Baggage had yet to be spec'ed out) to list all attributes related to a Trace and insert into the span before exporting.

From what I understood from the SpanProcessor specification, that's the place where I should have placed this logic, as it's a transformation that should happen before the span is sent to any exporter

Metadata

Metadata

Labels

area:sdkRelated to the SDKenhancementNew feature or requestspec:traceRelated to the specification/trace directorytriage:accepted:ready-with-sponsorReady to be implemented and has a specification sponsor assigned

Type

No type

Projects

Status

Spec - Closed

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions