expo-observe 58.0.17 → 58.0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/android/src/main/java/expo/modules/observe/Constants.kt +6 -0
- package/android/src/main/java/expo/modules/observe/Event.kt +10 -7
- package/android/src/main/java/expo/modules/observe/ObservabilityManager.kt +22 -12
- package/android/src/main/java/expo/modules/observe/ObserveModule.kt +3 -1
- package/android/src/main/java/expo/modules/observe/ObservePreferences.kt +2 -1
- package/build/module.js +26 -1
- package/build/module.js.map +1 -1
- package/build/module.web.d.ts +4 -1
- package/build/module.web.js +4 -1
- package/build/module.web.js.map +1 -1
- package/build/types.d.ts +36 -2
- package/build/types.js.map +1 -1
- package/ios/Observability.swift +32 -16
- package/ios/ObserveModule.swift +3 -1
- package/ios/ObserveUserDefaults.swift +1 -0
- package/ios/OpenTelemetry.swift +4 -3
- package/ios/Tests/ObservabilityTests.swift +20 -0
- package/ios/Tests/OpenTelemetryTests.swift +28 -1
- package/local-maven-repo/expo/modules/observe/expo.modules.observe/{58.0.17/expo.modules.observe-58.0.17-sources.jar → 58.0.18/expo.modules.observe-58.0.18-sources.jar} +0 -0
- package/local-maven-repo/expo/modules/observe/expo.modules.observe/58.0.18/expo.modules.observe-58.0.18-sources.jar.md5 +1 -0
- package/local-maven-repo/expo/modules/observe/expo.modules.observe/58.0.18/expo.modules.observe-58.0.18-sources.jar.sha1 +1 -0
- package/local-maven-repo/expo/modules/observe/expo.modules.observe/58.0.18/expo.modules.observe-58.0.18-sources.jar.sha256 +1 -0
- package/local-maven-repo/expo/modules/observe/expo.modules.observe/58.0.18/expo.modules.observe-58.0.18-sources.jar.sha512 +1 -0
- package/local-maven-repo/expo/modules/observe/expo.modules.observe/58.0.18/expo.modules.observe-58.0.18.aar +0 -0
- package/local-maven-repo/expo/modules/observe/expo.modules.observe/58.0.18/expo.modules.observe-58.0.18.aar.md5 +1 -0
- package/local-maven-repo/expo/modules/observe/expo.modules.observe/58.0.18/expo.modules.observe-58.0.18.aar.sha1 +1 -0
- package/local-maven-repo/expo/modules/observe/expo.modules.observe/58.0.18/expo.modules.observe-58.0.18.aar.sha256 +1 -0
- package/local-maven-repo/expo/modules/observe/expo.modules.observe/58.0.18/expo.modules.observe-58.0.18.aar.sha512 +1 -0
- package/local-maven-repo/expo/modules/observe/expo.modules.observe/{58.0.17/expo.modules.observe-58.0.17.module → 58.0.18/expo.modules.observe-58.0.18.module} +23 -23
- package/local-maven-repo/expo/modules/observe/expo.modules.observe/58.0.18/expo.modules.observe-58.0.18.module.md5 +1 -0
- package/local-maven-repo/expo/modules/observe/expo.modules.observe/58.0.18/expo.modules.observe-58.0.18.module.sha1 +1 -0
- package/local-maven-repo/expo/modules/observe/expo.modules.observe/58.0.18/expo.modules.observe-58.0.18.module.sha256 +1 -0
- package/local-maven-repo/expo/modules/observe/expo.modules.observe/58.0.18/expo.modules.observe-58.0.18.module.sha512 +1 -0
- package/local-maven-repo/expo/modules/observe/expo.modules.observe/{58.0.17/expo.modules.observe-58.0.17.pom → 58.0.18/expo.modules.observe-58.0.18.pom} +2 -2
- package/local-maven-repo/expo/modules/observe/expo.modules.observe/58.0.18/expo.modules.observe-58.0.18.pom.md5 +1 -0
- package/local-maven-repo/expo/modules/observe/expo.modules.observe/58.0.18/expo.modules.observe-58.0.18.pom.sha1 +1 -0
- package/local-maven-repo/expo/modules/observe/expo.modules.observe/58.0.18/expo.modules.observe-58.0.18.pom.sha256 +1 -0
- package/local-maven-repo/expo/modules/observe/expo.modules.observe/58.0.18/expo.modules.observe-58.0.18.pom.sha512 +1 -0
- package/package.json +4 -4
- package/src/module.ts +37 -1
- package/src/module.web.ts +10 -1
- package/src/types.ts +36 -2
- package/local-maven-repo/expo/modules/observe/expo.modules.observe/58.0.17/expo.modules.observe-58.0.17-sources.jar.md5 +0 -1
- package/local-maven-repo/expo/modules/observe/expo.modules.observe/58.0.17/expo.modules.observe-58.0.17-sources.jar.sha1 +0 -1
- package/local-maven-repo/expo/modules/observe/expo.modules.observe/58.0.17/expo.modules.observe-58.0.17-sources.jar.sha256 +0 -1
- package/local-maven-repo/expo/modules/observe/expo.modules.observe/58.0.17/expo.modules.observe-58.0.17-sources.jar.sha512 +0 -1
- package/local-maven-repo/expo/modules/observe/expo.modules.observe/58.0.17/expo.modules.observe-58.0.17.aar +0 -0
- package/local-maven-repo/expo/modules/observe/expo.modules.observe/58.0.17/expo.modules.observe-58.0.17.aar.md5 +0 -1
- package/local-maven-repo/expo/modules/observe/expo.modules.observe/58.0.17/expo.modules.observe-58.0.17.aar.sha1 +0 -1
- package/local-maven-repo/expo/modules/observe/expo.modules.observe/58.0.17/expo.modules.observe-58.0.17.aar.sha256 +0 -1
- package/local-maven-repo/expo/modules/observe/expo.modules.observe/58.0.17/expo.modules.observe-58.0.17.aar.sha512 +0 -1
- package/local-maven-repo/expo/modules/observe/expo.modules.observe/58.0.17/expo.modules.observe-58.0.17.module.md5 +0 -1
- package/local-maven-repo/expo/modules/observe/expo.modules.observe/58.0.17/expo.modules.observe-58.0.17.module.sha1 +0 -1
- package/local-maven-repo/expo/modules/observe/expo.modules.observe/58.0.17/expo.modules.observe-58.0.17.module.sha256 +0 -1
- package/local-maven-repo/expo/modules/observe/expo.modules.observe/58.0.17/expo.modules.observe-58.0.17.module.sha512 +0 -1
- package/local-maven-repo/expo/modules/observe/expo.modules.observe/58.0.17/expo.modules.observe-58.0.17.pom.md5 +0 -1
- package/local-maven-repo/expo/modules/observe/expo.modules.observe/58.0.17/expo.modules.observe-58.0.17.pom.sha1 +0 -1
- package/local-maven-repo/expo/modules/observe/expo.modules.observe/58.0.17/expo.modules.observe-58.0.17.pom.sha256 +0 -1
- package/local-maven-repo/expo/modules/observe/expo.modules.observe/58.0.17/expo.modules.observe-58.0.17.pom.sha512 +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 58.0.18
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Add `startSpan`, `withSpan`, and `recordSpan` to record custom trace spans, exported to EAS Observe alongside network request spans. ([#48893](https://github.com/expo/expo/pull/48893) by [@tsapeta](https://github.com/tsapeta))
|
|
8
|
+
- Add the `errorSampleRate` config option. It sets the fraction of installations that dispatch errors and crash reports separately from `sampleRate`. ([#51930](https://github.com/expo/expo/pull/51930) by [@Ubax](https://github.com/Ubax))
|
|
9
|
+
- Add the `expo.in_sample_rate` attribute to logs. ([#52313](https://github.com/expo/expo/pull/52313) by [@Ubax](https://github.com/Ubax))
|
|
10
|
+
- Updated dependencies. ([#51930](https://github.com/expo/expo/pull/51930), [#48893](https://github.com/expo/expo/pull/48893), [#50849](https://github.com/expo/expo/pull/50849))
|
|
11
|
+
- expo-app-metrics@58.0.15
|
|
12
|
+
|
|
3
13
|
## 58.0.17
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
package expo.modules.observe
|
|
2
2
|
|
|
3
|
+
import expo.modules.appmetrics.crashreporting.NATIVE_EXCEPTION_LOG_NAME
|
|
4
|
+
import expo.modules.appmetrics.jserrors.JS_EXCEPTION_LOG_NAME
|
|
5
|
+
|
|
3
6
|
internal const val OBSERVE_TAG = "EasObserve"
|
|
4
7
|
internal const val OBSERVE_DEFAULT_BASE_URL = "https://o.expo.dev/"
|
|
5
8
|
|
|
6
9
|
internal const val DISPATCH_CHUNK_SIZE = 200
|
|
10
|
+
|
|
11
|
+
// Log names that `errorSampleRate` applies to.
|
|
12
|
+
internal val ERROR_LOG_NAMES = setOf(JS_EXCEPTION_LOG_NAME, NATIVE_EXCEPTION_LOG_NAME)
|
|
@@ -8,6 +8,7 @@ import kotlinx.serialization.builtins.MapSerializer
|
|
|
8
8
|
import kotlinx.serialization.builtins.serializer
|
|
9
9
|
import kotlinx.serialization.json.Json
|
|
10
10
|
import kotlinx.serialization.json.JsonObject
|
|
11
|
+
import kotlinx.serialization.json.JsonPrimitive
|
|
11
12
|
|
|
12
13
|
@Serializable
|
|
13
14
|
data class Metadata(
|
|
@@ -122,20 +123,22 @@ data class LogEvent(
|
|
|
122
123
|
val droppedAttributesCount: Int = 0
|
|
123
124
|
) {
|
|
124
125
|
companion object {
|
|
125
|
-
fun fromLogRecord(log: LogRecord): LogEvent
|
|
126
|
-
|
|
126
|
+
fun fromLogRecord(log: LogRecord, inSampleRate: Boolean): LogEvent {
|
|
127
|
+
// Stored as a JSON string; parse defensively, falling back to no
|
|
128
|
+
// attributes if the blob is somehow malformed.
|
|
129
|
+
val attributes = log.attributes?.let {
|
|
130
|
+
runCatching { Json.decodeFromString<JsonObject>(it) }.getOrNull()
|
|
131
|
+
}
|
|
132
|
+
return LogEvent(
|
|
127
133
|
sessionId = log.sessionId,
|
|
128
134
|
timestamp = log.timestamp,
|
|
129
135
|
name = log.name,
|
|
130
136
|
body = log.body,
|
|
131
137
|
severity = log.severity,
|
|
132
|
-
|
|
133
|
-
// attributes if the blob is somehow malformed.
|
|
134
|
-
attributes = log.attributes?.let {
|
|
135
|
-
runCatching { Json.decodeFromString<JsonObject>(it) }.getOrNull()
|
|
136
|
-
},
|
|
138
|
+
attributes = JsonObject(attributes.orEmpty() + ("expo.in_sample_rate" to JsonPrimitive(inSampleRate))),
|
|
137
139
|
droppedAttributesCount = log.droppedAttributesCount
|
|
138
140
|
)
|
|
141
|
+
}
|
|
139
142
|
}
|
|
140
143
|
}
|
|
141
144
|
|
|
@@ -135,7 +135,8 @@ class BaseObservabilityManager(
|
|
|
135
135
|
}
|
|
136
136
|
|
|
137
137
|
repairMetricCursorIfStale(context, sessionManager)
|
|
138
|
-
|
|
138
|
+
val config = ObservePreferences.getConfig(context)
|
|
139
|
+
if (!shouldDispatch(config, config?.sampleRate)) {
|
|
139
140
|
val maxId = sessionManager.getMaxMetricId() ?: -1
|
|
140
141
|
if (ObservePreferences.getLastDispatchedMetricId(context) != maxId) {
|
|
141
142
|
ObservePreferences.setLastDispatchedMetricId(context, maxId)
|
|
@@ -214,7 +215,11 @@ class BaseObservabilityManager(
|
|
|
214
215
|
}
|
|
215
216
|
|
|
216
217
|
repairLogCursorIfStale(context, sessionManager)
|
|
217
|
-
|
|
218
|
+
val config = ObservePreferences.getConfig(context)
|
|
219
|
+
// Installations in-sample for `sampleRate` send all logs. Errors use the higher of the two rates.
|
|
220
|
+
val dispatchLogsAndErrors = shouldDispatch(config, config?.sampleRate)
|
|
221
|
+
val dispatchErrors = shouldDispatch(config, config?.errorSampleRate ?: config?.sampleRate)
|
|
222
|
+
if (!dispatchLogsAndErrors && !dispatchErrors) {
|
|
218
223
|
val maxId = sessionManager.getMaxLogId() ?: -1
|
|
219
224
|
if (ObservePreferences.getLastDispatchedLogId(context) != maxId) {
|
|
220
225
|
ObservePreferences.setLastDispatchedLogId(context, maxId)
|
|
@@ -232,14 +237,19 @@ class BaseObservabilityManager(
|
|
|
232
237
|
}
|
|
233
238
|
|
|
234
239
|
val highestId = logs.last().id
|
|
235
|
-
val
|
|
240
|
+
val sampledLogs = if (dispatchLogsAndErrors) {
|
|
241
|
+
logs
|
|
242
|
+
} else {
|
|
243
|
+
logs.filter { it.name in ERROR_LOG_NAMES }
|
|
244
|
+
}
|
|
245
|
+
val logsBySessionId = sampledLogs.groupBy { it.sessionId }
|
|
236
246
|
val sessions = sessionManager.getSessions(logsBySessionId.keys).associateBy { it.id }
|
|
237
247
|
val events = logsBySessionId.mapNotNull { (sessionId, sessionLogs) ->
|
|
238
248
|
sessions[sessionId]?.let { session ->
|
|
239
249
|
Event(
|
|
240
250
|
metadata = Metadata.fromSessionMetadata(session),
|
|
241
251
|
metrics = emptyList(),
|
|
242
|
-
logs = sessionLogs.map
|
|
252
|
+
logs = sessionLogs.map { LogEvent.fromLogRecord(it, inSampleRate = dispatchLogsAndErrors) }
|
|
243
253
|
)
|
|
244
254
|
}
|
|
245
255
|
}
|
|
@@ -255,12 +265,12 @@ class BaseObservabilityManager(
|
|
|
255
265
|
is DispatchResult.PartialSuccess ->
|
|
256
266
|
Log.w(
|
|
257
267
|
OBSERVE_TAG,
|
|
258
|
-
"Partial success on batch of ${
|
|
268
|
+
"Partial success on batch of ${sampledLogs.size} log event(s): " +
|
|
259
269
|
"server rejected ${result.partial.rejectedCount} " +
|
|
260
270
|
"(${result.partial.errorMessage ?: "no error message"})"
|
|
261
271
|
)
|
|
262
272
|
is DispatchResult.NonRetryableFailure ->
|
|
263
|
-
Log.w(OBSERVE_TAG, "Dropping batch of ${
|
|
273
|
+
Log.w(OBSERVE_TAG, "Dropping batch of ${sampledLogs.size} log event(s): ${result.reason}")
|
|
264
274
|
DispatchResult.PayloadTooLarge -> if (logs.size == 1) {
|
|
265
275
|
Log.w(OBSERVE_TAG, "Dropping log event that exceeds the server's payload limit")
|
|
266
276
|
}
|
|
@@ -297,7 +307,8 @@ class BaseObservabilityManager(
|
|
|
297
307
|
return
|
|
298
308
|
}
|
|
299
309
|
|
|
300
|
-
|
|
310
|
+
val config = ObservePreferences.getConfig(context)
|
|
311
|
+
if (!shouldDispatch(config, config?.sampleRate)) {
|
|
301
312
|
// Mirrors metrics/logs advancing the cursor past rows they won't send.
|
|
302
313
|
sessionManager.getMaxSpanId()?.let { sessionManager.deleteSpansUpTo(it) }
|
|
303
314
|
return
|
|
@@ -368,14 +379,13 @@ class BaseObservabilityManager(
|
|
|
368
379
|
}
|
|
369
380
|
}
|
|
370
381
|
|
|
371
|
-
private fun isInSample(): Boolean {
|
|
372
|
-
|
|
382
|
+
private fun isInSample(rate: Double?): Boolean {
|
|
383
|
+
rate ?: return true
|
|
373
384
|
val clamped = rate.coerceIn(0.0, 1.0)
|
|
374
385
|
return deterministicUniformValueProvider() < clamped
|
|
375
386
|
}
|
|
376
387
|
|
|
377
|
-
private fun shouldDispatch(): Boolean {
|
|
378
|
-
val config = ObservePreferences.getConfig(context)
|
|
388
|
+
private fun shouldDispatch(config: PersistedConfig?, rate: Double?): Boolean {
|
|
379
389
|
val dispatchingEnabled = config?.dispatchingEnabled ?: true
|
|
380
390
|
val dispatchInDebug = config?.dispatchInDebug ?: false
|
|
381
391
|
// `isDev` is the OR of the JS-bundle dev flag (pushed via `setBundleDefaults` on JS
|
|
@@ -383,7 +393,7 @@ class BaseObservabilityManager(
|
|
|
383
393
|
// bundle should be treated as dev for dispatch-gating.
|
|
384
394
|
val isJsDev = ObservePreferences.getBundleDefaults(context)?.isJsDev ?: false
|
|
385
395
|
val isDev = isDebugBuild || isJsDev
|
|
386
|
-
return dispatchingEnabled && isInSample() && (!isDev || dispatchInDebug)
|
|
396
|
+
return dispatchingEnabled && isInSample(rate) && (!isDev || dispatchInDebug)
|
|
387
397
|
}
|
|
388
398
|
|
|
389
399
|
suspend fun cleanup() {
|
|
@@ -19,6 +19,7 @@ class Config(
|
|
|
19
19
|
@Field val dispatchingEnabled: Boolean? = null,
|
|
20
20
|
@Field val dispatchInDebug: Boolean? = null,
|
|
21
21
|
@Field val sampleRate: Double? = null,
|
|
22
|
+
@Field val errorSampleRate: Double? = null,
|
|
22
23
|
@Field val integrations: Map<String, Any?>? = null
|
|
23
24
|
) : Record
|
|
24
25
|
|
|
@@ -75,7 +76,8 @@ class ObserveModule : Module() {
|
|
|
75
76
|
PersistedConfig(
|
|
76
77
|
dispatchingEnabled = config.dispatchingEnabled,
|
|
77
78
|
dispatchInDebug = config.dispatchInDebug,
|
|
78
|
-
sampleRate = config.sampleRate
|
|
79
|
+
sampleRate = config.sampleRate,
|
|
80
|
+
errorSampleRate = config.errorSampleRate
|
|
79
81
|
)
|
|
80
82
|
)
|
|
81
83
|
// Environment falls back to the bundle default (set on JS package import) so an
|
|
@@ -18,7 +18,8 @@ private const val KEY_LAST_DISPATCHED_LOG_ID = "lastDispatchedLogId"
|
|
|
18
18
|
data class PersistedConfig(
|
|
19
19
|
val dispatchingEnabled: Boolean? = null,
|
|
20
20
|
val dispatchInDebug: Boolean? = null,
|
|
21
|
-
val sampleRate: Double? = null
|
|
21
|
+
val sampleRate: Double? = null,
|
|
22
|
+
val errorSampleRate: Double? = null
|
|
22
23
|
)
|
|
23
24
|
|
|
24
25
|
/**
|
package/build/module.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { requireNativeModule } from 'expo';
|
|
2
|
-
import AppMetrics, { setErrorHandlerEnabled } from 'expo-app-metrics';
|
|
2
|
+
import AppMetrics, { recordSpan, setErrorHandlerEnabled, startSpan, withSpan } from 'expo-app-metrics';
|
|
3
3
|
import { initRouterIntegration } from './integrations/expo-router/init';
|
|
4
4
|
import { isRouterInstalled } from './integrations/expo-router/router';
|
|
5
5
|
import { disableReanimatedIntegration, initReanimatedIntegration } from './integrations/react-native-reanimated/init';
|
|
@@ -35,6 +35,18 @@ import { reportCaughtError } from './reportCaughtError';
|
|
|
35
35
|
enabled
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
|
+
function warnIfErrorSampleRateIsLower({ sampleRate, errorSampleRate }) {
|
|
39
|
+
if (errorSampleRate == null) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
// Native code clamps both rates and treats an unset `sampleRate` as 1.
|
|
43
|
+
const clamp = (rate)=>Math.min(Math.max(rate, 0), 1);
|
|
44
|
+
const errorRate = clamp(errorSampleRate);
|
|
45
|
+
const overallRate = clamp(sampleRate ?? 1);
|
|
46
|
+
if (errorRate < overallRate) {
|
|
47
|
+
console.warn(`[expo-observe] \`errorSampleRate\` (${errorRate}) is lower than \`sampleRate\` (${overallRate}) and has no effect. ` + 'Errors are sent from every installation in the `sampleRate` sample. ' + 'Set `errorSampleRate` to at least `sampleRate`.');
|
|
48
|
+
}
|
|
49
|
+
}
|
|
38
50
|
const native = requireNativeModule('ExpoObserve');
|
|
39
51
|
const Observe = new Proxy(native, {
|
|
40
52
|
get (target, prop, receiver) {
|
|
@@ -71,12 +83,25 @@ const Observe = new Proxy(native, {
|
|
|
71
83
|
} else {
|
|
72
84
|
disableReanimatedIntegration();
|
|
73
85
|
}
|
|
86
|
+
warnIfErrorSampleRateIsLower(config);
|
|
74
87
|
return target.configure(config);
|
|
75
88
|
};
|
|
76
89
|
}
|
|
77
90
|
if (prop === 'reportError') {
|
|
78
91
|
return (error)=>reportCaughtError(error);
|
|
79
92
|
}
|
|
93
|
+
// The span wrappers add JS-side behavior over the raw native functions (`parent` folding,
|
|
94
|
+
// `withSpan`'s auto-end), so forward them explicitly instead of letting the fallback below
|
|
95
|
+
// reach the native members with the same names.
|
|
96
|
+
if (prop === 'startSpan') {
|
|
97
|
+
return startSpan;
|
|
98
|
+
}
|
|
99
|
+
if (prop === 'withSpan') {
|
|
100
|
+
return withSpan;
|
|
101
|
+
}
|
|
102
|
+
if (prop === 'recordSpan') {
|
|
103
|
+
return recordSpan;
|
|
104
|
+
}
|
|
80
105
|
if (prop === 'registerIntegration') {
|
|
81
106
|
return (name, callback)=>registerIntegrationImpl(target, name, callback);
|
|
82
107
|
}
|
package/build/module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["module.ts"],"sourcesContent":[null],"names":["requireNativeModule","AppMetrics","setErrorHandlerEnabled","initRouterIntegration","isRouterInstalled","disableReanimatedIntegration","initReanimatedIntegration","initReactNavigationIntegration","isReactNavigationInstalled","reportCaughtError","networkTracesConfigFromOption","networkTraces","option","enabled","__DEV__","malformed","filter","hosts","host","test","length","console","warn","join","native","Observe","Proxy","get","target","prop","receiver","config","errorHandlingEnabled","setNetworkTracesConfig","routerEnabled","integrations","reactNavigationEnabled","shouldInitRouterIntegration","shouldInitReactNavigationIntegration","reanimatedConfig","configure","error","name","callback","registerIntegrationImpl","Object","keys","includes","Reflect","getIntegrations","subscription","addListener","remove"],"mappings":"AAAA,SAASA,mBAAmB,QAAQ,OAAO;AAC3C,OAAOC,
|
|
1
|
+
{"version":3,"sources":["module.ts"],"sourcesContent":[null],"names":["requireNativeModule","AppMetrics","recordSpan","setErrorHandlerEnabled","startSpan","withSpan","initRouterIntegration","isRouterInstalled","disableReanimatedIntegration","initReanimatedIntegration","initReactNavigationIntegration","isReactNavigationInstalled","reportCaughtError","networkTracesConfigFromOption","networkTraces","option","enabled","__DEV__","malformed","filter","hosts","host","test","length","console","warn","join","warnIfErrorSampleRateIsLower","sampleRate","errorSampleRate","clamp","rate","Math","min","max","errorRate","overallRate","native","Observe","Proxy","get","target","prop","receiver","config","errorHandlingEnabled","setNetworkTracesConfig","routerEnabled","integrations","reactNavigationEnabled","shouldInitRouterIntegration","shouldInitReactNavigationIntegration","reanimatedConfig","configure","error","name","callback","registerIntegrationImpl","Object","keys","includes","Reflect","getIntegrations","subscription","addListener","remove"],"mappings":"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"}
|
package/build/module.web.d.ts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { NativeModule } from 'expo';
|
|
2
|
-
import { type LogEventOptions, type MetricAttributes } from 'expo-app-metrics';
|
|
2
|
+
import { recordSpan, startSpan, withSpan, type LogEventOptions, type MetricAttributes } from 'expo-app-metrics';
|
|
3
3
|
import type { ObserveConfig, ObserveIntegrationsConfig, ObserveModule, ObserveModuleEvents, ObserveAttributes } from './types';
|
|
4
4
|
declare class ExpoObserveModule extends NativeModule<ObserveModuleEvents> implements ObserveModule {
|
|
5
5
|
get clientId(): string | null;
|
|
6
6
|
dispatchEvents(): Promise<void>;
|
|
7
|
+
startSpan: typeof startSpan;
|
|
8
|
+
withSpan: typeof withSpan;
|
|
9
|
+
recordSpan: typeof recordSpan;
|
|
7
10
|
configure(config: ObserveConfig): void;
|
|
8
11
|
getIntegrations(): ObserveIntegrationsConfig;
|
|
9
12
|
registerIntegration<K extends keyof ObserveIntegrationsConfig>(name: K, callback: (config: ObserveIntegrationsConfig[K]) => void): void;
|
package/build/module.web.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { NativeModule, registerWebModule } from 'expo';
|
|
2
|
-
import AppMetrics from 'expo-app-metrics';
|
|
2
|
+
import AppMetrics, { recordSpan, startSpan, withSpan } from 'expo-app-metrics';
|
|
3
3
|
import { reportCaughtError } from './reportCaughtError';
|
|
4
4
|
class ExpoObserveModule extends NativeModule {
|
|
5
5
|
get clientId() {
|
|
@@ -7,6 +7,9 @@ class ExpoObserveModule extends NativeModule {
|
|
|
7
7
|
return null;
|
|
8
8
|
}
|
|
9
9
|
async dispatchEvents() {}
|
|
10
|
+
startSpan = startSpan;
|
|
11
|
+
withSpan = withSpan;
|
|
12
|
+
recordSpan = recordSpan;
|
|
10
13
|
configure(config) {}
|
|
11
14
|
getIntegrations() {
|
|
12
15
|
return {};
|
package/build/module.web.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["module.web.ts"],"sourcesContent":[null],"names":["NativeModule","registerWebModule","AppMetrics","reportCaughtError","ExpoObserveModule","clientId","dispatchEvents","configure","config","getIntegrations","registerIntegration","name","callback","logEvent","options","reportError","error","markFirstRender","markInteractive","attributes","setGlobalAttributes","setBundleDefaults","defaults"],"mappings":"AAAA,SAASA,YAAY,EAAEC,iBAAiB,QAAQ,OAAO;AACvD,OAAOC,
|
|
1
|
+
{"version":3,"sources":["module.web.ts"],"sourcesContent":[null],"names":["NativeModule","registerWebModule","AppMetrics","recordSpan","startSpan","withSpan","reportCaughtError","ExpoObserveModule","clientId","dispatchEvents","configure","config","getIntegrations","registerIntegration","name","callback","logEvent","options","reportError","error","markFirstRender","markInteractive","attributes","setGlobalAttributes","setBundleDefaults","defaults"],"mappings":"AAAA,SAASA,YAAY,EAAEC,iBAAiB,QAAQ,OAAO;AACvD,OAAOC,cACLC,UAAU,EACVC,SAAS,EACTC,QAAQ,QAGH,mBAAmB;AAE1B,SAASC,iBAAiB,QAAQ,sBAAsB;AASxD,MAAMC,0BAA0BP;IAC9B,IAAIQ,WAA0B;QAC5B,qFAAqF;QACrF,OAAO;IACT;IACA,MAAMC,iBAAiB,CAAC;IACxBL,YAAYA,UAAU;IACtBC,WAAWA,SAAS;IACpBF,aAAaA,WAAW;IACxBO,UAAUC,MAAqB,EAAQ,CAAC;IACxCC,kBAA6C;QAC3C,OAAO,CAAC;IACV;IACAC,oBACEC,IAAO,EACPC,QAAwD,EAClD;IACN,6EAA6E;IAC/E;IACAC,SAASF,IAAY,EAAEG,OAAyB,EAAQ;QACtDf,WAAWc,QAAQ,CAACF,MAAMG;IAC5B;IACAC,YAAYC,KAAc,EAAQ;QAChCb,kBAAkBa;IACpB;IACAC,kBAAwB;QACtBlB,WAAWkB,eAAe;IAC5B;IACAC,gBAAgBC,UAA6B,EAAQ;QACnDpB,WAAWmB,eAAe,CAACC;IAC7B;IACAC,oBAAoBD,UAAqC,EAAQ;QAC/DpB,WAAWqB,mBAAmB,CAACD;IACjC;IACAE,kBAAkBC,QAAmD,EAAQ,CAAC;AAChF;AAEA,eAAexB,kBAAkBM,mBAAmB,eAAe"}
|
package/build/types.d.ts
CHANGED
|
@@ -35,8 +35,8 @@ export type ObserveConfig = {
|
|
|
35
35
|
*
|
|
36
36
|
* Has no effect on release builds.
|
|
37
37
|
*
|
|
38
|
-
* If `dispatchingEnabled` is `false
|
|
39
|
-
*
|
|
38
|
+
* If `dispatchingEnabled` is `false`, nothing is dispatched regardless of `dispatchInDebug`.
|
|
39
|
+
* `sampleRate` and `errorSampleRate` also apply in debug builds.
|
|
40
40
|
*
|
|
41
41
|
* @default false
|
|
42
42
|
*/
|
|
@@ -53,11 +53,30 @@ export type ObserveConfig = {
|
|
|
53
53
|
* - If `dispatchingEnabled` is `true` (or unset), metrics are dispatched only when this device
|
|
54
54
|
* is in-sample.
|
|
55
55
|
*
|
|
56
|
+
* Errors follow `errorSampleRate` when it is set and higher.
|
|
57
|
+
*
|
|
56
58
|
* > Note: Devices that end up out-of-sample drop pending metrics rather than accumulating them.
|
|
57
59
|
*
|
|
58
60
|
* @default undefined - metrics from all devices are sent
|
|
59
61
|
*/
|
|
60
62
|
sampleRate?: number;
|
|
63
|
+
/**
|
|
64
|
+
* Fraction of installations that should dispatch errors, in `[0, 1]`. Values outside that range
|
|
65
|
+
* are clamped. Use it to keep more errors than other events, for example, `sampleRate: 0.03` with
|
|
66
|
+
* `errorSampleRate: 1`.
|
|
67
|
+
*
|
|
68
|
+
* Errors include unhandled JavaScript errors, errors from `reportError` and
|
|
69
|
+
* `ObserveErrorBoundary`, and native crash reports. All other events follow `sampleRate`.
|
|
70
|
+
*
|
|
71
|
+
* `errorSampleRate` is a minimum. Installations in-sample for `sampleRate` always send errors. A
|
|
72
|
+
* lower value has no effect, and `configure()` prints a warning. An unset `sampleRate` counts as
|
|
73
|
+
* `1`.
|
|
74
|
+
*
|
|
75
|
+
* `dispatchingEnabled` and `dispatchInDebug` apply to errors the same way as to other events.
|
|
76
|
+
*
|
|
77
|
+
* @default undefined - errors follow `sampleRate`
|
|
78
|
+
*/
|
|
79
|
+
errorSampleRate?: number;
|
|
61
80
|
/**
|
|
62
81
|
* Whether to record unhandled JavaScript errors as `exception` log events.
|
|
63
82
|
*
|
|
@@ -239,6 +258,21 @@ export declare class ObserveModule extends NativeModule<ObserveModuleEvents> {
|
|
|
239
258
|
* ```
|
|
240
259
|
*/
|
|
241
260
|
dispatchEvents(): Promise<void>;
|
|
261
|
+
/**
|
|
262
|
+
* Starts a trace span measuring an operation that is underway. See `startSpan` in
|
|
263
|
+
* `expo-app-metrics` for the full contract.
|
|
264
|
+
*/
|
|
265
|
+
startSpan: typeof import('expo-app-metrics').startSpan;
|
|
266
|
+
/**
|
|
267
|
+
* Runs a callback inside a span that ends automatically. See `withSpan` in
|
|
268
|
+
* `expo-app-metrics` for the full contract.
|
|
269
|
+
*/
|
|
270
|
+
withSpan: typeof import('expo-app-metrics').withSpan;
|
|
271
|
+
/**
|
|
272
|
+
* Records a span for an already-measured operation. See `recordSpan` in `expo-app-metrics`
|
|
273
|
+
* for the full contract.
|
|
274
|
+
*/
|
|
275
|
+
recordSpan: typeof import('expo-app-metrics').recordSpan;
|
|
242
276
|
/**
|
|
243
277
|
* Configures how observability events are collected and dispatched at runtime, such as
|
|
244
278
|
* the environment label, dispatching behavior, sampling, and integrations.
|
package/build/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["types.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["types.ts"],"sourcesContent":[null],"names":[],"mappings":"AAiOA,WAwKC"}
|
package/ios/Observability.swift
CHANGED
|
@@ -33,15 +33,24 @@ internal struct ObservabilityManager {
|
|
|
33
33
|
/// hook waits its turn rather than sending the same rows twice.
|
|
34
34
|
private static let serializer = DispatchSerializer()
|
|
35
35
|
|
|
36
|
+
/// Log names that `errorSampleRate` applies to.
|
|
37
|
+
private nonisolated static let errorLogNames: Set<String> = [jsExceptionLogName, nativeExceptionLogName]
|
|
38
|
+
|
|
36
39
|
internal static func dispatch() async {
|
|
37
40
|
await serializer.run {
|
|
38
41
|
// Per-signal gates are checked inside `dispatchMetrics` / `dispatchLogs` /
|
|
39
42
|
// `dispatchTraces` rather than here, so a backoff on one endpoint doesn't suppress the
|
|
40
43
|
// others' traffic.
|
|
41
|
-
let
|
|
44
|
+
let config = ObserveUserDefaults.config
|
|
45
|
+
let shouldDispatch = Self.shouldDispatch(config: config, rate: config?.sampleRate)
|
|
46
|
+
// Installations in-sample for `sampleRate` send all logs. Errors use the higher of the two rates.
|
|
47
|
+
let shouldDispatchErrors = Self.shouldDispatch(
|
|
48
|
+
config: config,
|
|
49
|
+
rate: config?.errorSampleRate ?? config?.sampleRate
|
|
50
|
+
)
|
|
42
51
|
|
|
43
52
|
await dispatchMetrics(shouldDispatch: shouldDispatch)
|
|
44
|
-
await dispatchLogs(shouldDispatch: shouldDispatch)
|
|
53
|
+
await dispatchLogs(shouldDispatch: shouldDispatch, shouldDispatchErrors: shouldDispatchErrors)
|
|
45
54
|
await dispatchTraces(shouldDispatch: shouldDispatch)
|
|
46
55
|
}
|
|
47
56
|
}
|
|
@@ -145,7 +154,7 @@ internal struct ObservabilityManager {
|
|
|
145
154
|
)
|
|
146
155
|
}
|
|
147
156
|
|
|
148
|
-
private static func dispatchLogs(shouldDispatch: Bool) async {
|
|
157
|
+
private static func dispatchLogs(shouldDispatch: Bool, shouldDispatchErrors: Bool) async {
|
|
149
158
|
guard let endpointUrl = logsEndpointUrl else {
|
|
150
159
|
return
|
|
151
160
|
}
|
|
@@ -156,7 +165,7 @@ internal struct ObservabilityManager {
|
|
|
156
165
|
repairLogCursorIfStale()
|
|
157
166
|
|
|
158
167
|
let cursor = ObserveUserDefaults.lastDispatchedLogId
|
|
159
|
-
if !shouldDispatch {
|
|
168
|
+
if !shouldDispatch && !shouldDispatchErrors {
|
|
160
169
|
do {
|
|
161
170
|
if let highestId = try AppMetrics.getMaxLogId() {
|
|
162
171
|
ObserveUserDefaults.lastDispatchedLogId = highestId
|
|
@@ -167,6 +176,8 @@ internal struct ObservabilityManager {
|
|
|
167
176
|
return
|
|
168
177
|
}
|
|
169
178
|
|
|
179
|
+
// Fewer than `batchCount` when only errors are sent.
|
|
180
|
+
var sentCount = 0
|
|
170
181
|
await DispatchLoop.drain(
|
|
171
182
|
startCursor: cursor,
|
|
172
183
|
fetchBatch: { cursor, limit in
|
|
@@ -177,13 +188,18 @@ internal struct ObservabilityManager {
|
|
|
177
188
|
return logs
|
|
178
189
|
},
|
|
179
190
|
rowId: { $0.id },
|
|
180
|
-
send: {
|
|
191
|
+
send: { fetchedLogs in
|
|
192
|
+
let logs = sampledLogs(fetchedLogs, shouldDispatch: shouldDispatch)
|
|
193
|
+
guard !logs.isEmpty else {
|
|
194
|
+
return nil
|
|
195
|
+
}
|
|
196
|
+
sentCount = logs.count
|
|
181
197
|
let events = try buildEvents(forLogs: logs)
|
|
182
198
|
let resourceLogs = events.compactMap { event -> OTResourceLogs? in
|
|
183
199
|
guard !event.logs.isEmpty else {
|
|
184
200
|
return nil
|
|
185
201
|
}
|
|
186
|
-
return event.toOTResourceLogs(easClientId)
|
|
202
|
+
return event.toOTResourceLogs(easClientId, inSampleRate: shouldDispatch)
|
|
187
203
|
}
|
|
188
204
|
guard !resourceLogs.isEmpty else {
|
|
189
205
|
return nil
|
|
@@ -199,13 +215,13 @@ internal struct ObservabilityManager {
|
|
|
199
215
|
case .partialSuccess(let partial):
|
|
200
216
|
ObserveUserDefaults.lastDispatchDate = Date.now
|
|
201
217
|
observeLogger.warn(
|
|
202
|
-
"[EAS Observe] Partial success on batch of \(
|
|
218
|
+
"[EAS Observe] Partial success on batch of \(sentCount) log row(s) past "
|
|
203
219
|
+ "id \(highestId): server rejected \(partial.rejectedCount) "
|
|
204
220
|
+ "(\(partial.errorMessage ?? "no error message"))"
|
|
205
221
|
)
|
|
206
222
|
case .nonRetryableFailure(let reason):
|
|
207
223
|
observeLogger.warn(
|
|
208
|
-
"[EAS Observe] Dropping batch of \(
|
|
224
|
+
"[EAS Observe] Dropping batch of \(sentCount) log row(s) past id "
|
|
209
225
|
+ "\(highestId): \(reason)"
|
|
210
226
|
)
|
|
211
227
|
case .payloadTooLarge where batchCount == 1:
|
|
@@ -371,18 +387,18 @@ internal struct ObservabilityManager {
|
|
|
371
387
|
return dispatchingEnabled && isInSample && (!isDev || dispatchInDebug)
|
|
372
388
|
}
|
|
373
389
|
|
|
374
|
-
private static func shouldDispatch() -> Bool {
|
|
390
|
+
private static func shouldDispatch(config: PersistedConfig?, rate: Double?) -> Bool {
|
|
375
391
|
let isJsDev = ObserveUserDefaults.bundleDefaults?.isJsDev ?? false
|
|
376
392
|
let isDev = EXAppDefines.APP_DEBUG || isJsDev
|
|
377
|
-
return Self.shouldDispatch(
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
)
|
|
393
|
+
return Self.shouldDispatch(config: config, isDev: isDev, isInSample: isInSample(rate: rate))
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
internal nonisolated static func sampledLogs(_ logs: [LogRow], shouldDispatch: Bool) -> [LogRow] {
|
|
397
|
+
return shouldDispatch ? logs : logs.filter { errorLogNames.contains($0.name) }
|
|
382
398
|
}
|
|
383
399
|
|
|
384
|
-
private static func isInSample() -> Bool {
|
|
385
|
-
guard let rate
|
|
400
|
+
private static func isInSample(rate: Double?) -> Bool {
|
|
401
|
+
guard let rate else {
|
|
386
402
|
return true
|
|
387
403
|
}
|
|
388
404
|
let clamped = min(max(rate, 0.0), 1.0)
|
package/ios/ObserveModule.swift
CHANGED
|
@@ -11,6 +11,7 @@ internal struct Config: Record {
|
|
|
11
11
|
@Field var dispatchingEnabled: Bool?
|
|
12
12
|
@Field var dispatchInDebug: Bool?
|
|
13
13
|
@Field var sampleRate: Double?
|
|
14
|
+
@Field var errorSampleRate: Double?
|
|
14
15
|
@Field var integrations: [String: Any]?
|
|
15
16
|
}
|
|
16
17
|
|
|
@@ -51,7 +52,8 @@ public final class ObserveModule: Module {
|
|
|
51
52
|
PersistedConfig(
|
|
52
53
|
dispatchingEnabled: config.dispatchingEnabled,
|
|
53
54
|
dispatchInDebug: config.dispatchInDebug,
|
|
54
|
-
sampleRate: config.sampleRate
|
|
55
|
+
sampleRate: config.sampleRate,
|
|
56
|
+
errorSampleRate: config.errorSampleRate
|
|
55
57
|
)
|
|
56
58
|
)
|
|
57
59
|
let resolvedEnvironment = config.environment ?? ObserveUserDefaults.bundleDefaults?.environment
|
package/ios/OpenTelemetry.swift
CHANGED
|
@@ -280,10 +280,11 @@ extension Event.Metric {
|
|
|
280
280
|
}
|
|
281
281
|
|
|
282
282
|
extension Event.Log {
|
|
283
|
-
func toOTLogRecord() -> OTLogRecord {
|
|
283
|
+
func toOTLogRecord(inSampleRate: Bool) -> OTLogRecord {
|
|
284
284
|
var attributes: [OTAttribute] = [
|
|
285
285
|
OTAttribute(key: "session.id", rawValue: sessionId),
|
|
286
286
|
OTAttribute(key: "event.name", rawValue: name),
|
|
287
|
+
OTAttribute(key: "expo.in_sample_rate", value: .bool(inSampleRate)),
|
|
287
288
|
]
|
|
288
289
|
|
|
289
290
|
var encodeTimeDrops = 0
|
|
@@ -528,13 +529,13 @@ extension Event {
|
|
|
528
529
|
)
|
|
529
530
|
}
|
|
530
531
|
|
|
531
|
-
func toOTResourceLogs(_ easClientId: String) -> OTResourceLogs {
|
|
532
|
+
func toOTResourceLogs(_ easClientId: String, inSampleRate: Bool) -> OTResourceLogs {
|
|
532
533
|
OTResourceLogs(
|
|
533
534
|
resource: toOTMetadata(easClientId),
|
|
534
535
|
scopeLogs: [
|
|
535
536
|
OTScopeLogs(
|
|
536
537
|
scope: OTScope(name: "expo-observe", version: ObserveVersions.clientVersion),
|
|
537
|
-
logRecords: self.logs.map { $0.toOTLogRecord() }
|
|
538
|
+
logRecords: self.logs.map { $0.toOTLogRecord(inSampleRate: inSampleRate) }
|
|
538
539
|
)
|
|
539
540
|
],
|
|
540
541
|
schemaUrl: semConvSchemaUrl
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import ExpoAppMetrics
|
|
1
2
|
import Testing
|
|
2
3
|
|
|
3
4
|
@testable import ExpoObserve
|
|
@@ -74,3 +75,22 @@ struct ObservabilityShouldDispatchTests {
|
|
|
74
75
|
)
|
|
75
76
|
}
|
|
76
77
|
}
|
|
78
|
+
|
|
79
|
+
@Suite("Observability.sampledLogs")
|
|
80
|
+
struct ObservabilitySampledLogsTests {
|
|
81
|
+
private let logs = ["info", "js.exception", "native.exception"].map {
|
|
82
|
+
LogRow(sessionId: "s", timestamp: "2025-01-01T00:00:00Z", severity: "error", name: $0)
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
@Test
|
|
86
|
+
func `out-of-sample for sampleRate keeps only exception logs`() {
|
|
87
|
+
let result = ObservabilityManager.sampledLogs(logs, shouldDispatch: false)
|
|
88
|
+
#expect(result.map(\.name) == ["js.exception", "native.exception"])
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
@Test
|
|
92
|
+
func `in-sample for sampleRate keeps all logs`() {
|
|
93
|
+
let result = ObservabilityManager.sampledLogs(logs, shouldDispatch: true)
|
|
94
|
+
#expect(result.map(\.name) == ["info", "js.exception", "native.exception"])
|
|
95
|
+
}
|
|
96
|
+
}
|
|
@@ -167,12 +167,39 @@ struct OpenTelemetryTests {
|
|
|
167
167
|
droppedAttributesCount: 0,
|
|
168
168
|
sessionId: testSessionId
|
|
169
169
|
)
|
|
170
|
-
let otLog = log.toOTLogRecord()
|
|
170
|
+
let otLog = log.toOTLogRecord(inSampleRate: true)
|
|
171
171
|
|
|
172
172
|
#expect(otLog.timeUnixNano == 1_767_960_489_123_000_000)
|
|
173
173
|
#expect(otLog.observedTimeUnixNano == 1_767_960_489_123_000_000)
|
|
174
174
|
}
|
|
175
175
|
|
|
176
|
+
@Test(arguments: [true, false])
|
|
177
|
+
func `toOTLogRecord marks all logs with whether the installation is in the sampleRate sample`(
|
|
178
|
+
inSampleRate: Bool
|
|
179
|
+
) {
|
|
180
|
+
for name in ["auth.login_failed", "js.exception", "native.exception"] {
|
|
181
|
+
let otLog = makeLog(name: name).toOTLogRecord(inSampleRate: inSampleRate)
|
|
182
|
+
let attribute = otLog.attributes.first { $0.key == "expo.in_sample_rate" }
|
|
183
|
+
guard case .bool(let value) = attribute?.value else {
|
|
184
|
+
Issue.record("Expected a bool `expo.in_sample_rate` attribute on \(name)")
|
|
185
|
+
continue
|
|
186
|
+
}
|
|
187
|
+
#expect(value == inSampleRate)
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
private func makeLog(name: String) -> Event.Log {
|
|
192
|
+
Event.Log(
|
|
193
|
+
name: name,
|
|
194
|
+
body: nil,
|
|
195
|
+
timestamp: "2026-01-09T12:08:09.123Z",
|
|
196
|
+
severity: .error,
|
|
197
|
+
attributes: nil,
|
|
198
|
+
droppedAttributesCount: 0,
|
|
199
|
+
sessionId: testSessionId
|
|
200
|
+
)
|
|
201
|
+
}
|
|
202
|
+
|
|
176
203
|
// MARK: - Event metadata
|
|
177
204
|
|
|
178
205
|
@Test
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
22e72a2a942ec173b8a68535eec565e9
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
d973a45bf489c9b2f97a237bec92ec1e44103221
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
9d17124d68e67a693b846aca1f53214ecd016881961212da2017a4c2083495c4
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
51806c5ed3277fe720a758229c784c20149cc60570da38de6de28a450a93ad2456676e3d8499817e3ff538b7cebbe16c793b64b26f6cabc1f61f9079af39c446
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
a4748f031da71777294942fa47c8e5b2
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
b1c4a933ef4946146812e45129757a95ed7081ef
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
8620329eb54467943926a1cf7ab4bb42630304a4e897562dffd3f4c4add7f1d1
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0ae6526afe06e5b0657e936ecf8b9c9e87b548eb81e8146a72664e07aeff0c47dea98b04c54745d852df4720b48115cc29d9554e4a7ed34df7bce057d1fbea44
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"component": {
|
|
4
4
|
"group": "expo.modules.observe",
|
|
5
5
|
"module": "expo.modules.observe",
|
|
6
|
-
"version": "58.0.
|
|
6
|
+
"version": "58.0.18",
|
|
7
7
|
"attributes": {
|
|
8
8
|
"org.gradle.status": "release"
|
|
9
9
|
}
|
|
@@ -24,13 +24,13 @@
|
|
|
24
24
|
},
|
|
25
25
|
"files": [
|
|
26
26
|
{
|
|
27
|
-
"name": "expo.modules.observe-58.0.
|
|
28
|
-
"url": "expo.modules.observe-58.0.
|
|
29
|
-
"size":
|
|
30
|
-
"sha512": "
|
|
31
|
-
"sha256": "
|
|
32
|
-
"sha1": "
|
|
33
|
-
"md5": "
|
|
27
|
+
"name": "expo.modules.observe-58.0.18.aar",
|
|
28
|
+
"url": "expo.modules.observe-58.0.18.aar",
|
|
29
|
+
"size": 305317,
|
|
30
|
+
"sha512": "0ae6526afe06e5b0657e936ecf8b9c9e87b548eb81e8146a72664e07aeff0c47dea98b04c54745d852df4720b48115cc29d9554e4a7ed34df7bce057d1fbea44",
|
|
31
|
+
"sha256": "8620329eb54467943926a1cf7ab4bb42630304a4e897562dffd3f4c4add7f1d1",
|
|
32
|
+
"sha1": "b1c4a933ef4946146812e45129757a95ed7081ef",
|
|
33
|
+
"md5": "a4748f031da71777294942fa47c8e5b2"
|
|
34
34
|
}
|
|
35
35
|
]
|
|
36
36
|
},
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"group": "expo.modules.appmetrics",
|
|
62
62
|
"module": "expo.modules.appmetrics",
|
|
63
63
|
"version": {
|
|
64
|
-
"requires": "58.0.
|
|
64
|
+
"requires": "58.0.15"
|
|
65
65
|
}
|
|
66
66
|
},
|
|
67
67
|
{
|
|
@@ -120,13 +120,13 @@
|
|
|
120
120
|
],
|
|
121
121
|
"files": [
|
|
122
122
|
{
|
|
123
|
-
"name": "expo.modules.observe-58.0.
|
|
124
|
-
"url": "expo.modules.observe-58.0.
|
|
125
|
-
"size":
|
|
126
|
-
"sha512": "
|
|
127
|
-
"sha256": "
|
|
128
|
-
"sha1": "
|
|
129
|
-
"md5": "
|
|
123
|
+
"name": "expo.modules.observe-58.0.18.aar",
|
|
124
|
+
"url": "expo.modules.observe-58.0.18.aar",
|
|
125
|
+
"size": 305317,
|
|
126
|
+
"sha512": "0ae6526afe06e5b0657e936ecf8b9c9e87b548eb81e8146a72664e07aeff0c47dea98b04c54745d852df4720b48115cc29d9554e4a7ed34df7bce057d1fbea44",
|
|
127
|
+
"sha256": "8620329eb54467943926a1cf7ab4bb42630304a4e897562dffd3f4c4add7f1d1",
|
|
128
|
+
"sha1": "b1c4a933ef4946146812e45129757a95ed7081ef",
|
|
129
|
+
"md5": "a4748f031da71777294942fa47c8e5b2"
|
|
130
130
|
}
|
|
131
131
|
]
|
|
132
132
|
},
|
|
@@ -140,13 +140,13 @@
|
|
|
140
140
|
},
|
|
141
141
|
"files": [
|
|
142
142
|
{
|
|
143
|
-
"name": "expo.modules.observe-58.0.
|
|
144
|
-
"url": "expo.modules.observe-58.0.
|
|
145
|
-
"size":
|
|
146
|
-
"sha512": "
|
|
147
|
-
"sha256": "
|
|
148
|
-
"sha1": "
|
|
149
|
-
"md5": "
|
|
143
|
+
"name": "expo.modules.observe-58.0.18-sources.jar",
|
|
144
|
+
"url": "expo.modules.observe-58.0.18-sources.jar",
|
|
145
|
+
"size": 28281,
|
|
146
|
+
"sha512": "51806c5ed3277fe720a758229c784c20149cc60570da38de6de28a450a93ad2456676e3d8499817e3ff538b7cebbe16c793b64b26f6cabc1f61f9079af39c446",
|
|
147
|
+
"sha256": "9d17124d68e67a693b846aca1f53214ecd016881961212da2017a4c2083495c4",
|
|
148
|
+
"sha1": "d973a45bf489c9b2f97a237bec92ec1e44103221",
|
|
149
|
+
"md5": "22e72a2a942ec173b8a68535eec565e9"
|
|
150
150
|
}
|
|
151
151
|
]
|
|
152
152
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
31b595c8579b3bc3811383dba0bf23fb
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
7a2ad62b9ddfb45a83b6bd206bdd3ebde7b00966
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
953c0c3c9be8c99aa7929223451c38176bc4424afb56933cfbe407234c3df204
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
115afa326b632f6e7d4cfe2a5f0d8835ebdd00c1615178a1bbe78f2c85bee06a99333253f255885063addc90be6b4478c24574a2ea1473c537e25d6ed4f6c9af
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<modelVersion>4.0.0</modelVersion>
|
|
10
10
|
<groupId>expo.modules.observe</groupId>
|
|
11
11
|
<artifactId>expo.modules.observe</artifactId>
|
|
12
|
-
<version>58.0.
|
|
12
|
+
<version>58.0.18</version>
|
|
13
13
|
<packaging>aar</packaging>
|
|
14
14
|
<name>expo.modules.observe</name>
|
|
15
15
|
<url>https://github.com/expo/expo</url>
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
<dependency>
|
|
53
53
|
<groupId>expo.modules.appmetrics</groupId>
|
|
54
54
|
<artifactId>expo.modules.appmetrics</artifactId>
|
|
55
|
-
<version>58.0.
|
|
55
|
+
<version>58.0.15</version>
|
|
56
56
|
<scope>runtime</scope>
|
|
57
57
|
</dependency>
|
|
58
58
|
<dependency>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
a3e39a109c0215ec09495925d7cb95b5
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
df1e981c7ba0915961c2ab985770e116f9329c8a
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
54416a62dfe33e315ec4c108e238144bde031cbf628f83300be817f728de4b63
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
5f050fd894c658878cbc95e9f5cd217f23e443b0ea21e910ec701011a101521e9b8d3e93949c656060ac68d173bd6b4542afaf91d1ed87c5d4e7f7f2a07178d6
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-observe",
|
|
3
|
-
"version": "58.0.
|
|
3
|
+
"version": "58.0.18",
|
|
4
4
|
"description": "Expo module that dispatches collected app metrics to EAS Observe",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"EAS",
|
|
@@ -42,15 +42,15 @@
|
|
|
42
42
|
}
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"expo-app-metrics": "~58.0.
|
|
45
|
+
"expo-app-metrics": "~58.0.15",
|
|
46
46
|
"expo-eas-client": "~58.0.2"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@expo/internal-scripts": "58.0.
|
|
49
|
+
"@expo/internal-scripts": "58.0.6",
|
|
50
50
|
"@react-navigation/native": "^7.1.33",
|
|
51
51
|
"@testing-library/react-native": "^14.0.1",
|
|
52
52
|
"@types/react": "~19.3.0",
|
|
53
|
-
"expo": "58.0.
|
|
53
|
+
"expo": "58.0.23",
|
|
54
54
|
"react-native-reanimated": "4.7.0",
|
|
55
55
|
"react-native-worklets": "0.13.0"
|
|
56
56
|
},
|
package/src/module.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { requireNativeModule } from 'expo';
|
|
2
|
-
import AppMetrics, {
|
|
2
|
+
import AppMetrics, {
|
|
3
|
+
recordSpan,
|
|
4
|
+
setErrorHandlerEnabled,
|
|
5
|
+
startSpan,
|
|
6
|
+
withSpan,
|
|
7
|
+
} from 'expo-app-metrics';
|
|
3
8
|
|
|
4
9
|
import { initRouterIntegration } from './integrations/expo-router/init';
|
|
5
10
|
import { isRouterInstalled } from './integrations/expo-router/router';
|
|
@@ -39,6 +44,23 @@ function networkTracesConfigFromOption(networkTraces: ObserveConfig['networkTrac
|
|
|
39
44
|
return option.filter != null ? { enabled, filter: option.filter } : { enabled };
|
|
40
45
|
}
|
|
41
46
|
|
|
47
|
+
function warnIfErrorSampleRateIsLower({ sampleRate, errorSampleRate }: ObserveConfig) {
|
|
48
|
+
if (errorSampleRate == null) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
// Native code clamps both rates and treats an unset `sampleRate` as 1.
|
|
52
|
+
const clamp = (rate: number) => Math.min(Math.max(rate, 0), 1);
|
|
53
|
+
const errorRate = clamp(errorSampleRate);
|
|
54
|
+
const overallRate = clamp(sampleRate ?? 1);
|
|
55
|
+
if (errorRate < overallRate) {
|
|
56
|
+
console.warn(
|
|
57
|
+
`[expo-observe] \`errorSampleRate\` (${errorRate}) is lower than \`sampleRate\` (${overallRate}) and has no effect. ` +
|
|
58
|
+
'Errors are sent from every installation in the `sampleRate` sample. ' +
|
|
59
|
+
'Set `errorSampleRate` to at least `sampleRate`.'
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
42
64
|
const native = requireNativeModule<ObserveModule>('ExpoObserve');
|
|
43
65
|
|
|
44
66
|
const Observe: ObserveModule = new Proxy(native, {
|
|
@@ -90,6 +112,7 @@ const Observe: ObserveModule = new Proxy(native, {
|
|
|
90
112
|
} else {
|
|
91
113
|
disableReanimatedIntegration();
|
|
92
114
|
}
|
|
115
|
+
warnIfErrorSampleRateIsLower(config);
|
|
93
116
|
return target.configure(config);
|
|
94
117
|
};
|
|
95
118
|
}
|
|
@@ -98,6 +121,19 @@ const Observe: ObserveModule = new Proxy(native, {
|
|
|
98
121
|
return (error: unknown) => reportCaughtError(error);
|
|
99
122
|
}
|
|
100
123
|
|
|
124
|
+
// The span wrappers add JS-side behavior over the raw native functions (`parent` folding,
|
|
125
|
+
// `withSpan`'s auto-end), so forward them explicitly instead of letting the fallback below
|
|
126
|
+
// reach the native members with the same names.
|
|
127
|
+
if (prop === 'startSpan') {
|
|
128
|
+
return startSpan;
|
|
129
|
+
}
|
|
130
|
+
if (prop === 'withSpan') {
|
|
131
|
+
return withSpan;
|
|
132
|
+
}
|
|
133
|
+
if (prop === 'recordSpan') {
|
|
134
|
+
return recordSpan;
|
|
135
|
+
}
|
|
136
|
+
|
|
101
137
|
if (prop === 'registerIntegration') {
|
|
102
138
|
return <K extends keyof ObserveIntegrationsConfig>(
|
|
103
139
|
name: K,
|
package/src/module.web.ts
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { NativeModule, registerWebModule } from 'expo';
|
|
2
|
-
import AppMetrics, {
|
|
2
|
+
import AppMetrics, {
|
|
3
|
+
recordSpan,
|
|
4
|
+
startSpan,
|
|
5
|
+
withSpan,
|
|
6
|
+
type LogEventOptions,
|
|
7
|
+
type MetricAttributes,
|
|
8
|
+
} from 'expo-app-metrics';
|
|
3
9
|
|
|
4
10
|
import { reportCaughtError } from './reportCaughtError';
|
|
5
11
|
import type {
|
|
@@ -16,6 +22,9 @@ class ExpoObserveModule extends NativeModule<ObserveModuleEvents> implements Obs
|
|
|
16
22
|
return null;
|
|
17
23
|
}
|
|
18
24
|
async dispatchEvents() {}
|
|
25
|
+
startSpan = startSpan;
|
|
26
|
+
withSpan = withSpan;
|
|
27
|
+
recordSpan = recordSpan;
|
|
19
28
|
configure(config: ObserveConfig): void {}
|
|
20
29
|
getIntegrations(): ObserveIntegrationsConfig {
|
|
21
30
|
return {};
|
package/src/types.ts
CHANGED
|
@@ -43,8 +43,8 @@ export type ObserveConfig = {
|
|
|
43
43
|
*
|
|
44
44
|
* Has no effect on release builds.
|
|
45
45
|
*
|
|
46
|
-
* If `dispatchingEnabled` is `false
|
|
47
|
-
*
|
|
46
|
+
* If `dispatchingEnabled` is `false`, nothing is dispatched regardless of `dispatchInDebug`.
|
|
47
|
+
* `sampleRate` and `errorSampleRate` also apply in debug builds.
|
|
48
48
|
*
|
|
49
49
|
* @default false
|
|
50
50
|
*/
|
|
@@ -61,11 +61,30 @@ export type ObserveConfig = {
|
|
|
61
61
|
* - If `dispatchingEnabled` is `true` (or unset), metrics are dispatched only when this device
|
|
62
62
|
* is in-sample.
|
|
63
63
|
*
|
|
64
|
+
* Errors follow `errorSampleRate` when it is set and higher.
|
|
65
|
+
*
|
|
64
66
|
* > Note: Devices that end up out-of-sample drop pending metrics rather than accumulating them.
|
|
65
67
|
*
|
|
66
68
|
* @default undefined - metrics from all devices are sent
|
|
67
69
|
*/
|
|
68
70
|
sampleRate?: number;
|
|
71
|
+
/**
|
|
72
|
+
* Fraction of installations that should dispatch errors, in `[0, 1]`. Values outside that range
|
|
73
|
+
* are clamped. Use it to keep more errors than other events, for example, `sampleRate: 0.03` with
|
|
74
|
+
* `errorSampleRate: 1`.
|
|
75
|
+
*
|
|
76
|
+
* Errors include unhandled JavaScript errors, errors from `reportError` and
|
|
77
|
+
* `ObserveErrorBoundary`, and native crash reports. All other events follow `sampleRate`.
|
|
78
|
+
*
|
|
79
|
+
* `errorSampleRate` is a minimum. Installations in-sample for `sampleRate` always send errors. A
|
|
80
|
+
* lower value has no effect, and `configure()` prints a warning. An unset `sampleRate` counts as
|
|
81
|
+
* `1`.
|
|
82
|
+
*
|
|
83
|
+
* `dispatchingEnabled` and `dispatchInDebug` apply to errors the same way as to other events.
|
|
84
|
+
*
|
|
85
|
+
* @default undefined - errors follow `sampleRate`
|
|
86
|
+
*/
|
|
87
|
+
errorSampleRate?: number;
|
|
69
88
|
/**
|
|
70
89
|
* Whether to record unhandled JavaScript errors as `exception` log events.
|
|
71
90
|
*
|
|
@@ -251,6 +270,21 @@ export declare class ObserveModule extends NativeModule<ObserveModuleEvents> {
|
|
|
251
270
|
* ```
|
|
252
271
|
*/
|
|
253
272
|
dispatchEvents(): Promise<void>;
|
|
273
|
+
/**
|
|
274
|
+
* Starts a trace span measuring an operation that is underway. See `startSpan` in
|
|
275
|
+
* `expo-app-metrics` for the full contract.
|
|
276
|
+
*/
|
|
277
|
+
startSpan: typeof import('expo-app-metrics').startSpan;
|
|
278
|
+
/**
|
|
279
|
+
* Runs a callback inside a span that ends automatically. See `withSpan` in
|
|
280
|
+
* `expo-app-metrics` for the full contract.
|
|
281
|
+
*/
|
|
282
|
+
withSpan: typeof import('expo-app-metrics').withSpan;
|
|
283
|
+
/**
|
|
284
|
+
* Records a span for an already-measured operation. See `recordSpan` in `expo-app-metrics`
|
|
285
|
+
* for the full contract.
|
|
286
|
+
*/
|
|
287
|
+
recordSpan: typeof import('expo-app-metrics').recordSpan;
|
|
254
288
|
/**
|
|
255
289
|
* Configures how observability events are collected and dispatched at runtime, such as
|
|
256
290
|
* the environment label, dispatching behavior, sampling, and integrations.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
bc36911379b343732be2f3df50a2c14b
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
17f8c1f8af252d5e1721081daae591e5f92261bb
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
5faf8d8dcbbe36c51acc4cfd7066d6dee9d772cf68c9b8f457f2df299791eeab
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
b65664c9c99601a0014e660f6c7fe2e172a032cf15facc172a292b2b8bac545958add922e36effe9bd86c458ffb2a62ba97f9fb0eda4a44cdd446b8a8dea0281
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
d29663f53a037cf237e4b7400305097f
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
47c2333354b2bc1a1b1a1b2b86b8e5e5699f65c7
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
67b1133f495ca2fecb64de1fc79657c44bc5890b4b61fccbe7e2481c5d810482
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
f927328abd1132efa30a503893024cc9f063ceb7985821643a29b5e40e292539d5b01c67aebd534a9f8784e337511a1be7210fc0639edb6bafde6ad3f46047cc
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
29583563068345652124c039e7dced50
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
2943994e654d7be6d86df4b384549a3ef3ca9adc
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
0a63f9f7f5b511796b63d112cdfa12f3a167df95f75b08168f91cb9e6818007d
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
2f98bedef0440da540ea2d07259128aa6327fda8ad71f0c4b16857dc01a370d41c3259a81270c63e754c10992f44b887f25b35e1fc4a4ab78d3babef06ee2531
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
043cf217fb6d5ea6008a8cd791dea9f2
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
25beb0b27f0f32c67f50a2b9580fbe51502f1278
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
354e6f715a0e226d345c2922e6ffa8119ccb89cf60c274c303cc17f89e1d887a
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
7eb9ca73697a96b3418cfdcc0cc4198e9cb2e7f26503992e9b2e1253cfcd5ebbbed835a64b5dc27c050fd6ec7778eb10d5e065d6532ba80a24c67671ad01f895
|