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

fix!: Move context/span methods to Trace module #439

Merged
merged 5 commits into from
Oct 16, 2020

Conversation

fbogsany
Copy link
Contributor

This implements the alternative to #425 outlined in #425 (comment)

Copy link
Member

@mwear mwear left a comment

Choose a reason for hiding this comment

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

This looks good to me. I agree it's a bit more in the spirit of the spec.


def current_span_key
OpenTelemetry::Trace::Propagation::ContextKeys.current_span_key
OpenTelemetry::Trace.current_span(context)&.finish if context
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think we need the &. here. current_span will always return non-nil. If it returns Span::INVALID, we can safely call .finish on it - that's a no-op on the API Span.

@fbogsany fbogsany merged commit 64c40f5 into master Oct 16, 2020
@fbogsany fbogsany deleted the static-trace-methods branch October 16, 2020 19:10
@fbogsany fbogsany added this to the Beta v0.8 milestone Oct 27, 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