Skip to content

opentelemetry: Connect external traces #956

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

Merged
merged 1 commit into from
Aug 25, 2020
Merged

Conversation

jtescher
Copy link
Collaborator

Motivation

There are cases where an opentelemetry span will be created before a tracing span (e.g. some server middleware). In this case it would be helpful for tracing-opentelemetry to connect generated spans to the existing trace rather than starting a new trace.

Solution

If a parent trace id does not exist, check the current otel context and only generate a new trace id if no valid id is found.

## Motivation

There are cases where an `opentelemetry` span will be created before a
`tracing` span (e.g. some server middleware). In this case it would be
helpful for `tracing-opentelemetry` to connect generated spans to the
existing trace rather than starting a new trace.

## Solution

If a parent trace id does not exist, check the current otel context and
only generate a new trace id if no valid id is found.
@jtescher jtescher requested a review from a team as a code owner August 25, 2020 20:00
@jtescher jtescher added the crate/opentelemetry Related to the `tracing-opentelemetry` crate. label Aug 25, 2020
@jtescher jtescher merged commit 9ab7f6e into master Aug 25, 2020
@jtescher jtescher deleted the jtescher/otel-context branch August 25, 2020 22:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crate/opentelemetry Related to the `tracing-opentelemetry` crate.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants