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 draft status field and examples section. #3

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions text/0000-named-tracers.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Named Tracers
# Named Tracers

**Status:** `proposed`

_Creating tracers using a factory mechanism and naming those tracers in accordance with the library that provides the instrumentation for a traced component._

Expand Down Expand Up @@ -38,25 +40,30 @@ By providing a TracerFactory and *Named Tracers*, a vendor or OpenTelemetry impl

In the simplest case, an OpenTelemetry implementation can return a single instance for a requested tracer regardless of the name specified. This could be the case for implementations that do not want/need to enable or disable a tracer.

Alternatively, an implementation can provide different tracers per specified tracer name, thus being able to associate this tracer with the component being traced. This allows for the possibility to enable / disable a tracer based on a custom configuration.
* Automatically set the `component` ("the component being traced") on every span being produced.
Alternatively, an implementation can provide different tracer instances per specified tracer name, thus being able to associate this tracer with the component being traced. This allows for the possibility to enable / disable a tracer based on a custom configuration.

## Trade-offs and mitigations

## Prior art and alternatives

Alternatively, instead of having a `TracerFactory`, existing (global) tracers could return additional indirection objects (called e.g. `TraceComponent`), which would be able to produce spans for specifically named traced components.
Alternatively, instead of having a `TracerFactory`, existing (global) tracers could return and additional indirection objects (called e.g. `TraceComponent`), which would be able to produce spans for specifically named traced components.

```java
TraceComponent traceComponent = OpenTelemetry.Tracing.getTracer().componentBuilder("io.opentelemetry.contrib.mongodb");
Span span = traceComponent.spanBuilder("someMethod").startSpan();
```

Overall, this would not change a lot since the levels of indirection until producing an actual span are the same.
Overall, this would not change a lot compared to the `TracerFactory` since the levels of indirection until producing an actual span are the same.


## Open questions

## Future possibilities

By adapting this proposal, current implementations that do not honor the specified tracer name and provide a single global tracer, would not require much change. However they could change that behavior in future versions and provide more specific tracer implementations then. On the other side, if the mechanism of *Named Tracer*s is not a part of the initial specification, such scenarios will be prevented and hard to retrofit in future version, should they be deemed necessary then.
By adapting this proposal, current implementations that do not honor the specified tracer name and provide a single global tracer, would not require much change. However they could change that behavior in future versions and provide more specific tracer implementations then. On the other side, if the mechanism of *Named Tracer* is not a part of the initial specification, such scenarios will be prevented and hard to retrofit in future version, should they be deemed necessary then.

## Examples (for Tracer names)

Since tracer names describe the libraries which use the tracers, those names should be defined in a way that makes them as unique as possible.

Proposed naming is in analogy to Java package names, e.g: "io.opentelemetry.contrib.mongodb".