From 9bbde5be9a0168d1c2a0308bfc27167ed62f3968 Mon Sep 17 00:00:00 2001 From: Patrick Roza Date: Wed, 20 Mar 2024 21:09:54 +0100 Subject: [PATCH] fix: default effect counters should be right type. (#2373) Co-authored-by: Tim --- .changeset/small-pets-fold.md | 5 +++++ packages/effect/src/internal/fiberRuntime.ts | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 .changeset/small-pets-fold.md diff --git a/.changeset/small-pets-fold.md b/.changeset/small-pets-fold.md new file mode 100644 index 00000000000..943625226a6 --- /dev/null +++ b/.changeset/small-pets-fold.md @@ -0,0 +1,5 @@ +--- +"effect": patch +--- + +Use incremental counters instead of up-down for runtime metrics diff --git a/packages/effect/src/internal/fiberRuntime.ts b/packages/effect/src/internal/fiberRuntime.ts index 352b0114f33..5d512f527bc 100644 --- a/packages/effect/src/internal/fiberRuntime.ts +++ b/packages/effect/src/internal/fiberRuntime.ts @@ -71,13 +71,13 @@ import * as tracer from "./tracer.js" import * as version from "./version.js" /** @internal */ -export const fiberStarted = metric.counter("effect_fiber_started") +export const fiberStarted = metric.counter("effect_fiber_started", { incremental: true }) /** @internal */ export const fiberActive = metric.counter("effect_fiber_active") /** @internal */ -export const fiberSuccesses = metric.counter("effect_fiber_successes") +export const fiberSuccesses = metric.counter("effect_fiber_successes", { incremental: true }) /** @internal */ -export const fiberFailures = metric.counter("effect_fiber_failures") +export const fiberFailures = metric.counter("effect_fiber_failures", { incremental: true }) /** @internal */ export const fiberLifetimes = metric.tagged( metric.histogram(