Skip to content

Commit

Permalink
Add session and key name to EmbType and TelemetryType respectively
Browse files Browse the repository at this point in the history
  • Loading branch information
bidetofevil committed Mar 9, 2024
1 parent 0015c2e commit b69df7b
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
package io.embrace.android.embracesdk.arch.schema

import io.embrace.android.embracesdk.internal.spans.toEmbraceAttributeName

internal sealed class EmbType {

/**
* Keys that track how fast a time interval is. Only applies to spans.
*/
internal sealed class Performance : TelemetryType
internal object Performance : TelemetryType {
override val description: String = "performance"

Check warning on line 11 in embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/arch/schema/EmbType.kt

View check run for this annotation

Codecov / codecov/patch

embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/arch/schema/EmbType.kt#L11

Added line #L11 was not covered by tests
}

/**
* Keys that track a point in time & is visual in nature. Applies to spans, logs, and span events.
*/
internal sealed class Ux(subtype: String) : TelemetryType {
internal object Session : Ux("session")

Check warning on line 18 in embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/arch/schema/EmbType.kt

View check run for this annotation

Codecov / codecov/patch

embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/arch/schema/EmbType.kt#L18

Added line #L18 was not covered by tests

internal object View : Ux("view")

override val description = "ux.$subtype"
Expand All @@ -35,4 +41,9 @@ internal sealed class EmbType {
*/
internal interface TelemetryType {
val description: String

/**
* Return the key name used by this attribute when is used inside of OpenTelemetry objects
*/
fun attributeName(): String = "type".toEmbraceAttributeName()

Check warning on line 48 in embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/arch/schema/EmbType.kt

View check run for this annotation

Codecov / codecov/patch

embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/arch/schema/EmbType.kt#L48

Added line #L48 was not covered by tests
}

0 comments on commit b69df7b

Please sign in to comment.