Skip to content

Instantly share code, notes, and snippets.

@jakebiesinger-storyhealth
jakebiesinger-storyhealth / gauge.ts
Last active April 17, 2025 19:04
Graphile worker + OpenTelemetry metrics
import { Observable } from '@opentelemetry/api';
import debug from 'debug';
import { deepEqual } from 'fast-equals';
import { DateTime, Duration } from 'luxon';
const debugLog = debug('graphile-worker:metrics');
/**
* A wrapper around an OpenTelemetry gauge, allowing synchronous reporting of values (which are still collected asynchronously).
*