Vmalert vmalert executes a list of given alerting or recording rules against configured address some command line interface tool configure vmalert 1./bin/vmalert -rule=alter.rules \ 2 // PromSQL compatible datasource 3 -datasource.url=http://localhost:8428 4 // Alert manager url 5 -notifier.url=http://localhost:9093 6 // Alert manager replica rul 7 -notifier.url=http://127.0.0.1:9093 8 // remote write compatible storage to persist rules 9 -remoteRead.url=http://localhost:8428 10 /.... vmalert Prometheus
1.Alerting with Prometheus is separated in to two parts 1-1Alerting rules Alerting rules is a file that formatted by yml,it's define some exp in to the YAML file. Alerting rules is in Prometheus servers send alerts to an alert manager and alert manager managed those alerts. the rule document in there: the rules doc 1-2Alerting Manager AlertingManager is a command line tool and the command line tool flags has those functions configure immutable system parameters configuration file defi.... 有更新! about prometheus alerting Prometheus
1.Two types of rules Prometheus supports two types of rules .whitch may be configured and then evaluated at regular intervals: Recording rules and Alerting rules. 2.Recording rules 1.Recording rules allow you to precompute frequently needed or computationally expensive expressions and save their result as a new set of time series. 2.Be mutch faster than executing the origin expression every time it's need. 3.Rules within a group run sequentially at a regular interval. the syntax of .... 有更新! about prometheus rules Prometheus
Prometheus time series metrics collect toolkit 提供了 UI 服务,默认端口 30313 主要作用就是监控一下我们服务的各项指标,也有许多包已经集成了这个功能,基本上查找一下配置一下就可以快速的展示出各项指标了 业务指标 但例如 java_gc,go_gc,node_request_total 这种指标对我们来说没有特别大的用处,我们的着力点应该在于提取业务指标,各个业务系统数据源不同逻辑不同导致无法使用通用型第三方包来构建我们的指标。 这个时候就出现了 prometheus-exporter 用来放出自定义的业务指标,等待 prometheus 来此处收集。 prometheus exporter 其实很简单,就是攒一些 prometheus 数据格式的数据放入 /metrics 路由中等待 scrape 就好 下面使用 Go 来举例子 这里使用了 godror 驱动 Oracle,prometheus/client_golang 客户端,logrus 日志模块 一些命令行参数 .... 关于Prometheus Exporter Prometheus
1.下载 redis_exporter 2.脚本 nohup ./redis_exporter -redis.addr 0.0.0.0:6379 -redis.password "password" & link 3.promethus endpoint apiVersion: v1 kind: Endpoints metadata: name: redis-exporter subsets: - addresses: - ip: 222.30.195.42 ports: - port: 9121 name: redisex --- apiVersion: v1 kind: Service metadata: name: redis-exporter labels: app: redis spec: ports: - port: 9121 targetPort: 9121 name: redisex --- apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: labels: app.... Prometheus监控redis实例 Prometheus