import { Counter, Gauge, Histogram, Registry } from "prom-client"; //#region src/metrics/index.d.ts /** Prometheus metrics registry */ declare class IndexerMetrics { /** Prometheus registry instance */ readonly registry: Registry; /** Counter for total blocks indexed */ readonly blocksIndexed: Counter; /** Gauge for current block height */ readonly currentHeight: Gauge; /** Gauge for latest chain block height */ readonly latestHeight: Gauge; /** Gauge for blocks behind chain tip */ readonly blocksBehind: Gauge; /** Gauge for block queue depth */ readonly queueDepth: Gauge; /** Counter for total errors */ readonly errors: Counter; /** Counter for RPC errors */ readonly rpcErrors: Counter; /** Counter for block processing errors */ readonly processingErrors: Counter; /** Counter for database errors */ readonly databaseErrors: Counter; /** Histogram for block processing duration */ readonly blockProcessingDuration: Histogram; /** Histogram for RPC call duration */ readonly rpcCallDuration: Histogram; /** Histogram for database query duration */ readonly databaseQueryDuration: Histogram; /** Gauge for retry count */ readonly retryCount: Gauge; /** Gauge set to 1 while the indexer is caught up and waiting for the chain to produce a block */ readonly waitingForBlocks: Gauge; /** Counter for total transactions processed */ readonly transactionsProcessed: Counter; constructor(); /** * Updates block indexing metrics * @param currentHeight - Current height being processed * @param latestHeight - Latest height on chain * @param queueSize - Current queue depth */ updateBlockMetrics(currentHeight: number, latestHeight: number, queueSize: number): void; /** * Flags whether the indexer is idle at the chain tip * @param waiting - true while waiting for the chain to produce a block */ setWaiting(waiting: boolean): void; /** * Records an error occurrence * @param type - Error type (rpc, database, processing, etc.) */ recordError(type: string): void; /** * Records block processing duration * @param durationSeconds - Duration in seconds */ recordBlockProcessing(durationSeconds: number): void; /** * Times a block processing operation * @returns End timer function to call when operation completes */ timeBlockProcessing(): (labels?: Partial> | undefined) => number; /** * Records RPC call duration * @param method - RPC method name * @param durationSeconds - Duration in seconds */ recordRpcCall(method: string, durationSeconds: number): void; /** * Times an RPC call operation * @param method - RPC method name * @returns End timer function to call when operation completes */ timeRpcCall(method: string): (labels?: Partial> | undefined) => number; /** * Records database query duration * @param queryType - Type of query (select, insert, update, delete, etc.) * @param durationSeconds - Duration in seconds */ recordDatabaseQuery(queryType: string, durationSeconds: number): void; /** * Times a database query operation * @param queryType - Type of query (select, insert, update, delete, etc.) * @returns End timer function to call when operation completes */ timeDatabaseQuery(queryType: string): (labels?: Partial> | undefined) => number; /** * Updates the retry count gauge * @param count - Current retry count */ updateRetryCount(count: number): void; /** * Increments the retry count gauge by 1 */ incrementRetryCount(): void; /** * Resets the retry count gauge to 0 */ resetRetryCount(): void; /** * Records transactions processed * @param count - Number of transactions to record (defaults to 1) */ recordTransactions(count?: number): void; /** * Gets metrics in Prometheus format * @returns Prometheus metrics string */ getMetrics(): Promise; } //#endregion export { IndexerMetrics }; //# sourceMappingURL=index.d.cts.map