grafana

Docker实践(八):Prometheus + Grafana + 钉钉搭建监控告警系统

匿名 (未验证) 提交于 2019-12-02 23:32:01
环境说明: 主机名 Docker版本 Prometheus版本 Node exporter版本 cAdvisor版本 Grafana版本 ip地址 docker01 18.09.2 2.9.2 0.18.0 v0.32.0 v6.1.6 172.27.9.71 docker02 18.09.2 / 0.18.0 v0.32.0 / 172.27.9.75 ubuntu安装详见: Ubuntu16.04.5以lvm方式安装全记录 docker安装详见: Ubuntu16.04安装Docker docker-compose安装详见: Docker Compose实践 一、Prometheus简介 Prometheus特点: 多维数据模型,其中时间序列数据通过metric名和键值对来区分。 灵活而强大的查询语句(PromQL) 不依赖分布式存储,可直接在本地工作 通过HTTP使用pull模式采集时间序列数据 可以采用push gateway的方式把时间序列数据推送至 Prometheus server 端 可以通过服务发现或者静态配置去获取监控的 targets 支持多种图形和仪表盘模式 二、Prometheus架构 组件: Prometheus生态圈由多个组件组成,其中许多是可选的: Prometheus Server: 用于抓取和存储时间序列数据。 Client Library

graphite custom functions

匿名 (未验证) 提交于 2019-12-02 23:05:13
http://www.cnblogs.com/txwsqk/p/6522854.html # Function plugins FUNCTION_PLUGINS = ['linkedme.aliasByMap',] /opt/graphite/webapp/graphite/functions/custom# ls __init__.py __init__.pyc linkedme.py linkedme.pyc #coding:utf-8 from graphite.functions.params import Param, ParamTypes def aliasByMap(requestContext, seriesList): kv = { '4000054':'你想展示的内容', } for series in seriesList: series.name = kv[series.name] return seriesList aliasByMap.group = 'Alias' aliasByMap.params = [ Param('seriesList', ParamTypes.seriesList, required=True), ] SeriesFunctions = { 'aliasByMap': aliasByMap, } 这样 grafana

Graphing slow counters with prometheus and grafana

╄→尐↘猪︶ㄣ 提交于 2019-12-02 22:53:54
We graph fast counters with sum(rate(my_counter_total[1m])) or with sum(irate(my_counter_total[20s])) . Where the second one is preferrable if you can always expect changes within the last couple of seconds. But how do you graph slow counters where you only have some increments every couple of minutes or even hours? Having values like 0.0013232/s is not very human friendly. Let's say I want to graph how many users sign up to our service (we expect a couple of signups per hour). What's a reasonable query? We currently use the following to graph that in grafana: Query: 3600 * sum(rate(signup

使有prometheus监控redis,mongodb,nginx,mysql,jmx

匿名 (未验证) 提交于 2019-12-02 21:59:42
以下操作在CENTOS7环境。 使用prometheus做监控,使用grafana做dashboard的界面展示: 因prometheus自带的监控web界面图形化展示方面比较弱,推荐使用grafana集成prometheus展示; 一、软件安装 1)granafa的安装: 官方安装指南:https://grafana.com/grafana/download?platform=linux service grafana-server start 2)prometheus的安装: 官方下载地址:https://prometheus.io/download/ 安装prometheus主程序 nohup ./prometheus >/dev/null & 安装 prometheus的告警程序 cd /usr/local/prometheus nohup ./alertmanager >/dev/null & 3)需在各监控节点安装prometheus的node程序; cd /usr/local/prometheus nohup ./node_exporter >/dev/null & 二、mysql的插件安装可直接在prometheus官网下载安装; 配置.my.cnf文件 [client] host = 127.0.0.1 user = REPL password = Pbu4

Grafan+Prometheus 监控 MySQL

匿名 (未验证) 提交于 2019-12-02 21:53:52
架构图 IP 环境 需装软件 192.168.0.237 mysql-5.7.20 node_exporter-0.15.2.linux-amd64.tar.gz mysqld_exporter-0.10.0.linux-amd64.tar.gz 192.168.0.248 grafana+prometheus prometheus-2.1.0.linux-amd64.tar.gz node_exporter-0.15.2.linux-amd64.tar.gz grafana-4.6.3.linux-x64.tar.gz 安装 prometheus # 创建保存软件的目录 mkdir /data/software/ -p cd /data/software/ # 解压 prometheus tar xvf prometheus-2.1.0.linux-amd64.tar.gz -C /iba/ cd /iba/ mv prometheus-2.1.0.linux-amd64 prometheus cd prometheus/ cp prometheus.yml /tmp/prometheus.yml.20181203 # 配置 prometheus.yml cat prometheus.yml # my global config global: scrape_interval:

How to use the selected period of time in a query?

女生的网名这么多〃 提交于 2019-12-02 19:36:49
I'm using Grafana with Prometheus and I'd like to build a query that depends on the selected period of time selected in the upper right corner of the screen. Is there any variable (or something like that) to use in the query field? In other words, If I select 24hs I'd like to use that data in the query. There are two ways that I know: You can use the $__interval variable like this: increase(http_requests_total[$__interval]) There is a drawback that the $__interval variable's value is adjusted by resolution of the graph, but this may also be helpful in some situations. This approach should fit

HikariCP监控指标介绍和应用

余生颓废 提交于 2019-12-02 16:59:33
概述 HikariCP提供了一些监控指标,他的监控指标都是基于MicroMeter提供出来的,然后支持Prometheus和Dropwizard。本次我们将讨论一下HikariCp的监控指标有哪些,为什么提供这些指标,以及咱们如何去做监控。 监控指标 就像 com.zaxxer.hikari.metrics.PoolStats 提供的那样,几个重要的指标都存储在poolState中。 totalConnections 总连接数,包括空闲的连接和使用中的连接。 idleConnections 空闲连接数 activeConnections 活跃连接数 totalConnections = activeConnection + idleConnections pendingThreads 正在等待连接的线程数量。排查性能问题时,这个指标是一个重要的参考指标,如果正在等待连接的线程在相当一段时间内数量较多,可以考虑扩大数据库连接池的size。(即HikariCP的maxPoolSize) maxConnections 最大连接数,统计指标,统计到目前为止连接的最大数量。 minConnections 最小连接数,统计指标,统计到目前为止连接的最小数量。 usageTime 每个连接使用的时间,当连接被回收的时候会记录此指标: com.zaxxer.hikari.pool

使用Prometheus Operator 监控Kubernetes(15)

心不动则不痛 提交于 2019-12-02 16:49:22
一、Prometheus概述:    Prometheus 是一个开源系统监测和警报工具箱。 Prometheus Operator 是 CoreOS 开发的基于 Prometheus 的 Kubernetes 监控方案,也可能是目前功能最全面的开源方案。 主要特征:   1)多维数据模型(时间序列由metri和key/value定义)   2)灵活的查询语言   3)不依赖分布式存储   4)采用 http 协议,使用 pull 拉取数据   5)可以通过push gateway进行时序列数据推送   6)可通过服务发现或静态配置发现目标   7)多种可视化图表及仪表盘支持 Prometheus架构如下:   Prometheus组件包括:Prometheus server、push gateway 、alertmanager、Web UI等。   Prometheus server 定期从数据源拉取数据,然后将数据持久化到磁盘。Prometheus 可以配置 rules,然后定时查询数据,当条件触发的时候,会将 alert 推送到配置的 Alertmanager。Alertmanager 收到警告的时候,可以根据配置,聚合并记录新时间序列,或者生成警报。同时还可以使用其他 API 或者 Grafana 来将收集到的数据进行可视化。 Prometheus Server  

Rancher2.x 一键式部署 Prometheus + Grafana 监控 Kubernetes 集群

大兔子大兔子 提交于 2019-12-02 16:09:53
目录 1、Prometheus & Grafana 介绍 2、环境、软件准备 3、Rancher 2.x 应用商店 4、一键式部署 Prometheus 5、验证 Prometheus + Grafana 1、Prometheus & Grafana 介绍 Prometheus 是一套开源的系统监控、报警、时间序列数据库的组合,Prometheus 基本原理是通过 Http 协议周期性抓取被监控组件的状态,而通过 Exporter Http 接口输出这些被监控的组件信息,而且已经有很多 Exporter 可供选择。Grafana 是一个可视化仪表盘,它拥有美观的图标和布局展示,功能齐全的仪表盘和图形编辑器,默认支持 CloudWatch、Graphite、Elasticsearch、InfluxDB、Mysql、PostgreSQL、Prometheus、OpenTSDB 等作为数据源。我们可以将 Prometheus 抓取的数据,通过 Grafana 优美的展示出来,非常直观。 2、环境、软件准备 首先必须有一个rancher部署或者管理的kubernetes集群环境。(rancher部署或者管理kubernetes集群可自行百度,这里就不在详述。) 3、Rancher 2.x 应用商店 Rancher 2.x 提供了应用商店功能,通过应用商店,我们可以非常方便的安装各服务到

k8s集群监控 cadvisor/exporter+prometheus+grafana

余生长醉 提交于 2019-12-02 16:07:57
### k8s监控处理 ### 1.cadvisor/exporter+prometheus+grafana 安装 #### 1.1 配置nfs安装 ```shell ubuntu: nfs 服务器 apt-get install nfs-kernel-server # 创建一个/data/pvdata的共享目录 mkdir /data/pvdata centos: chown nfsnobody:nfsnobody /data/pvdata ubuntu: chown chown nobody:nogroup /data/pvdata vim /etc/exports #ip填写自己所支持IP范围 /data/pvdata xxx.xxx.xxx.0/24(rw,async,all_squash) exportfs -rv #显示 exporting xxx.xxx.xxx.0/24:/data/pvdata #需要在prometheus服务所在的节点安装 #nfs 客户端 apt-get update apt-get install nfs-common 在其他节点上测试nfs是否可用,挂载命令: mkdir /kubernetes mount nfs服务器的ip:/data/pvdata /kubernetes ``` #### 1.2 prometheus配置 ``