Closed rghetia closed 3 years ago
Thanks for filing this issue for me.
To expand on it a bit: TraceContext
used to be in propagators
package, so there was no stutter, and it was clear that it was a propagator because of the package name. Now it has been moved to the trace
package, so it stutters and the trace.TraceContext
name does not make it clear that it is a propagator. The trace.B3
propagator is also affected - not clear that it is a propagator.
Also, we are going to have the same problem later when we split the correlation context propagation from trace.TraceContext
into the correlation
package - we will get something like correlation.CorrelationContext
or something.
So to solve the issue, I'm proposing the following:
Propagator
to the type name (so we will have trace.TraceContextPropagator
, trace.B3Propagator
and, in future, correlation.CorrelationContextPropagator
. Now it's clear that those types are propagators.trace.TraceContextPropagator
and correlation.CorrelationContextPropagator
are awfully long and they stutter, we need to shorten/fix their names. Since both of them are implementations of some W3C spec, we could name them trace.W3CPropagator
and correlation.W3CPropagator
, respectively.@rghetia also proposed naming trace.TraceContext
as trace.ContextPropagator
which, to me, sounds too generic, because trace.B3Propagator
is also a context propagator.
- Since
trace.TraceContextPropagator
andcorrelation.CorrelationContextPropagator
are awfully long and they stutter, we need to shorten/fix their names. Since both of them are implementations of some W3C spec, we could name themtrace.W3CPropagator
andcorrelation.W3CPropagator
, respectively.
I like W3CPropagator.
I'm personally wary of W3C
as it feels somewhat un-obvious and is meant to be the standard. You wouldn't say W3CContentLength
.
@iredelmeier do you have any suggestion if not W3CPropagator?
I like the addition of adding Propagator as a suffix tot he types to help people understand the intent.
If W3C is the meant to be the default/standard, could we name it DefaultPropagator
? I'm not a huge fan of this incase we wish to change the default to something else in the future.
If W3C is the meant to be the default/standard, could we name it
DefaultPropagator
? I'm not a huge fan of this incase we wish to change the default to something else in the future.
DefaultPropagator is something else - we have this as a function for both span context and correlation context that returns a propagator.
we could name them trace.W3CPropagator and correlation.W3CPropagator, respectively
I'll throw my support behind this. I think the fully-qualified name (i.e. including the trace.
and correlation.
prefix) make the intent clear. To me it indicates the trace or correlation propagator defined by the W3C.
However, if including the standards body as part of the name is ultimately not desired, could we just use trace.Propagator
and correlation.Propagator
? The specification states these are the format to support:
Implementations MAY provide global Propagators for each supported Format.
If offered, the global Propagators should default to a composite Propagator containing W3C Trace Context and Correlation Context Propagators, in order to provide propagation even in the presence of no-op OpenTelemetry implementations.
Seems like just calling them *Propagator
, while losing implementation details, is in line with the project.
I think I would be OK with trace.Context
.
Currently golint warning on trace.TraceContext is disabled. Opened this issue to find a better name.