MCPcopy Create free account

hub / github.com/cloudflare/cloudflare-prometheus-exporter / functions

Functions391 in github.com/cloudflare/cloudflare-prometheus-exporter

↓ 40 callersMethodget
(key: string)
src/lib/chunked-storage.ts:19
↓ 36 callersMethodinfo
* Log info message. * * @param msg Message text. * @param data Optional structured data.
src/lib/logger.ts:62
↓ 27 callersMethodset
* Set a new stored value
worker-configuration.d.ts:9629
↓ 23 callersFunctionaccumulateCounterMetrics
( rawMetrics: MetricDefinition[], existingCounters: Record<string, CounterState>, options: CounterProcessin
src/lib/counters.ts:33
↓ 23 callersMethoderror
* Log error message. * * @param msg Message text. * @param data Optional structured data.
src/lib/logger.ts:78
↓ 17 callersFunctiongraphQLQueryError
(query: string, error: CombinedError)
src/cloudflare/client.ts:69
↓ 16 callersMethodwarn
* Log warning message. * * @param msg Message text. * @param data Optional structured data.
src/lib/logger.ts:70
↓ 15 callersFunctionsaveChunkedValue
( storage: ChunkedValueStorage, baseKey: string, value: unknown, )
src/lib/chunked-storage.ts:159
↓ 12 callersFunctionfindZoneName
(zoneId: string, zones: Zone[])
src/lib/filters.ts:56
↓ 12 callersFunctiongetConfig
(env: Env)
src/lib/runtime-config.ts:301
↓ 12 callersFunctionloadChunkedValue
( storage: ChunkedValueStorage, baseKey: string, schema: z.ZodType<T>, )
src/lib/chunked-storage.ts:112
↓ 11 callersMethoddebug
* Log debug message. * * @param msg Message text. * @param data Optional structured data.
src/lib/logger.ts:54
↓ 11 callersMethodjson
()
worker-configuration.d.ts:1992
↓ 9 callersMethodreplace
(content: string | ReadableStream | Response, options?: ContentOptions)
worker-configuration.d.ts:1544
↓ 8 callersMethodput
(key: Key, value: string | ArrayBuffer | ArrayBufferView | ReadableStream, options?: KVNamespacePutOptions)
worker-configuration.d.ts:1854
↓ 8 callersMethodtext
()
worker-configuration.d.ts:1991
↓ 7 callersFunctioncleanupPendingGeneration
( storage: ChunkedValueStorage, baseKey: string, generation: number, )
src/lib/chunked-storage.ts:79
↓ 7 callersFunctioncreateLogger
(name: string, config: LoggerConfig = {})
src/lib/logger.ts:266
↓ 7 callersMethoddelete
(key: Key)
worker-configuration.d.ts:1869
↓ 7 callersMethodgetState
* Get the current state or throw if not initialized. * * @returns Current state. * @throws {Error} When state is undefined.
src/durable-objects/MetricExporter.ts:142
↓ 7 callersFunctionparseCommaSeparated
(value: string | undefined)
src/lib/filters.ts:9
↓ 6 callersMethodcollectNetworkAnalyticsDataset
* Collects bits/packets counter metrics from a network analytics dataset. * Shared extraction logic for all NAv2 datasets. * * @param groups Gra
src/cloudflare/client.ts:1258
↓ 6 callersFunctiongetEnvDefaults
(env: Env)
src/lib/runtime-config.ts:152
↓ 6 callersMethodlist
(options?: KVNamespaceListOptions)
worker-configuration.d.ts:1853
↓ 6 callersFunctionrunAlarmWithRecovery
(options: { run: () => Promise<void>; getLogger: () => AlarmRecoveryLogger | undefined; scheduleRecoveryAla
src/lib/alarm-recovery.ts:21
↓ 5 callersMethodalarm
(alarmInfo?: AlarmInvocationInfo)
worker-configuration.d.ts:501
↓ 5 callersMethodgetState
* Gets current coordinator state. * * @returns Current state. * @throws {Error} When state not initialized.
src/durable-objects/AccountMetricCoordinator.ts:105
↓ 5 callersMethodputMany
(entries: Record<string, unknown>)
src/lib/chunked-storage.ts:21
↓ 5 callersMethodsaveState
Persist state in bounded storage chunks before publishing it in memory.
src/durable-objects/MetricExporter.ts:726
↓ 4 callersMethodchild
* Create child logger with namespaced tag. * * @param namespace Namespace appended to parent tag with colon separator. * @returns New logger ins
src/lib/logger.ts:86
↓ 4 callersFunctioncreateExporter
( storage: AlarmStorage, envOverrides: Record<string, unknown> = {}, )
src/durable-objects/MetricExporter.test.ts:33
↓ 4 callersMethodcreateLogger
* Create a logger instance with context from the exporter's state. * * @param config Resolved runtime configuration. * @returns Logger instance
src/durable-objects/MetricExporter.ts:125
↓ 4 callersMethoddeleteMany
(keys: string[])
src/lib/chunked-storage.ts:22
↓ 4 callersFunctiongetCloudflareMetricsClient
(env: Env)
src/cloudflare/client.ts:3467
↓ 4 callersFunctiongetMetricRefreshDelaySeconds
( error: unknown, defaultDelaySeconds: number, )
src/lib/metric-refresh.ts:10
↓ 4 callersFunctionmergeData
(data?: StructuredData)
src/lib/logger.ts:281
↓ 4 callersFunctionparseCommaSeparated
* Parses comma-separated string into Set, trimming whitespace. * Returns empty Set for empty/undefined input. * * @param value Comma-separated stri
src/lib/config.ts:37
↓ 4 callersFunctionpendingKey
(baseKey: string, generation: number)
src/lib/chunked-storage.ts:61
↓ 4 callersMethodrefreshWithTimeRange
* Refresh metrics from Cloudflare API using the provided time range. * Handles account-scoped and zone-scoped queries, processes counters, and sched
src/durable-objects/MetricExporter.ts:345
↓ 4 callersMethodscheduleNextAlarm
* Schedule the next alarm with jitter for time range alignment. * * @param config Resolved runtime configuration.
src/durable-objects/MetricExporter.ts:458
↓ 4 callersMethodsetAlarm
(scheduledTime: number | Date, options?: DurableObjectSetAlarmOptions)
worker-configuration.d.ts:575
↓ 3 callersMethodblockConcurrencyWhile
(callback: () => Promise<T>)
worker-configuration.d.ts:540
↓ 3 callersFunctionconfigFromEnv
(env: { LOG_FORMAT?: string; LOG_LEVEL?: string; })
src/lib/logger.ts:307
↓ 3 callersFunctioncreateClient
(fetch: typeof globalThis.fetch)
src/cloudflare/client.test.ts:5
↓ 3 callersMethodexport
* Return cached accumulated metrics. * * @returns Current snapshot of metrics with accumulated counter values.
src/durable-objects/MetricExporter.ts:739
↓ 3 callersFunctionextractErrorInfo
(error: unknown)
src/lib/errors.ts:374
↓ 3 callersMethodgetAccountMetrics
* Fetches account-level metrics for a specific query type. * Each MetricExporter DO calls this directly - no batching needed since * Cloudflare's
src/cloudflare/client.ts:477
↓ 3 callersMethodgetZoneMetrics
* Fetches zone-level metrics for a specific query type. * Requires zone IDs and zone metadata for label resolution. * * @param query Zone-level
src/cloudflare/client.ts:1505
↓ 3 callersMethodloadState
Load and validate state from Durable Object storage.
src/durable-objects/MetricExporter.ts:104
↓ 3 callersFunctionmanifestKey
(baseKey: string)
src/lib/chunked-storage.ts:39
↓ 3 callersFunctionmergeConfig
* Merges configuration overrides with environment defaults. * * @param defaults Default configuration from environment. * @param overrides Partial
src/lib/runtime-config.ts:252
↓ 3 callersFunctionreadOverrides
* Reads configuration overrides from KV storage. * Returns empty object on parse errors or missing data. * * @param env Worker environment bindings
src/lib/runtime-config.ts:213
↓ 3 callersFunctionstoredState
()
src/durable-objects/MetricExporter.test.ts:61
↓ 3 callersMethodtoStructuredData
* Convert to structured data for logging. * * @returns Structured error context.
src/lib/errors.ts:145
↓ 3 callersMethodvalues
(options?: ReadableStreamValuesOptions)
worker-configuration.d.ts:2194
↓ 2 callersFunctionbatches
(items: T[])
src/lib/chunked-storage.ts:71
↓ 2 callersFunctionchunkKey
(baseKey: string, generation: number, index: number)
src/lib/chunked-storage.ts:57
↓ 2 callersFunctionchunkKeys
(baseKey: string, manifest: ChunkManifest)
src/lib/chunked-storage.ts:65
↓ 2 callersFunctionchunkedDurableObjectStorage
( storage: DurableObjectStorage, )
src/lib/chunked-storage.ts:26
↓ 2 callersMethodcreateLogger
* Creates logger instance with account-specific tag. * * @param config Resolved runtime configuration. * @returns Logger instance.
src/durable-objects/AccountMetricCoordinator.ts:90
↓ 2 callersFunctionfetch
()
src/cloudflare/client.test.ts:27
↓ 2 callersMethodgetAccounts
* Fetches all accounts accessible by the API token. * * @returns Promise of accounts accessible by the API token.
src/cloudflare/client.ts:253
↓ 2 callersFunctiongetActiveAccountQueries
* Filters account-scoped queries based on account tier and config. * Hostname metrics are excluded when the allowlist is empty or excludeHost is true
src/durable-objects/AccountMetricCoordinator.ts:35
↓ 2 callersMethodgetLoadBalancerConfigs
* Fetches load balancer configs for a zone. * * @param zoneId Cloudflare zone ID. * @param accountId Cloudflare account ID. * @returns Promise
src/cloudflare/client.ts:3152
↓ 2 callersMethodgetMany
(keys: string[])
src/lib/chunked-storage.ts:20
↓ 2 callersMethodgetSSLCertificates
* Fetches SSL certificate packs for a zone. * Returns empty array on API errors. * * @param zoneId Cloudflare zone ID. * @returns Promise of S
src/cloudflare/client.ts:402
↓ 2 callersFunctiongetTimeRange
( scrapeDelaySeconds: number = 300, timeWindowSeconds: number = 60, )
src/lib/time.ts:11
↓ 2 callersMethodinitialize
* Initialize the exporter state from a composite ID. * Idempotent - skips if already initialized. * * @param id Composite ID string to parse int
src/durable-objects/MetricExporter.ts:172
↓ 2 callersMethodlog
* The **`console.log()`** static method outputs a message to the console. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/con
worker-configuration.d.ts:202
↓ 2 callersFunctionlogError
( logger: AlarmRecoveryLogger | undefined, message: string, error: unknown, )
src/lib/alarm-recovery.ts:9
↓ 2 callersFunctionreadCurrentValues
( storage: ChunkedValueStorage, baseKey: string, )
src/lib/chunked-storage.ts:94
↓ 2 callersMethodrefresh
* Refreshes zone list and pushes context to exporters. Exporters handle their own metric fetching via alarms. * * @param config Resolved runtime c
src/durable-objects/AccountMetricCoordinator.ts:171
↓ 2 callersFunctionwithTimeout
( promise: Promise<T>, ms: number, operation = "Operation", )
src/lib/errors.ts:309
↓ 2 callersFunctionwriteOverrides
* Writes configuration overrides to KV storage. * * @param env Worker environment bindings. * @param overrides Configuration overrides to persist.
src/lib/runtime-config.ts:238
↓ 1 callersFunctionaggregateByLabels
* Aggregates metric values with identical labels. * Counters are summed; gauges take the maximum value. * * @param values Array of metric values to
src/lib/prometheus.ts:91
↓ 1 callersMethodbatchGetFirewallRules
* Batches firewall rule fetches for multiple zones via DataLoader. * * @param zoneIds Array of zone IDs. * @returns Promise of array of rule map
src/cloudflare/client.ts:369
↓ 1 callersMethodbuildExporterInfoMetrics
* Builds exporter health and discovery metrics. * * @param accountCount Number of accounts discovered. * @param zoneCounts Zone counts (total, f
src/durable-objects/MetricCoordinator.ts:241
↓ 1 callersFunctioncheckCloudflareApi
* Check Cloudflare REST API connectivity by fetching accounts. * * @param env Environment variables. * @returns Health check result.
src/lib/health.ts:41
↓ 1 callersFunctioncheckGraphqlApi
* Check Cloudflare GraphQL API connectivity via introspection. * * @param env Environment variables. * @returns Health check result.
src/lib/health.ts:80
↓ 1 callersFunctioncheckHealth
(env: Env)
src/lib/health.ts:139
↓ 1 callersFunctionclassifyTunnelState
Classify a weighted-average tunnel health score into a discrete StateSet.
src/cloudflare/client.ts:102
↓ 1 callersFunctioncreateJsonReporter
* Create JSON reporter for structured logs. * * @param minLevel Minimum log level to output. * @returns Reporter object with log method.
src/lib/logger.ts:220
↓ 1 callersMethodcreateLogger
* Creates logger instance with resolved configuration. * * @param config Resolved runtime configuration. * @returns Logger instance.
src/durable-objects/MetricCoordinator.ts:57
↓ 1 callersFunctioncreatePrettyReporter
* Create pretty console reporter for human-readable logs. * * @param minLevel Minimum log level to output. * @returns Reporter object with log meth
src/lib/logger.ts:189
↓ 1 callersFunctioncreateRateLimitedFetch
* Creates rate-limited fetch wrapper with exponential backoff. * * @param rateLimiter Rate limiter instance. * @param logger Logger instance. * @r
src/cloudflare/client.ts:3435
↓ 1 callersMethoderror
(message: string, context?: Record<string, unknown>)
src/lib/alarm-recovery.ts:2
↓ 1 callersFunctionerrorMessage
(error: unknown)
src/lib/alarm-recovery.ts:5
↓ 1 callersFunctionescapeHelp
* Escapes special characters in HELP text. * * @param help Raw help text. * @returns Escaped help text.
src/lib/prometheus.ts:187
↓ 1 callersFunctionescapeLabel
* Escapes special characters in label values. * * @param value Raw label value. * @returns Escaped label value.
src/lib/prometheus.ts:197
↓ 1 callersMethodexec
(query: string, ...bindings: any[])
worker-configuration.d.ts:3109
↓ 1 callersMethodfetchAccountScopedMetrics
* Fetch account-scoped metrics from Cloudflare API. * Handles both account-level and zone-batched queries. * * @param client Cloudflare metrics
src/durable-objects/MetricExporter.ts:485
↓ 1 callersMethodfetchZoneScopedMetrics
* Fetch zone-scoped metrics from Cloudflare API. * Handles SSL certificates and load balancer weight metrics. * * @param client Cloudflare metri
src/durable-objects/MetricExporter.ts:704
↓ 1 callersFunctionfilterAccountsByIds
( accounts: Account[], includeIds: ReadonlySet<string>, )
src/lib/filters.ts:28
↓ 1 callersFunctionfilterLabels
* Filters out excluded label keys from a labels object. * * @param labels Original label key-value pairs. * @param exclude Set of label keys to exc
src/lib/prometheus.ts:139
↓ 1 callersFunctionfilterZonesByIds
( zones: Zone[], includeIds: ReadonlySet<string>, )
src/lib/filters.ts:42
↓ 1 callersFunctionformatData
* Format structured data as key=value pairs. * * @param data Structured data object. * @returns Formatted string with colored key-value pairs.
src/lib/logger.ts:166
↓ 1 callersFunctionformatLabels
* Formats labels object into Prometheus label string. * * @param labels Label key-value pairs. * @returns Formatted label string like `{key="value"
src/lib/prometheus.ts:158
↓ 1 callersFunctionformatTime
* Format current time as HH:MM:SS. * * @returns Formatted time string.
src/lib/logger.ts:134
↓ 1 callersFunctionformatValue
* Format value for display in logs. * * @param v Value to format. * @returns Formatted string representation.
src/lib/logger.ts:154
↓ 1 callersFunctionformatValue
* Formats numeric value for Prometheus output. * * @param value Numeric value to format. * @returns String representation handling NaN and Infinity
src/lib/prometheus.ts:175
next →1–100 of 391, ranked by callers