grafana

Prometheus Grafana监控全方位实践

时光总嘲笑我的痴心妄想 提交于 2019-12-02 14:59:33
这次就不用 docker 部署服务了,这样大家会更容易接受。欢迎阅读。 引言 Prometheus 是一个监控系统,也是一个时间序列数据库,用Go语言开发的, 官方文档 。通过从某些特定的目标如主机,Mysql,Redis等,收集带有时间标记的一些指标(metrics),比如服务器内存情况,数据库连接数量等数据,经过一定的处理,按照时间序列顺序进行显示。 你可以配置规则,对这些指标进行处理,当某些指标符合某种规则,会触发报警等。项目地址: https://github.com/prometheus/prometheus 。 Prometheus 现在已经成为 Kubernetes 的官方监控方案,真棒。 为什么要用这个工具,因为我们有好多机器需要监控,我们要运维!而且雷锋们造了好多收集不同软件服务监控指标的工具,所以还是要用的。 这个工具号称: 多维数据模型(由指标名称和键/值维度的集合定义的时间序列) 灵活的查询语言 不依赖于分布式存储;单服务器节点是自治的 拉取数据都是通过HTTP 通过中间网关支持推送时间序列 通过服务发现或静态配置发现目标 多种图形和仪表板支持模式 支持集群联邦 说那么多,就是这个工具,你可以把它配置成单机器服务,也可以配置成分布式集群。 你可以去某些地方拉数据,也可以推数据给它,所有的请求都是HTTP协议,这样方便你定义自己的数据格式,制造一个造数据的服务

#研发解决方案介绍#基于StatsD+Graphite的智能监控解决方案

一曲冷凌霜 提交于 2019-12-02 14:41:10
关键词: 监控 、dashboard、PHP、graphite、statsd、whisper、carbon、grafana、influxdb、Python 本文档适用人员:研发和运维员工 提纲: 监控平台要做到什么程度?为什么要自己做? 几个通用技术问题 绘图所依赖的数据如何收集?如何加工?如何存储? 图形如何绘制,各种指标如何叠加? 拓扑关系如何绘制? 技术选型哲学 最终选了statsd+graphite 数据的采集 数据存储的粒度 天机的技术选型 一,监控平台要做到什么程度?为什么要自己做? 运维监控满满都是着各种开源系统以及它们的 Dashboard: Zabbix Nagios Centreon Logstash Ganglia+Cacti 以及各种业务指标趋势的 Dashboard。 我们认为,监控不能只是各种数据的采集和罗列,不仅仅是弄若干个报表并进一步配置成仪表盘, 而是有一定智能,仿照我们日常的排查问题思路,建立一定规则,自动检查,深度检查,友情提示 。 随手举一个例子: 规则:模仿我们发现问题后先检查数据库主从同步是否有问题的习惯 天机系统发现成单金额或验证券数或短信发送条数环比大幅下降后,启动检查规则, 自动逐一检查各种从库的主从同步情况。 如果发现主从延迟超过阈值,则天机 DashBoard 应浮出两条红色警告提示(可点击进入): 5分钟销售数据环比下降50%

jmeter脚本开发:influxdb + grafana + jmeter(八)

不打扰是莪最后的温柔 提交于 2019-12-02 13:33:39
一. influxdb influxdb是一个时序数据库,使用go语言编写,无需外部依赖,适合构建大部分分布式监控系统 特色:   1. 基于时间序列,支持时间相关函数(max,min...)   2. 可度量   3. 基于事件 特点:   1. 无结构,可以任意数量的列   2. 可扩展   3. 支持min max sum   4. 原生支持http,内置httpapi   5. 强大的类sql语法   6. 自带管理台界面 二. influxdb安装(linux) 1. 下载包: https://portal.influxdata.com/downloads/ 2. 安装:   赋权 chmod 755 influxdb.*** rpm   sudo yum ***** rpm 或者 rpm -ivh **** rpm 3. 启动   sudo service influxdb start 4. 检查:isof -i: 8086 检查influxdb是否运行的几种办法 如果修改influxdb默认端口8086,修改路径为:/etc/influxdb/influxdb.conf influxdb的操作语法: 三. grafana 是一款用go语言编写的开源应用,用于大规模指标数据的可视化展示,是网络架构和应用分析中最流行的时序数据展示工具 支持的数据库:graphite

prometheus部署

一曲冷凌霜 提交于 2019-12-02 12:36:50
1.prometheus安装 软件下载: wget https://dl.grafana.com/oss/release/grafana-6.4.2-1.x86_64.rpm https://github.com/prometheus/prometheus/releases/download/v2.13.0/prometheus-2.13.0.linux-amd64.tar.gz wget https://golang.org/doc/install?download=go1.13.1.linux-amd64.tar.gz 说明:虚拟机Centos7 环境下进行安装. 1.1环境装备 配置golang的环境 wget https://golang.org/doc/install?download=go1.13.1.linux-amd64.tar.gz tar -C /usr/local/ -xvf go1.13.1.linux-amd64.tar.gz 添加到环境变量中 vim /etc/profile export PATH=$PATH:/usr/local/go/bin 重载环境变量 source /etc/profile 查看版本 go version 1.2安装Prometheus tar -C /usr/local/ -xvf prometheus-2.13.0

数据分析师如何自力更生统计用户行为频次?

泪湿孤枕 提交于 2019-12-02 04:43:54
不懂数据分析的 growth hacker 不是好运营。近日我想要统计我家产品 xue.cn 用户的编程自学行为的频次,且在不给技术开发部门带来任何新需求的情况下自力更生。那么,我该如何定义并统计这个数据指标呢? 1、定义 学习 这个行为。 某些行为是单个事件,某些行为是多种事件的组合。 xue.cn 用户的编程自学行为包括:完成某书一个章节的阅读、完成一道习题、获得一个成就、提交一次评论,完成一次心得打卡等,未来还会有更多。不过,虽然我们有聊天室,但因为使用的是 gitter ,所以数据采集并不容易,这个行为就暂忽略。 以上编程自学行为事件数据分布在产品数据库的多个表中。 2、日志数据的初步筛选。 通过在多个表中联合查询 user_id,事件发生日期得到每个 user_id 有学习行为的日期数据,我的 sql 语句是这么写的: with data_study as( -- 获取有学习行为的用户名单及学习事件发生时间 select date(created_at) as time, user_id from user_comment union all select date(created_at) as time, user_id from user_activity union all select date(created_at) as time, user_id from

使用Prometheus监控SpringBoot应用

孤者浪人 提交于 2019-12-02 04:40:59
通过之前的文章我们使用Prometheus监控了应用服务器node_exporter,数据库mysqld_exporter,今天我们来监控一下你的应用。(本文以SpringBoot 2.1.9.RELEASE 作为监控目标) 编码 添加依赖 使用Prometheus监控SpringBoot应用只需要在pom文件添加如下两个依赖: <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency> <dependency> <groupId>io.micrometer</groupId> <artifactId>micrometer-registry-prometheus</artifactId> </dependency> 修改配置 修改application.properties或者application.yml文件,对外暴露监控端点 spring.application.name = blog management.endpoints.web.exposure.include = prometheus management.metrics.tags.application = ${spring

Use time field from influxdb in grafana single stat

我的梦境 提交于 2019-12-02 03:53:53
问题 Is it possible to use the time field in a single stat panel in grafana? I understand you cannot only query the time field in influxdb, but I can get the time of the stat I'm interested in like so: select time, last(context_id) from "data_context" And just need a way to show the time field from the execution of the query. 回答1: This is quiet often asked on stack overflow, but it is not possible at the moment. But there are open Feature requests for this on github: [Feature request] Show

Make InfluxDB/Grafana cumulative function that resets daily (sawtooth graph)

旧巷老猫 提交于 2019-12-02 03:32:53
问题 I'm logging energy usage data as a counter, which I would like to display as cumulative graphs that reset daily, as similarly asked here. I can generate the cumulative value as follows: SELECT mean("value") \ FROM "energy" \ WHERE $timeFilter \ GROUP BY time($__interval) and the daily value as well: SELECT max("value") \ FROM "energy" \ WHERE $timeFilter \ GROUP BY time(1d) but I cannot subtract this or get this in one query, because the GROUP BY times are different. (How) is this possible in

【开源监控】Prometheus

一世执手 提交于 2019-12-02 02:02:45
Prometheus Prometheus介绍 Prometheus新一代开源监控解决方案。 github地址 Prometheus主要功能 多维 数据模型 (时序由 metric 名字和 k/v 的 labels 构成)。 灵活的查询语句( PromQL )。 无依赖存储,支持 local 和 remote 不同模型。 采用 http 协议,使用 pull 模式,拉取数据,简单易懂。 监控目标,可以采用服务发现或静态配置的方式。 支持多种统计数据模型,图形化友好。 Prometheus核心组件 Prometheus Server , 主要用于抓取数据和存储时序数据,另外还提供查询和 Alert Rule 配置管理。 client libraries ,用于对接 Prometheus Server, 可以查询和上报数据。 push gateway ,用于批量,短期的监控数据的汇总节点,主要用于业务数据汇报等。 各种汇报数据的 exporters ,例如汇报机器数据的 node_exporter, 汇报 MongoDB 信息的 MongoDB exporter 等等。 用于告警通知管理的 alertmanager 。 Prometheus安装 二进制安装 cd /opt wget https://github.com/prometheus/prometheus/releases

Make InfluxDB/Grafana cumulative function that resets daily (sawtooth graph)

别等时光非礼了梦想. 提交于 2019-12-02 00:41:22
I'm logging energy usage data as a counter, which I would like to display as cumulative graphs that reset daily, as similarly asked here . I can generate the cumulative value as follows: SELECT mean("value") \ FROM "energy" \ WHERE $timeFilter \ GROUP BY time($__interval) and the daily value as well: SELECT max("value") \ FROM "energy" \ WHERE $timeFilter \ GROUP BY time(1d) but I cannot subtract this or get this in one query, because the GROUP BY times are different. (How) is this possible in influxdb? I've looked at INTEGRATE() but this haven't found a way to make this working. The data