Prometheus入门到放弃(3)之Grafana展示监控数据

grafana我们这里采用docker方式部署

1、下载镜像

镜像官网地址:https://hub.docker.com/r/grafana/grafana/tags

[root@prometheus-server ~]# docker pull grafana/grafana:latest

2、启动

[root@prometheus-server ~]# docker run \
   -d \
   -p 3000:3000 \
   --name=grafana \
   -v /etc/localtime:/etc/localtime:ro \
   grafana/grafana

3、访问

浏览器打开http://10.10.0.13:3000,用户名密码:admin

4、为Grafana添加Prometheus数据源

Name:定义数据源的名字;
URL:Prometheus 服务的IP地址和端口;
其他保持默认,然后点击测试并保存。

5、创建Dashboard

  5.1 New Dashboard

  5.2 选择模型

5.3 添加CPU使用率图形

5.4 更改标题

其他默认保存,其它监控项添加类似,下面为一个完整Dashboard。

注意:

   对于Grafana创建Dashboard界面,如果对Grafana不熟悉,我们可以从Grafana官网下载对应模板,然后导入再进行简单修改,以符合自己的监控Dashboard面板。

  模板地址:https://grafana.com/dashboards

  特别注意因为node_exporter是比较老的组件,有一些dashboard模板都是基于老版本node_exporter开发,所以一些指标名称有些不一样

 例如:

* node_cpu ->  node_cpu_seconds_total
* node_memory_MemTotal -> node_memory_MemTotal_bytes
* node_memory_MemFree -> node_memory_MemFree_bytes
* node_filesystem_avail -> node_filesystem_avail_bytes
* node_filesystem_size -> node_filesystem_size_bytes
* node_disk_io_time_ms -> node_disk_io_time_seconds_total
* node_disk_reads_completed -> node_disk_reads_completed_total
* node_disk_sectors_written -> node_disk_written_bytes_total
* node_time -> node_time_seconds
* node_boot_time -> node_boot_time_seconds
* node_intr -> node_intr_total

导入模板步骤:

1、查找模板

这里我选用这个node_exporter模板:https://grafana.com/dashboards/8919

然后下载json文件

2、导入模板

3、导入完成后,可以看到以下Dashboard界面

 

 以上就是现有模板导入的操作,有时候我们使用别人的模板有些图不一定会出图形,这时候我们需要看下图形公式是否正确,相应调整即可,更多模板请参考:https://grafana.com/dashboards

转载于:https://www.cnblogs.com/tchua/p/11115146.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
一、prometheus简介 Prometheus是一个开源的系统监控和告警系统,现在已经加入到CNCF基金会,成为继k8s之后第二个在CNCF维护管理的项目,在kubernetes容器管理系统中,通常会搭配prometheus进行监控prometheus支持多种exporter采集数据,还支持通过pushgateway进行数据上报,Prometheus再性能上可支撑上万台规模的集群。 二、prometheus架构图 三、prometheus组件介绍 1.Prometheus Server: 用于收集和存储时间序列数据。 2.Client Library: 客户端库,检测应用程序代码,当Prometheus抓取实例的HTTP端点时,客户端库会将所有跟踪的metrics指标的当前状态发送到prometheus server端。 3.Exporters: prometheus支持多种exporter,通过exporter可以采集metrics数据,然后发送到prometheus server端 4.Alertmanager: 从 Prometheus server 端接收到 alerts 后,会进行去重,分组,并路由到相应的接收方,发出报警,常见的接收方式有:电子邮件,微信,钉钉, slack等。 5.Grafana监控仪表盘 6.pushgateway: 各个目标主机可上报数据到pushgatewy,然后prometheus server统一从pushgateway拉取数据。 四、课程亮点 五、效果图展示 六、讲师简介 先超(lucky):高级运维工程师、资深DevOps工程师,在互联网上市公司拥有多年一线运维经验,主导过亿级pv项目的架构设计和运维工作 主要研究方向: 1.云计算方向:容器 (kubernetes、docker),虚拟化(kvm、Vmware vSphere),微服务(istio),PaaS(openshift),IaaS(openstack)等2.系统/运维方向:linux系统下的常用组件(nginx,tomcat,elasticsearch,zookeeper,kafka等),DevOps(Jenkins+gitlab+sonarqube+nexus+k8s),CI/CD,监控(zabbix、prometheus、falcon)等 七、课程大纲
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值