Skip to content
← All rules
ObservabilityError telemetry

observability/no-duplicate-error-reporting

A catch handler should not send multiple recognized reports for the same exception unless a visible policy intentionally requires dual emission.

loggingexceptionsduplicates
TypeScript
catch (error) { logger.error(error); telemetry.captureException(error); }
Finding

Do not report the same caught failure twice.

Setup

Install the package, register its plugin factory, then enable the rule.

Install the package

pnpm add -D @scruple/observability

Register the plugin

In scruple.config.ts, register the factory under the observability namespace used by the rule ID.

import { observability } from "@scruple/observability";

plugins: {
  "observability": observability(),
},

Enable the rule

"observability/no-duplicate-error-reporting": "warn"
Package
@scruple/observability
Default threshold
Plugin default
Minimum confidence
0.7

Released under the MIT License.