1
0
Fork 0
kubernetes/victoria-metrics
Dustin d74e26d527 victoria-metrics: Send alerts via ntfy
I don't like having alerts sent by e-mail.  Since I don't get e-mail
notifications on my watch, I often do not see alerts for quite some
time.  They are also much harder to read in an e-mail client (Fastmail
web an K-9 Mail both display them poorly).  I would much rather have
them delivered via _ntfy_, just like all the rest of the ephemeral
notifications I receive.

Fortunately, it is easy enough to integrate Alertmanager and _ntfy_
using the webhook notifier in Alertmanager.  Since _ntfy_ does not
natively support the Alertmanager webhook API, though, a bridge is
necessary to translate from one data format to the other.  There are a
few options for this bridge, but I chose
[alexbakker/alertmanager-ntfy][0] because it looked the most complete
while also having the simplest configuration format.  Sadly, it does not
expose any Prometheus metrics itself, and since it's deployed in the
_victoria-metrics_ namespace, it needs to be explicitly excluded from
the VMAgent scrape configuration.

[0]: https://github.com/alexbakker/alertmanager-ntfy
2024-05-10 10:32:52 -05:00
..
README.md v-m: Deploy (clustered) Victoria Metrics 2024-01-01 17:48:10 -06:00
alertmanager-ntfy.config.yml victoria-metrics: Send alerts via ntfy 2024-05-10 10:32:52 -05:00
alertmanager-ntfy.yaml victoria-metrics: Send alerts via ntfy 2024-05-10 10:32:52 -05:00
alertmanager.config.yml victoria-metrics: Send alerts via ntfy 2024-05-10 10:32:52 -05:00
alertmanager.yaml v-m: Deploy (clustered) Victoria Metrics 2024-01-01 17:48:10 -06:00
alerts.yml v-m: alerts: Add alert for camera offline 2024-04-23 09:42:04 -05:00
blackbox-exporter.yaml v-m/blackbox: Switch to upstream container image 2024-01-15 18:45:25 -06:00
blackbox.yml v-m/vmagent: Scrape public clouds to test Internet 2024-01-15 18:44:46 -06:00
ingress.yaml v-m: Deploy (clustered) Victoria Metrics 2024-01-01 17:48:10 -06:00
kustomization.yaml victoria-metrics: Send alerts via ntfy 2024-05-10 10:32:52 -05:00
namespace.yaml v-m: Deploy (clustered) Victoria Metrics 2024-01-01 17:48:10 -06:00
scrape.yml victoria-metrics: Send alerts via ntfy 2024-05-10 10:32:52 -05:00
secrets.yaml v-m: Deploy (clustered) Victoria Metrics 2024-01-01 17:48:10 -06:00
vmagent.yaml v-m/vmagent: Allow listing all pods in cluster 2024-01-02 11:25:54 -06:00
vmalert.yaml v-m: Correct vmalert remote read/write URLs 2024-01-23 10:45:40 -06:00
vminsert.yaml v-m: Deploy (clustered) Victoria Metrics 2024-01-01 17:48:10 -06:00
vmselect.yaml v-m: Deploy (clustered) Victoria Metrics 2024-01-01 17:48:10 -06:00
vmstorage.yaml v-m: vmstorage: Remove startup/ready probes 2024-01-22 16:43:46 -06:00

README.md

Victoria Metrics

Victoria Metrics is a powerful, scalable time-series database compatible with Prometheus and its ecosystem of metrics exporters.

Clustered Deployment

Victoria Metrics can run in a high-availability cluster, with the various functions of the TSDB split into independently-scalable processes:

  • vmstorage: Stores time series data.
  • vminsert: Ingests metrics in various formats (e.g. Prometheus) and sends them to one or more vmstorage nodes.
  • vmselect: Performs metrics queries, retrieving results from one or more vmstorage nodes.

The vmstorage processes are managed by a StatefulSet with a volume claim template for persistent storage. The number of replicas in the StatefulSet must be 2n-1 where n is the value of the replicationFactor setting for vminsert.

vminsert and vmselect processes are stateless and thus managed by a Deployment. There should be at least 2 replicas of each of these, so that restarts, etc. can be performed without any downtime.

vmagent

In a typical Victoria Metrics ecosystem, collecting metrics is handled separately from the TSDB. The vmagent process handles scraping and receiving metrics and passing them to vminsert. vmagent can cache received metrics locally, in case no vminsert process is available, so it requires persistent storage and is therefore managed by a StatefulSet. Because there are multiple vmagent processes scraping the same targets, the vminsert and vmstorage processes MUST have the dedup.minScrapeInterval setting set to match the vmagent scrape interval. Jobs with scrape intervals longer than the default will unfortunately have duplicate data points.

Blackbox Exporter

Many applications and web sites are monitored via the Blackbox Exporter, which makes arbitrary HTTP, TCP, ICMP, etc. requests and reports Prometheus metrics about them. This is a stateless process, managed by a Deployment.

vmalert

Victoria Metrics has a separate process for alerting, vmalert. This process periodically executes the queries defined in its alerting rules and creates alerts for matching results. Alerts are stored in the Victoria Metrics TSDB. Rules are defined in a YAML document, managed by a ConfigMap. Notifications are sent to Alertmanager.

Alertmanager

Alertmanager receives notifications from vmalert and sends e.g. email messages. Multiple instances can be run in a cluster; each node needs to know the host and port of every node in the cluster.