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

Turn on Spans by default #43

Merged
merged 2 commits into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -105,5 +105,6 @@
"un": "John Doe",
"per": ["first_day"]
},
"spans": "__EMBRACE_TEST_IGNORE__",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding validation in next PR when the issue of double-logging fixed if the moment ends in a timeout

"v": 13
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ internal class SpansBehavior(
remoteSupplier
) {
companion object {
private const val DEFAULT_PCT_ENABLED = 0.0f
private const val DEFAULT_PCT_ENABLED = 100.0f
}

fun isSpansEnabled(): Boolean {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package io.embrace.android.embracesdk.config.behavior

import io.embrace.android.embracesdk.config.remote.SpansRemoteConfig
import io.embrace.android.embracesdk.fakes.fakeSpansBehavior
import org.junit.Assert.assertFalse
import org.junit.Assert.assertTrue
import org.junit.Test

Expand All @@ -14,7 +13,7 @@ internal class SpansBehaviorTest {
@Test
fun testDefaults() {
with(fakeSpansBehavior()) {
assertFalse(isSpansEnabled())
assertTrue(isSpansEnabled())
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ internal class EmbraceSpansServiceTest {

@Test
fun `initializing service if the config is not on won't actually initialize it`() {
spansRemoteConfig = SpansRemoteConfig(pctEnabled = 0f)
configService.updateListeners()
spansService.initializeService(1, 5)
configService.updateListeners()
Expand Down