Skip to content

Instantly share code, notes, and snippets.

View amerryma's full-sized avatar

Aaron Merryman amerryma

View GitHub Profile
@amerryma
amerryma / gauge.ts
Created April 17, 2025 19:04 — forked from jakebiesinger-storyhealth/gauge.ts
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).
*