Cloudflare Prometheus Exporter

This commit is contained in:
Dillon Mulroy
2025-12-07 22:38:22 -05:00
committed by dmmulroy
parent 8cb54fc243
commit e64d93a520
39 changed files with 179753 additions and 1699 deletions

View File

@@ -1,16 +1,41 @@
/* eslint-disable */
// Generated by Wrangler by running `wrangler types` (hash: 543f992083f7639592591242de0b7088)
// Runtime types generated with workerd@1.20251125.0 2025-12-02
// Generated by Wrangler by running `wrangler types` (hash: d16ad07d8f190b43581686102026ae12)
// Runtime types generated with workerd@1.20251202.0 2025-12-09 nodejs_compat
declare namespace Cloudflare {
interface GlobalProps {
mainModule: typeof import("./src/index");
durableNamespaces: "MyDurableObject";
mainModule: typeof import("./src/worker");
durableNamespaces: "MetricExporter" | "MetricCoordinator" | "AccountMetricCoordinator";
}
interface Env {
MY_DURABLE_OBJECT: DurableObjectNamespace<import("./src/index").MyDurableObject>;
CONFIG_KV: KVNamespace;
QUERY_LIMIT: 10000;
SCRAPE_DELAY_SECONDS: 300;
TIME_WINDOW_SECONDS: 60;
METRIC_REFRESH_INTERVAL_SECONDS: 60;
LOG_FORMAT: "json";
LOG_LEVEL: "info";
ACCOUNT_LIST_CACHE_TTL_SECONDS: 600;
ZONE_LIST_CACHE_TTL_SECONDS: 1800;
SSL_CERTS_CACHE_TTL_SECONDS: 1800;
EXCLUDE_HOST: false;
CF_HTTP_STATUS_GROUP: false;
METRICS_PATH: "/metrics";
DISABLE_UI: false;
DISABLE_CONFIG_API: false;
CLOUDFLARE_API_TOKEN: string;
MetricCoordinator: DurableObjectNamespace<import("./src/worker").MetricCoordinator>;
AccountMetricCoordinator: DurableObjectNamespace<import("./src/worker").AccountMetricCoordinator>;
MetricExporter: DurableObjectNamespace<import("./src/worker").MetricExporter>;
CF_API_RATE_LIMITER: RateLimit;
}
}
interface Env extends Cloudflare.Env {}
type StringifyValues<EnvType extends Record<string, unknown>> = {
[Binding in keyof EnvType]: EnvType[Binding] extends string ? EnvType[Binding] : string;
};
declare namespace NodeJS {
interface ProcessEnv extends StringifyValues<Pick<Cloudflare.Env, "QUERY_LIMIT" | "SCRAPE_DELAY_SECONDS" | "TIME_WINDOW_SECONDS" | "METRIC_REFRESH_INTERVAL_SECONDS" | "LOG_FORMAT" | "LOG_LEVEL" | "ACCOUNT_LIST_CACHE_TTL_SECONDS" | "ZONE_LIST_CACHE_TTL_SECONDS" | "SSL_CERTS_CACHE_TTL_SECONDS" | "EXCLUDE_HOST" | "CF_HTTP_STATUS_GROUP" | "METRICS_PATH" | "DISABLE_UI" | "DISABLE_CONFIG_API" | "CLOUDFLARE_API_TOKEN">> {}
}
// Begin runtime types
/*! *****************************************************************************
@@ -10808,8 +10833,11 @@ type InstanceStatus = {
| 'complete' | 'waiting' // instance is hibernating and waiting for sleep or event to finish
| 'waitingForPause' // instance is finishing the current work to pause
| 'unknown';
error?: string;
output?: object;
error?: {
name: string;
message: string;
};
output?: unknown;
};
interface WorkflowError {
code?: number;