From 341a5c533cf11332adfb0767f54df651ecd7f765 Mon Sep 17 00:00:00 2001 From: Ian Philips Date: Fri, 1 Nov 2024 16:11:26 -0700 Subject: [PATCH] Add instance type to metrics --- backend/shared/src/monitoring/metric-writer.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/shared/src/monitoring/metric-writer.ts b/backend/shared/src/monitoring/metric-writer.ts index 7cbde52484..238e4dbca9 100644 --- a/backend/shared/src/monitoring/metric-writer.ts +++ b/backend/shared/src/monitoring/metric-writer.ts @@ -77,7 +77,10 @@ function serializeEntries( }, metric: { type: `custom.googleapis.com/${entry.type}`, - labels: entry.labels ?? {}, + labels: { + ...(entry.labels ?? {}), + instance_type: process.env.READ_ONLY ? 'read' : 'write', + }, }, points: [ {