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

Add StripSpanContextKeyFromContext #453

Closed
wants to merge 2 commits into from
Closed

Add StripSpanContextKeyFromContext #453

wants to merge 2 commits into from

Conversation

GTB3NW
Copy link

@GTB3NW GTB3NW commented Jun 22, 2022

See #452 for the spanFromContext change, I'm hoping that can be merged before this.

SpanFromContext will allow us to extract the spanid from a context, we can then strip the span from that context (yielding a new context), which can be then used to create a new span with a span option to populate the parentspanid (which remains unpopulated if a parent span doesn't exist).

Ultimately this allows us to construct new transactions in-process and keep the existing context chain.

Matches the logic from `TransactionFromContext` and returns nil.
This is idiomatic and does what it says on the tin, if the context
does not have a span contained within it, I would not expect anything
to be returned. An error seems... extra.
StripSpanContextKeyFromContext returns a new context with the parent span removed
but critically retaining the parentSpanID, allowing for new transactions
to be formed within the same running process while retaining all the current
context benefits, including existing sentry context keys (apart  from
`spanContextKey`) and timeouts etc.
This pull request was closed.
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.

None yet

1 participant