prometheus采集服务的jmx数据,grafana通过dashboard展示jmx数据

这篇具有很好参考价值的文章主要介绍了prometheus采集服务的jmx数据,grafana通过dashboard展示jmx数据。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

一、下载prometheus

https://github.com/prometheus/prometheus/releases/download/v2.45.0/prometheus-2.45.0.linux-amd64.tar.gz

二、解压prometheus

 tar -zxvf prometheus-2.45.0.linux-amd64.tar.gz -C /data/src

重命名目录

mv prometheus-2.45.0.linux-amd64/ prometheus

三、查看prometheus目录

 ls
console_libraries  consoles  LICENSE  NOTICE  prometheus  prometheus.yml  promtool

四、查看prometheus版本

 ./prometheus --version
prometheus, version 2.45.0 (branch: HEAD, revision: 8ef767e396bf8445f009f945b0162fd71827f445)
  build user:       root@920118f645b7
  build date:       20230623-15:09:49
  go version:       go1.20.5
  platform:         linux/amd64
  tags:             netgo,builtinassets,stringlabels

五、查看prometheus的配置文件

cat prometheus.yml 
# my global config
global:
  scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
  evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
  # scrape_timeout is set to the global default (10s).

# Alertmanager configuration
alerting:
  alertmanagers:
    - static_configs:
        - targets:
          # - alertmanager:9093

# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
rule_files:
  # - "first_rules.yml"
  # - "second_rules.yml"

# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
scrape_configs:
  # The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
  - job_name: "prometheus"

    # metrics_path defaults to '/metrics'
    # scheme defaults to 'http'.

    static_configs:
      - targets: ["localhost:9090"]

六、启动prometheus

./prometheus --config.file=prometheus.yml
ts=2023-07-10T14:18:25.894Z caller=main.go:534 level=info msg="No time or size retention was set so using the default time retention" duration=15d
ts=2023-07-10T14:18:25.894Z caller=main.go:578 level=info msg="Starting Prometheus Server" mode=server version="(version=2.45.0, branch=HEAD, revision=8ef767e396bf8445f009f945b0162fd71827f445)"
ts=2023-07-10T14:18:25.894Z caller=main.go:583 level=info build_context="(go=go1.20.5, platform=linux/amd64, user=root@920118f645b7, date=20230623-15:09:49, tags=netgo,builtinassets,stringlabels)"
ts=2023-07-10T14:18:25.894Z caller=main.go:584 level=info host_details="(Linux 3.10.0-1160.11.1.el7.x86_64 #1 SMP Fri Dec 18 16:34:56 UTC 2020 x86_64 t-qcbj5-hadoop-database-003.test-qcloud-dd-insight.net mynextev.net)"
ts=2023-07-10T14:18:25.894Z caller=main.go:585 level=info fd_limits="(soft=100002, hard=100002)"
ts=2023-07-10T14:18:25.894Z caller=main.go:586 level=info vm_limits="(soft=unlimited, hard=unlimited)"
ts=2023-07-10T14:18:25.896Z caller=web.go:562 level=info component=web msg="Start listening for connections" address=0.0.0.0:9090
ts=2023-07-10T14:18:25.897Z caller=main.go:1019 level=info msg="Starting TSDB ..."
ts=2023-07-10T14:18:25.898Z caller=tls_config.go:274 level=info component=web msg="Listening on" address=[::]:9090
ts=2023-07-10T14:18:25.898Z caller=tls_config.go:277 level=info component=web msg="TLS is disabled." http2=false address=[::]:9090
ts=2023-07-10T14:18:25.901Z caller=head.go:595 level=info component=tsdb msg="Replaying on-disk memory mappable chunks if any"
ts=2023-07-10T14:18:25.901Z caller=head.go:676 level=info component=tsdb msg="On-disk memory mappable chunks replay completed" duration=5.464µs
ts=2023-07-10T14:18:25.901Z caller=head.go:684 level=info component=tsdb msg="Replaying WAL, this may take a while"
ts=2023-07-10T14:18:25.902Z caller=head.go:755 level=info component=tsdb msg="WAL segment loaded" segment=0 maxSegment=0
ts=2023-07-10T14:18:25.902Z caller=head.go:792 level=info component=tsdb msg="WAL replay completed" checkpoint_replay_duration=30.401µs wal_replay_duration=440.59µs wbl_replay_duration=175ns total_replay_duration=497.133µs
ts=2023-07-10T14:18:25.903Z caller=main.go:1040 level=info fs_type=XFS_SUPER_MAGIC
ts=2023-07-10T14:18:25.903Z caller=main.go:1043 level=info msg="TSDB started"
ts=2023-07-10T14:18:25.903Z caller=main.go:1224 level=info msg="Loading configuration file" filename=prometheus.yml
ts=2023-07-10T14:18:25.908Z caller=main.go:1261 level=info msg="Completed loading of configuration file" filename=prometheus.yml totalDuration=4.283491ms db_storage=2.843µs remote_storage=4.02µs web_handler=359ns query_engine=2.046µs scrape=3.883248ms scrape_sd=29.859µs notify=36.267µs notify_sd=10.1µs rules=2.501µs tracing=22.132µs
ts=2023-07-10T14:18:25.908Z caller=main.go:1004 level=info msg="Server is ready to receive web requests."
ts=2023-07-10T14:18:25.908Z caller=manager.go:995 level=info component="rule manager" msg="Starting rule manager..."

七、登陆prometheus

http://ip:9090prometheus采集服务的jmx数据,grafana通过dashboard展示jmx数据,日常分享专栏,prometheus,采集服务的jmx数据,grafana,dashboard,展示jmx数据
prometheus采集服务的jmx数据,grafana通过dashboard展示jmx数据,日常分享专栏,prometheus,采集服务的jmx数据,grafana,dashboard,展示jmx数据

八、查看prometheus jmx

http://ip:9090/metrics
prometheus采集服务的jmx数据,grafana通过dashboard展示jmx数据,日常分享专栏,prometheus,采集服务的jmx数据,grafana,dashboard,展示jmx数据

九、下载grafana

wget https://mirrors.tuna.tsinghua.edu.cn/grafana/yum/rpm/Packages/grafana-10.0.1-1.x86_64.rpm

十、安装grafana

yum install grafana-10.0.1-1.x86_64.rpm

十一、启动grafana

启动grafana

systemctl start grafana-server.service

查看grafana状态

systemctl status grafana-server.service 
● grafana-server.service - Grafana instance
   Loaded: loaded (/usr/lib/systemd/system/grafana-server.service; disabled; vendor preset: disabled)
   Active: active (running) since Mon 2023-07-10 22:33:52 CST; 2s ago
     Docs: http://docs.grafana.org
 Main PID: 14630 (grafana)
   CGroup: /system.slice/grafana-server.service
           └─14630 /usr/share/grafana/bin/grafana server --config=/etc/grafana/grafana.ini --pidfile=/var/run/grafana/grafana-server.pid --...

Jul 10 22:33:52 t-qcbj5-hadoop-database-003.test-qcloud-dd-insight.net grafana[14630]: logger=modules t=2023-07-10T22:33:52.929664759+08....."
Jul 10 22:33:52 t-qcbj5-hadoop-database-003.test-qcloud-dd-insight.net grafana[14630]: logger=ngalert.state.manager t=2023-07-10T22:33:5...up"
Jul 10 22:33:52 t-qcbj5-hadoop-database-003.test-qcloud-dd-insight.net systemd[1]: Started Grafana instance.
Jul 10 22:33:52 t-qcbj5-hadoop-database-003.test-qcloud-dd-insight.net grafana[14630]: logger=ngalert.state.manager t=2023-07-10T22:33:5…067µs
Jul 10 22:33:52 t-qcbj5-hadoop-database-003.test-qcloud-dd-insight.net grafana[14630]: logger=ticker t=2023-07-10T22:33:52.930088471+08:...:00
Jul 10 22:33:52 t-qcbj5-hadoop-database-003.test-qcloud-dd-insight.net grafana[14630]: logger=ngalert.multiorg.alertmanager t=2023-07-10...er"
Jul 10 22:33:52 t-qcbj5-hadoop-database-003.test-qcloud-dd-insight.net grafana[14630]: logger=grafanaStorageLogger t=2023-07-10T22:33:52...ng"
Jul 10 22:33:52 t-qcbj5-hadoop-database-003.test-qcloud-dd-insight.net grafana[14630]: logger=http.server t=2023-07-10T22:33:52.93363107...et=
Jul 10 22:33:53 t-qcbj5-hadoop-database-003.test-qcloud-dd-insight.net grafana[14630]: logger=plugins.update.checker t=2023-07-10T22:33:...7ms
Jul 10 22:33:53 t-qcbj5-hadoop-database-003.test-qcloud-dd-insight.net grafana[14630]: logger=grafana.update.checker t=2023-07-10T22:33:...1ms
Hint: Some lines were ellipsized, use -l to show in full.

十二、登陆grafana

账号和密码都是:admin
prometheus采集服务的jmx数据,grafana通过dashboard展示jmx数据,日常分享专栏,prometheus,采集服务的jmx数据,grafana,dashboard,展示jmx数据

十三、添加prometheus数据源

prometheus采集服务的jmx数据,grafana通过dashboard展示jmx数据,日常分享专栏,prometheus,采集服务的jmx数据,grafana,dashboard,展示jmx数据prometheus的URL是http://ip:9090
prometheus采集服务的jmx数据,grafana通过dashboard展示jmx数据,日常分享专栏,prometheus,采集服务的jmx数据,grafana,dashboard,展示jmx数据
添加成功后保存数据源,成功如下所示
prometheus采集服务的jmx数据,grafana通过dashboard展示jmx数据,日常分享专栏,prometheus,采集服务的jmx数据,grafana,dashboard,展示jmx数据

十四、prometheus收集服务jmx信息

修改配置文件prometheus.yml

- job_name: 'debezium-prod-jmx'
  static_configs:
    - targets: ['10.170.116.170:7081', '10.170.77.194:7081']  # 多个JMX端口的地址和端口

重启prometheus

十五、查看prometheus的status

发现成功采集debezium服务的jmx数据
prometheus采集服务的jmx数据,grafana通过dashboard展示jmx数据,日常分享专栏,prometheus,采集服务的jmx数据,grafana,dashboard,展示jmx数据

十六、grafana为prometheus添加dashboard

grafana官网搜索你想监控的服务的dashboard:

  • https://grafana.com/grafana/dashboards/

两种方法:

  • grafana官网搜索UID
  • 复制服务json

唯一标识符 (UID)
仪表板的唯一标识符 (UID) 可用于唯一标识多个 Grafana 安装之间的仪表板。 UID 允许使用一致的 URL 来访问仪表板,因此更改仪表板的标题不会破坏任何指向该仪表板的书签链接。

prometheus采集服务的jmx数据,grafana通过dashboard展示jmx数据,日常分享专栏,prometheus,采集服务的jmx数据,grafana,dashboard,展示jmx数据

查看添加的dashboard:

prometheus采集服务的jmx数据,grafana通过dashboard展示jmx数据,日常分享专栏,prometheus,采集服务的jmx数据,grafana,dashboard,展示jmx数据文章来源地址https://www.toymoban.com/news/detail-561907.html

到了这里,关于prometheus采集服务的jmx数据,grafana通过dashboard展示jmx数据的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • Springboot 集成Prometheus 数据采集 使用grafana 监控报告告警 邮件配置

    目录 Springboot 相关 Pom 重点包 如果有需要可以增加安全包-一般内部机房没啥事-(非必选) Application.yml配置文件-(非必选) Application.properties management.endpoints.web.exposure.include介绍 启动类 查看监控信息 Prometheus Prometheus.yml 配置 如果使用类安全包-(非必选) 启动就可以看到了

    2024年02月11日
    浏览(40)
  • 【Prometheus】mysqld_exporter采集+Grafana出图+AlertManager预警

    前提环境:已经安装和配置好prometheus server 所有组件对应的版本: prometheus-2.44.0 mysqld_exporter-0.14.0 grafana-enterprise-9.1.2-1.x86_64.rpm alertmanager-0.25.0 prometheus-webhook-dingtalk-2.1.0 mysql_exporter是用来收集MysQL或者Mariadb数据库相关指标的,mysql_exporter需要连接到数据库并有相关权限。既可以

    2024年02月09日
    浏览(31)
  • Prometheus服务器、Prometheus被监控端、Grafana、监控MySQL数据库、自动发现概述、配置自动发现、Alertmanager

    目录 Prometheus概述 部署Prometheus服务器 环境说明: 配置时间 安装Prometheus服务器 添加被监控端 部署通用的监控exporter Grafana 概述 部署Grafana 展示node1的监控信息 监控MySQL数据库 配置MySQL 配置mysql exporter 配置mysql exporter 配置prometheus监控mysql 自动发现机制 概述 基于文件自动发现

    2024年02月21日
    浏览(44)
  • Prometheus服务器、Prometheus被监控端、Grafana、Prometheus服务器、Prometheus被监控端、Grafana

    day03Prometheus概述部署Prometheus服务器环境说明:配置时间安装Prometheus服务器添加被监控端部署通用的监控exporterGrafana概述部署Grafana展示node1的监控信息监控MySQL数据库配置MySQL配置mysql exporter配置mysql exporter配置prometheus监控mysql自动发现机制概述基于文件自动发现修改Prometheus使

    2024年02月14日
    浏览(32)
  • prometheus + grafana进行服务器资源监控

    在性能测试中,服务器资源是值得关注一项内容,目前,市面上已经有很多的服务器资 源监控方法和各种不同的监控工具,方便在各个项目中使用。 但是,在性能测试中,究竟哪些指标值得被关注呢? 监控有着的分级体系,下面引用:   在以前的工作中,想要实现服务器资

    2024年02月11日
    浏览(31)
  • prometheus+grafana进行服务器资源监控

    在性能测试中,服务器资源是值得关注一项内容,目前,市面上已经有很多的服务器资 源监控方法和各种不同的监控工具,方便在各个项目中使用。 但是,在性能测试中,究竟哪些指标值得被关注呢? 监控有着的分级体系,下面引用: 在以前的工作中,想要实现服务器资源

    2024年02月10日
    浏览(38)
  • Prometheus+Grafana 监控平台实践-搭建&常用服务监控&告警

    Prometheus 是一个开放性的监控解决方案,通过各种 Exporter 采集当前主机/服务的数据,和 Grafana 相结合可以实现强大的监控和可视化功能 本篇将分享使用 docker compose 构建 Prometheus+Grafana,并监控之前文章所搭建的主机服务,分享日常使用的一些使用经验 文章较长,已安装可略

    2024年02月05日
    浏览(42)
  • Prometheus + Grafana 实现服务器的可视化

    Prometheus + Grafana 实现服务器的可视化 系统环境准备: 服务器IP:172.20.26.204 系统版本:CentOS Linux release 7.9.2009 (Core) 安装基础工具软件,系统更新 yum install vim net-tools epel-release wget -y yum update Prometheus 简介 Prometheus 是一个开源监控工具,实现了高维数据模型。Prometheus 有多种数据

    2024年01月18日
    浏览(29)
  • Grafana集成prometheus(3.Grafana添加promethus数据)

    选择Connections - Datasources,点击Add New data source,填写Promitheus Server Url,点击 save test完成配置 选择prometheus数据库 选择code 填入对应的查询公式(监控公式参考Prometheus监控公式) 修改面板名称Title 点击save 百度可以获取常见用途的公式,mark备用。

    2024年02月14日
    浏览(44)
  • Centos 从0搭建grafana和Prometheus 服务以及问题解决

    虚拟机下载 https://customerconnect.vmware.com/en/downloads/info/slug/desktop_end_user_computing/vmware_workstation_player/17_0 cenos 镜像下载 https://www.centos.org/download/ grafana 服务下载 https://grafana.com/grafana/download/7.4.0?platform=linux Prometheus 服务下载 https://prometheus.io/download/ grafana安装 grafana 启动 prometheus 安

    2024年02月14日
    浏览(30)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包