question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Why do ISpan/ISpanContext not have parity in BaggageItems?

See original GitHub issue

Might be a question for the specification, but from my reading, the specification is explicit down to this level.

ISpan exposes SetBaggageItem and GetBaggageItem(string), but ISpanContext only allows user to retrieve ALL of the baggage items via GetBaggageItems(). Since ISpan is supposed to be storing it’s baggage in the ISpanContext, this seems like an artificial limitation of the API.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:20 (20 by maintainers)

github_iconTop GitHub Comments

1reaction
yurishkurocommented, May 7, 2018

“why then does SpanContext expose BaggageItems at all when it could just be a field-less interface?”

as I said, it didn’t really need that for most cases, aside from one obscure use case that wasn’t possible otherwise. That use case needed all baggage items (it didn’t know which items are there), and “all” is a smaller API surface than “get by key”.

“why did we bother with the interface?”

That confusion puzzles me - you need an interface to define an API, even if it’s an empty interface. And as @cwe1ss mentioned, there is a proposal to extend that API to return implementation-agnostic representation of trace/span IDs.

kind of an implementation -> API rather than an API -> implementation lifecycle

I wouldn’t say that. It is of course true that there were existing implementations at the time of API design, but the goal was to enable vendor-neutral instrumentation, i.e. end-user use cases, not to provide an SPI for tracer implementors. Where existing implementations played a role was in them saying “you can’t add method X to the API because my tracing system does not have even a concept of X”. The API is first and foremost end-user facing, if there is no concrete end-user use case, we try hard not to extend the API for it (tracer implementations can cast and do whatever).

0reactions
ndrwrbgscommented, May 7, 2018

Thanks for taking the time to reply Yuri! I’ll close this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found