Skip to content

Sentry: forbidden-tag filter for native-SDK metric emissions #191

Description

@gmaclennan

Part of #74. Deferred from PR #111 (called out in its description).

The JS and Node metric paths both run a defensive filter (isForbiddenMetric, shared regex list in src/sentry-scrub.ts + backend/before-send.js) that drops any metric emission carrying a forbidden attribute (raw device model, project id, coordinate-shaped values, etc.).

The Kotlin and Swift layers do not have an equivalent: SentryFgsBridge.countMetric (Android) and SentryNativeBridge.countMetric (iOS) forward attributes to the Sentry SDK unfiltered. Today the only native metric is comapeo.app.exit, whose attributes are low-cardinality by construction, so exposure is minimal — but any future native metric would ship without the belt-and-suspenders check the other two layers have.

Done when

  • A small forbidden-name/value check runs before Sentry.metrics() / SentrySDK.metrics calls on both platforms, mirroring the JS list (the list is short and changes rarely; a hand-mirrored copy with a pointer comment matches how the event scrubbers are kept in sync)
  • Unit tests on both platforms: a forbidden attribute drops the emission, ordinary exit-metric attributes pass

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: P3Low priority / nice-to-have

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions