-
Notifications
You must be signed in to change notification settings - Fork 7
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
Extra OTel components into OTel module and delay SDK init until SDK starts up #380
Conversation
Current dependencies on/for this PR:
This stack of pull requests is managed by Graphite. |
4d2481d
to
ed5f8b9
Compare
9c0d2f2
to
7f2ebe3
Compare
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.
LGTM
@@ -13,7 +13,7 @@ import io.opentelemetry.api.trace.Tracer | |||
internal class EmbraceSpansService( | |||
private val spansRepository: SpansRepository, | |||
private val currentSessionSpan: CurrentSessionSpan, | |||
private val tracer: Tracer, | |||
private val tracerSupplier: () -> Tracer, |
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.
We're using this pattern a lot more frequently - I wonder whether it makes sense to create a typealias that makes this a bit more explicit? E.g. something like:
internal typealias Provider<T> = () -> T
Not required for this changeset
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.
Good idea! Provider is a bit Dagger-esque, and Supplier is a it Java-esque, so either one would work. Lets do that after.
Merge activity
|
ed5f8b9
to
8c86632
Compare
7f2ebe3
to
c59e315
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #380 +/- ##
==========================================
+ Coverage 78.83% 79.00% +0.16%
==========================================
Files 342 343 +1
Lines 9677 9720 +43
Branches 1452 1457 +5
==========================================
+ Hits 7629 7679 +50
+ Misses 1470 1456 -14
- Partials 578 585 +7
|
Goal
Extract OTel components into its own module and delay the OTel SDK init until the SDK starts. This allows the SDK instance to be configured programmatically before the SDK start, like adding resources and Exporters. Most of the changes are test updates. I also added an OpenTelemetryModule implementation instance in
FakeInitModule
for ease of use since they need to be tied together anyway.