Skip to content

Commit 87c0f73

Browse files
committed
fix
1 parent 3aad80f commit 87c0f73

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

components/gitpod-protocol/src/util/logging.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66

77
import { scrubber } from "./scrubbing";
8+
import * as prometheusClient from "prom-client";
89

910
const inspect: (object: unknown) => string = require("util").inspect; // undefined in frontend
1011

@@ -246,7 +247,16 @@ namespace GoogleLogSeverity {
246247
};
247248
}
248249

250+
const logsCounter = new prometheusClient.Counter({
251+
name: "gitpod_logs_total",
252+
help: "Total number of logs by level",
253+
labelNames: ["level"],
254+
registers: [prometheusClient.register],
255+
});
256+
249257
function doLog(calledViaConsole: boolean, consoleLog: ConsoleLog, severity: GoogleLogSeverity, args: unknown[]): void {
258+
logsCounter.labels(severity).inc();
259+
250260
if (!jsonLogging) {
251261
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
252262
consoleLog(...args);

0 commit comments

Comments
 (0)