-
Notifications
You must be signed in to change notification settings - Fork 111
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
make trace/span id generation customizable #310
Conversation
Crap, just realized this is wrong in the noop tracer. |
Codecov Report
@@ Coverage Diff @@
## main #310 +/- ##
==========================================
- Coverage 37.90% 37.84% -0.07%
==========================================
Files 49 50 +1
Lines 3327 3327
==========================================
- Hits 1261 1259 -2
- Misses 2066 2068 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
A behaviour, otel_id_generator, is added which has callbacks for generating trace and span ids, along with the default versions of those functions. The implementation to use is kept in the tracer record.
dfb2c82
to
e71c853
Compare
Fixed, based on my PR to the spec, will have to see how it goes open-telemetry/opentelemetry-specification#2121 |
otel_span:start_opts(), fun(), otel_tracer_server:instrumentation_library()) | ||
-> opentelemetry:span_ctx(). | ||
start_span(Ctx, Name, Sampler, IdGeneratorModule, Opts, Processors, InstrumentationLibrary) -> | ||
case otel_span_utils:start_span(Ctx, Name, Sampler, IdGeneratorModule, Opts) of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
starting to think this whole injection mechanism coming from other langs means we'd eventually be better served by a default map that we merge with user options to override individual entries.
If everything in the universe can be overridden, the number of call params will never end growing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eh, it is a little different. It isn't an override the user is passing, it is simply that more has been added to the Tracer and before there was no need to pass the actual Tracer down because there were just a couple pieces needed from it.
It may be that we should be passing the actual Tracer all the way down and not pulling out fields. I may make a PR to do that. I think pretty much everything in the Tracer is now an argument.
695b404
to
fa8ae84
Compare
A behaviour, otel_id_generator, is added which has callbacks for
generating trace and span ids, along with the default versions
of those functions.
The implementation to use is kept in the tracer record.