Skip to main content

Anomaly (7.x Beta)

7.x Beta

Anomaly detection is new in 7.0.0-beta6 and may still evolve.

The anomaly detector piggybacks on the SDK's APM subsystem: every completed transaction is fed through a per-bucket statistical baseline (exponentially weighted mean and variance, with a z-score severity), and outliers are reported back into the standard issue / breadcrumb pipelines. The shipped detector is purely statistical — no machine-learning models are used.

Requires APM

Anomaly detection consumes APM transactions, so it does nothing unless Options.PerformanceMonitoring is also enabled (it is on by default). The provider refuses to start when APM is disabled.

Configuration

FormSetting
Manifest meta-data<meta-data android:name="com.bugsee.option.detect.anomaly" android:value="true" />
Bugsee.launch() mapoptions.put(Options.DetectAndReportAnomaly, true)
Defaultfalse
<meta-data android:name="com.bugsee.option.detect.anomaly"
android:value="true" />

How outliers are surfaced

SeverityWhat you get
> 0.9An error report with ExceptionOptions.Domain set to anomaly.duration or anomaly.throughput so the backend can group anomalies by kind.
0.50.9A bugsee_event:"anomaly" breadcrumb with the bucket key and severity.
< 0.5Silent — the sample only updates the underlying baseline.

Reports are deduplicated per session per bucket; subsequent occurrences fall through to the breadcrumb path.

Bucketing

Baselines are maintained per bucket, not per raw operation, so requests to different hosts / paths or queries with different shapes don't dilute each other. Bundled bucket-key builders:

BuilderBucket key
HttpClientBucketKeyBuildermethod + host + templated path (numeric segments → {id}, UUIDs → {uuid}, long hex → {hex})
DbBucketKeyBuilderop + normalised SQL (literals → ?)
UiActivityBucketKeyBuilderop + activity class

A BucketKeyResolver.standard() ships with five builders pre-registered — the three above plus FileIOBucketKeyBuilder (for file.* spans) and a catch-all DefaultBucketKeyBuilder (so spans without a dedicated builder still bucket sensibly). Apps that build their own custom transactions can implement BucketKeyBuilder and register additional resolvers.

EWMA baselines are persisted across sessions, so the detector stabilises quickly even on cold launches.

See also

Found an issue, typo, or wrong statement on this page? Report it now →