Pure quota decisions shared by the enforcement points: the proxy ingest gate (telemetry) and the worker's investigation gate (credits). All inputs are plain numbers the caller has already loaded for the current billing period — this module never touches a database or ClickHouse.
// Source: https://github.com/superloglabs/superlog | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
// Pure quota decisions shared by the enforcement points: the proxy ingest gate
// (telemetry) and the worker's investigation gate (credits). All inputs are
// plain numbers the caller has already loaded for the current billing period —
// this module never touches a database or ClickHouse.
import { type Plan, type SignalType, telemetryOverageUsd } from "./pricing.js";
export type TelemetryQuotaDecision =
| { allowed: true; overageEvents: number; overageUsd: number }
| { allowed: false; reason: "over_free_cap" };
// Decide whether `incoming` more events of `signal` may be ing
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key