Path: blob/main/components/gitpod-db/src/redis/metrics.ts
2500 views
/**1* Copyright (c) 2023 Gitpod GmbH. All rights reserved.2* Licensed under the GNU Affero General Public License (AGPL).3* See License.AGPL.txt in the project root for license information.4*/56import * as client from "prom-client";78const registry = new client.Registry();910export function redisMetricsRegistry(): client.Registry {11return registry;12}1314export const updatesPublishedTotal = new client.Counter({15name: "gitpod_redis_updates_published_total",16help: "Counter of events published to Redis by type and error",17labelNames: ["type", "error"],18registers: [registry],19});2021export function reportUpdatePublished(type: "workspace-instance" | "prebuild" | "headless", err?: Error): void {22updatesPublishedTotal.labels(type, err ? "true" : "false").inc();23}242526