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

Extra OTel components into OTel module and delay SDK init until SDK starts up #380

Merged
merged 1 commit into from
Feb 8, 2024

Conversation

bidetofevil
Copy link
Collaborator

@bidetofevil bidetofevil commented Feb 8, 2024

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.

Copy link
Contributor

@fractalwrench fractalwrench left a 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,
Copy link
Contributor

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

Copy link
Collaborator Author

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.

Copy link
Collaborator Author

bidetofevil commented Feb 8, 2024

Merge activity

  • Feb 8, 11:32 AM EST: @bidetofevil started a stack merge that includes this pull request via Graphite.
  • Feb 8, 11:37 AM EST: Graphite rebased this pull request as part of a merge.
  • Feb 8, 11:38 AM EST: @bidetofevil merged this pull request with Graphite.

@bidetofevil bidetofevil force-pushed the hho/remove-dupe-internal-tracer-instance branch from ed5f8b9 to 8c86632 Compare February 8, 2024 16:34
Base automatically changed from hho/remove-dupe-internal-tracer-instance to master February 8, 2024 16:36
Copy link

codecov bot commented Feb 8, 2024

Codecov Report

Attention: 15 lines in your changes are missing coverage. Please review.

Comparison is base (a3f91b4) 78.83% compared to head (9c0d2f2) 79.00%.
Report is 4 commits behind head on master.

❗ Current head 9c0d2f2 differs from pull request most recent head c59e315. Consider uploading reports for the commit c59e315 to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@            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     
Files Coverage Δ
...android/embracesdk/EmbraceInternalInterfaceImpl.kt 94.04% <ø> (-0.08%) ⬇️
...race/android/embracesdk/InternalInterfaceModule.kt 100.00% <100.00%> (ø)
...mbracesdk/UninitializedSdkInternalInterfaceImpl.kt 64.70% <ø> (ø)
...d/embracesdk/injection/DataCaptureServiceModule.kt 97.67% <100.00%> (ø)
...ndroid/embracesdk/injection/DataContainerModule.kt 100.00% <100.00%> (ø)
...ace/android/embracesdk/injection/DeliveryModule.kt 100.00% <ø> (ø)
...embrace/android/embracesdk/injection/InitModule.kt 100.00% <100.00%> (ø)
...ndroid/embracesdk/injection/OpenTelemetryModule.kt 100.00% <100.00%> (ø)
...race/android/embracesdk/injection/SessionModule.kt 98.30% <100.00%> (ø)
...race/android/embracesdk/injection/StorageModule.kt 100.00% <ø> (ø)
... and 9 more

... and 8 files with indirect coverage changes

@bidetofevil bidetofevil merged commit 825f04a into master Feb 8, 2024
1 of 3 checks passed
@bidetofevil bidetofevil deleted the hho/otel-module branch February 8, 2024 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants