From 0a676a5f2ab4e00245d3df0ea6432fe3253b18f3 Mon Sep 17 00:00:00 2001 From: Wolfgang Ziegler Date: Tue, 13 Aug 2019 17:52:49 +0200 Subject: [PATCH 1/2] Add examples section. --- text/0000-named-tracers.md | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/text/0000-named-tracers.md b/text/0000-named-tracers.md index 3d3fba239..204b86335 100644 --- a/text/0000-named-tracers.md +++ b/text/0000-named-tracers.md @@ -1,4 +1,4 @@ -# Named Tracers +# Named Tracers **Status:** `proposed` @@ -40,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 Tracers* 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". From 3c4d1503312415ccc5e82fbf52c81e12db837343 Mon Sep 17 00:00:00 2001 From: Wolfgang Ziegler Date: Tue, 13 Aug 2019 17:57:49 +0200 Subject: [PATCH 2/2] Update 0000-named-tracers.md --- text/0000-named-tracers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/text/0000-named-tracers.md b/text/0000-named-tracers.md index 204b86335..91d8df553 100644 --- a/text/0000-named-tracers.md +++ b/text/0000-named-tracers.md @@ -46,7 +46,7 @@ Alternatively, an implementation can provide different tracer instances per spec ## Prior art and alternatives -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. +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. ```java TraceComponent traceComponent = OpenTelemetry.Tracing.getTracer().componentBuilder("io.opentelemetry.contrib.mongodb");