Replace DistributedContext with more specific interfaces #140
Labels
area:api
Cross language API specification issue
spec:context
Related to the specification/context directory
Milestone
The current
DistributedContext
API is trying to handle too many concerns, which is why anEntryMetadata
needs to be added to everyEntry
which makes it a confusing and difficult to use interface.These are the separate concerns that the current API is handling:
There is no use case for a TTL
>1 && <services
.I propose to use more specific interfaces instead that will be cleaner and specific to the use case at hand. This will be much easier to use, and anything specific to a single use case will not be mixed with other properties in a single metadata object.
The new API would look like this instead:
All of them would be simple maps of strings (and any other types that make sense). They could be attached to the
SpanContext
to easily make them available everywhere, but another benefit of having different interfaces is that this doesn't have to be the case.This API would also be much more idiomatic in dynamic languages, while still being strongly typed and easy to understand in more verbose languages.
The text was updated successfully, but these errors were encountered: