Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ContextUtils #202

Closed
wants to merge 2 commits into from
Closed

ContextUtils #202

wants to merge 2 commits into from

Conversation

mwear
Copy link
Member

@mwear mwear commented Feb 29, 2020

See #201 for discussion and rationale. I made that as a separate issue as I think there could be a larger discussion.

This PR contains an implementation of the ContextUtils proposal to add convenience methods to operate on a context and also applies in the codebase where applicable.

@mwear
Copy link
Member Author

mwear commented Feb 29, 2020

I think #108 could benefit from some of the convenience methods introduced here.

# SPDX-License-Identifier: Apache-2.0

module OpenTelemetry
# The ContextUtils module contains convenience methods for inserting and
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing a word in the comment here? inserting and ...?

@fbogsany
Copy link
Contributor

fbogsany commented Mar 4, 2020

So far, this doesn't feel like much of an improvement to me, probably because the methods are stuck in the ContextUtils class. There is probably a more convenient place for them.

Higher level concern: it feels like we've exposed a lot more of the internals of the API than I recall, especially the ability to set and get the current span and extracted span context. This is more of a "spidey sense" thing than anything concrete, but it does feel like the API is becoming a lot more complex (both in implementation and interface) due to various indirections.

@fbogsany fbogsany mentioned this pull request Mar 4, 2020
@mwear
Copy link
Member Author

mwear commented Mar 4, 2020

Good points. The convenience methods for working with a span context are only useful if you're writing a propagator. I think we need some help around reading a span from a context, or returning a new context with an updated span, but those probably have a better place. We can discuss where that might be.

I'll close this and we can discuss in the related issue.

@mwear mwear closed this Mar 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants