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

Generalize span operations #209

Merged
merged 13 commits into from
Aug 17, 2019
Merged

Conversation

c24t
Copy link
Member

@c24t c24t commented Aug 9, 2019

Like #190, this PR removes references to the java implementation and specific method names in favor of a general description of tracing API.

Updates #165.

Copy link
Member

@songy23 songy23 left a comment

Choose a reason for hiding this comment

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

Some minor suggestions. Overall LGTM.

for use-cases when a single instrumentation code runs for multiple deployments.
The `Tracer` is responsible for tracking the currently active `Span`, and
exposes methods for creating and activating new `Span`s. The `Tracer` is
configured with `Propagator`s which support transferring context across process
Copy link
Member

Choose a reason for hiding this comment

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

It is unclear whether Propagator will be part of the Tracer.
For example, the OpenCensus Go SDK puts some propagation logic inside integrations https://github.com/census-instrumentation/opencensus-go/tree/master/plugin/ochttp/propagation/b3.

Copy link
Member

Choose a reason for hiding this comment

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

It is also unclear that whether Propagator will handle SpanContext only, or we intend to handle DistributedContext as well?

Copy link
Contributor

Choose a reason for hiding this comment

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

For reference: in Java, the Propagator interface has a generic argument, which can be 'married' to either a SpanContext or a DistributedContext, handling effectively both.

Copy link
Member Author

Choose a reason for hiding this comment

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

I agree with removing propagators from the tracer, but since this is part of another (and likely longer) discussion I'd prefer to keep these changes as-is and reword it once we have a decision.

Copy link
Contributor

@tedsuo tedsuo left a comment

Choose a reason for hiding this comment

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

This generally looks good to me, I prefer this approach.

exposes methods for creating and activating new `Span`s. The `Tracer` is
configured with `Propagator`s which support transferring context across process
boundaries, and `Exporter`s and `SpanProcessor`s which control how spans are
exported to APMs.
Copy link
Member

Choose a reason for hiding this comment

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

SpanProcessor might have other use cases besides exporting data to APMs.

Copy link
Member Author

Choose a reason for hiding this comment

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

Changed this to read:

The Tracer is responsible for tracking the currently active Span, and exposes methods for creating and activating new Spans. The Tracer is configured with Propagators which support transferring span context across process boundaries, Exporters responsible for exporting span data to APMs and Z pages, and SpanProcessors which affect how spans are exported and allow end users to extend the export pipeline with custom behavior.

Is this what you had in mind?

Copy link
Member

@reyang reyang left a comment

Choose a reason for hiding this comment

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

Propagator is a bit tricky, we might need to put it as part of the integration (framework, client libs) instead of Tracer.
Take one example, if there is one service which receives incoming HTTP request in Zipkin/B3 format, and makes outgoing gRPC calls using W3C format, how do we expect the user to specify propagators?

@c24t
Copy link
Member Author

c24t commented Aug 14, 2019

@reyang if you're ok with deferring the propagator changes this PR should be ready to merge.

Copy link
Member

@reyang reyang left a comment

Choose a reason for hiding this comment

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

LGTM

Usually this will be the W3C Trace Context as the HTTP text format. For more
The `Tracer` MUST provide a way to update its active `Span`, and MAY provide
convenience methods to manage a `Span`'s lifetime and the scope in which a
`Span` is active. When an active `Span` is finished, the previously-active
Copy link
Member

Choose a reason for hiding this comment

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

Activating a Span vs lifetime of the Span are independent.
It is hard to ensure what you say here that:

When an active Span is finished, the previously-active Span SHOULD be made active.

Span may be active on multiple threads and this is impossible.

So I would actually encourage to say that this should NOT happen.

Copy link
Member Author

Choose a reason for hiding this comment

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

Does this capture everything?

The `Tracer` MUST provide a way to update its active `Span`, and MAY provide
convenience methods to manage a `Span`'s lifetime and the scope in which a
`Span` is active. When an active `Span` is made inactive, the previously-active
`Span` SHOULD be made active. A `Span` maybe finished (i.e. have a non-null end
time) but stil active. A `Span` may be active on one thread after it has been
made inactive on another.

Copy link
Member Author

Choose a reason for hiding this comment

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

Changed in 8e0b5b2.

@bogdandrutu
Copy link
Member

@c24t please respond and resolve the last comments still active. I will merge after that.

@bogdandrutu bogdandrutu merged commit c32c8fe into open-telemetry:master Aug 17, 2019
@c24t c24t deleted the tracer-ops-prose branch August 19, 2019 22:04
SergeyKanzhelev pushed a commit to SergeyKanzhelev/opentelemetry-specification that referenced this pull request Feb 18, 2020
* s/content/contents/

* Fix typo

* Remove impl-specific details, shuffle text

* Shuffle section on multi-deployment runtime

* Less flowery language

* Backtick fixes

* Apply @songy23's suggestions from PR

Co-Authored-By: Yang Song <songy23@users.noreply.github.com>

* Reword tracer config description

* Note that SpanProcessor does more than export

* s/set/make/

* Lose refs to exporters, processors

* Separate span lifetime and activation
TuckTuckFloof pushed a commit to TuckTuckFloof/opentelemetry-specification that referenced this pull request Oct 15, 2020
carlosalberto pushed a commit to carlosalberto/opentelemetry-specification that referenced this pull request Oct 31, 2024
* s/content/contents/

* Fix typo

* Remove impl-specific details, shuffle text

* Shuffle section on multi-deployment runtime

* Less flowery language

* Backtick fixes

* Apply @songy23's suggestions from PR

Co-Authored-By: Yang Song <songy23@users.noreply.github.com>

* Reword tracer config description

* Note that SpanProcessor does more than export

* s/set/make/

* Lose refs to exporters, processors

* Separate span lifetime and activation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:api Cross language API specification issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants