From 627cbc9f8aac6728bcdc81238562bf7d5bf159ac Mon Sep 17 00:00:00 2001 From: Alexander Lukin Date: Thu, 23 Jan 2025 15:56:34 +0400 Subject: [PATCH] chore: minor improvements 1. Replace the `any` type in the `AlertRequestBody` interface fields with more specific types. 2. Fix the maximal version of the Alertmanager that is compatible with the current critical alerts code in the `docker-compose`. --- docker-compose.yml | 2 +- src/common/alertmanager/alerts/BasicAlert.ts | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index df4ee3d..0351e66 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -75,7 +75,7 @@ services: - '8083:8080' alertmanager: - image: prom/alertmanager:v0.24.0 + image: prom/alertmanager:v0.26.0 container_name: alertmanager restart: unless-stopped deploy: diff --git a/src/common/alertmanager/alerts/BasicAlert.ts b/src/common/alertmanager/alerts/BasicAlert.ts index f82c68d..07d46dd 100644 --- a/src/common/alertmanager/alerts/BasicAlert.ts +++ b/src/common/alertmanager/alerts/BasicAlert.ts @@ -6,8 +6,13 @@ import { RegistrySourceOperator } from 'validators-registry'; export interface AlertRequestBody { startsAt: string; endsAt: string; - labels: any; - annotations: any; + labels: { + [key: string]: string; + }; + annotations: { + summary: string; + description: string; + }; } export interface PreparedToSendAlert {