diff --git a/alert.rules.yml b/alert.rules.yml index 984469c..76ca030 100644 --- a/alert.rules.yml +++ b/alert.rules.yml @@ -1,7 +1,9 @@ groups: - - name: alert.rules + - + name: alert.rules rules: - - alert: InstanceDown + - + alert: InstanceDown expr: up == 0 for: 1m labels: @@ -9,3 +11,12 @@ groups: annotations: summary: "Endpoint {{ $labels.instance }} down" description: "{{ $labels.instance }} of job {{ $labels.job }} has been down for more than 1 minutes." + - + alert: TestAlert + expr: jvm_threads_deadlocked == 0.0 + for: 30s + labels: + severity: warning + annotations: + summary: "Endpoint {{ $labels.instance }} Test Alert" + description: "Test alert for {{ $labels.instance }} of job {{ $labels.job }} if there is no deadlocks." diff --git a/alertmanager.yml b/alertmanager.yml index d1dd90a..2b93531 100644 --- a/alertmanager.yml +++ b/alertmanager.yml @@ -1,10 +1,14 @@ --- route: - receiver: telegram.bot - group_by: [...] + receiver: ms.teams + group_by: [job] group_wait: 30s group_interval: 1m repeat_interval: 1h + routes: + - receiver: msteams + + - receiver: telegram.bot receivers: - name: telegram.bot diff --git a/docker-compose.yml b/docker-compose.yml index 16554b8..06c42ab 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,3 +1,4 @@ +--- services: node-exporter: container_name: node-exporter @@ -9,20 +10,20 @@ services: image: grafana/grafana:latest network_mode: host - # data-generator: - # container_name: data-generator - # build: - # context: ../prometheus-data-generator/ - # network_mode: host - # volumes: - # - ../prometheus-data-generator/config.yml:/config.yml + data-generator: + container_name: data-generator + build: + context: ../prometheus-data-generator/ + network_mode: host + volumes: + - ../prometheus-data-generator/config.yml:/config.yml prometheus: container_name: prometheus image: prom/prometheus:latest network_mode: host volumes: - - ./prometheus.yml:/etc/prometheus/prometheus.yml + - ../forge/monitor/prometheus.yml:/etc/prometheus/prometheus.yml - ./alert.rules.yml:/etc/prometheus/alert.rules.yml alertmanager: @@ -31,3 +32,10 @@ services: network_mode: host volumes: - ./alertmanager.yml:/etc/alertmanager/alertmanager.yml + + prom2teams: + image: idealista/prom2teams:2.7.0 + restart: unless-stopped + network_mode: host + environment: + PROM2TEAMS_CONNECTOR: webhookurl diff --git a/msteams-card.json b/msteams-card.json new file mode 100644 index 0000000..c5c729d --- /dev/null +++ b/msteams-card.json @@ -0,0 +1,39 @@ +{ + "@context": "https://schema.org/extensions", + "@type": "MessageCard", + "themeColor": "0072C6", + "title": "Visit the Outlook Dev Portal", + "text": "Click **Learn More** to learn more about Actionable Messages!", + "potentialAction": [ + { + "@type": "ActionCard", + "name": "Send Feedback", + "inputs": [ + { + "@type": "TextInput", + "id": "feedback", + "isMultiline": true, + "title": "Let us know what you think about Actionable Messages" + } + ], + "actions": [ + { + "@type": "HttpPOST", + "name": "Send Feedback", + "isPrimary": true, + "target": "http://..." + } + ] + }, + { + "@type": "OpenUri", + "name": "Learn More", + "targets": [ + { + "os": "default", + "uri": "https://docs.microsoft.com/outlook/actionable-messages" + } + ] + } + ] +} \ No newline at end of file diff --git a/prometheus.yml b/prometheus.yml index f90dee3..c530137 100644 --- a/prometheus.yml +++ b/prometheus.yml @@ -1,3 +1,4 @@ +--- global: scrape_interval: 15s external_labels: diff --git a/telegram-group.json b/telegram-group.json new file mode 100644 index 0000000..e2883d5 --- /dev/null +++ b/telegram-group.json @@ -0,0 +1,65 @@ +{ + "ok": true, + "result": [ + { + "update_id": 436224617, + "my_chat_member": { + "chat": { + "id": -780322874, + "title": "Test", + "type": "group", + "all_members_are_administrators": false + }, + "from": { + "id": 65498889, + "is_bot": false, + "first_name": "Daniel", + "last_name": "Yutsuo", + "username": "yutsuo", + "language_code": "en" + }, + "date": 1650981614, + "old_chat_member": { + "user": { + "id": 5209410321, + "is_bot": true, + "first_name": "bb_CFE_bot", + "username": "bb_CFE_bot" + }, + "status": "left" + }, + "new_chat_member": { + "user": { + "id": 5209410321, + "is_bot": true, + "first_name": "bb_CFE_bot", + "username": "bb_CFE_bot" + }, + "status": "member" + } + } + }, + { + "update_id": 436224618, + "message": { + "message_id": 25, + "from": { + "id": 65498889, + "is_bot": false, + "first_name": "Daniel", + "last_name": "Yutsuo", + "username": "yutsuo", + "language_code": "en" + }, + "chat": { + "id": -780322874, + "title": "Test", + "type": "group", + "all_members_are_administrators": true + }, + "date": 1650981614, + "group_chat_created": true + } + } + ] +} \ No newline at end of file diff --git a/url-encoded-string b/url-encoded-string new file mode 100644 index 0000000..0ec927e --- /dev/null +++ b/url-encoded-string @@ -0,0 +1,2 @@ + +How%20are%20you%2C%20fellow%20humans%3F \ No newline at end of file