SlideShare una empresa de Scribd logo
1 de 17
How-To Go
The Extra Mile
on Monitoring
Grafana + Prometheus + JMX
+ PushGateway
Introduction
With this presentation, you will be able get even more metrics from your
Cluster/Applications.
Pre-Assumptions
1. Grafana Installed
2. Prometheus Installed
JMX
Create and Download JMX Exporter Directory
sudo mkdir -p /opt/jmx-exporter;
sudo cd /opt/jmx-exporter;
sudo wget
https://repo1.maven.org/maven2/io/prometheus/jmx/jmx_prometheus_javaagent/0.15.0/jmx_prometheus_javaagent-
0.15.0.jar;
Note: just need to change the highlighted values for your own values.
JMX - Use Case Kafka
Download Kafka YML
sudo cd /opt/jmx-exporter;
wget https://github.com/prometheus/jmx_exporter/blob/master/example_configs/kafka-2_0_0.yml;
mv kafka-2_0_0.yml kafka_broker.yml;
[Cloudera] CM - Kafka Configuration (broker_java_opts)
-Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -
javaagent:/opt/prometheus/jmx_prometheus_javaagent-0.15.0.jar=7072:/opt/prometheus/kafka_broker.yml
Restart Service and Check HTTP Metrics
Note: just need to change the highlighted values for your own values.
JMX - Use Case Kafka
Add Job to Prometheus Config YML
sudo nano /etc/prometheus/prometheus.yml;
- job_name: 'kafka_jmx'
# metrics_path defaults to '/metrics'
# scheme defaults to 'http'
scrape_interval: 5s
static_configs:
- targets: ['10.111.22.33:7072']
Restart Prometheus Service
sudo systemctl restart prometheus;
Note: just need to change the highlighted values for your own values.
JMX - Use Case NiFi
Create NiFi Metrics Config YML
sudo nano /usr/hdp/nifi/conf/nifi.yml;
lowercaseOutputLabelNames: true
lowercaseOutputName: true
rules:- pattern: ".*"
Add to Nifi Bootstrap Config File
sudo nano /usr/hdp/nifi/conf/bootstrap.conf; java.arg.18=-javaagent:/opt/jmx-exporter/jmx_prometheus_javaagent-
0.15.0.jar=7474:/usr/hdp/nifi/conf/nifi.yml
Note: java.arg.XX the XX value should be unique!
Restart Prometheus Service
sudo systemctl restart prometheus;
Note: just need to change the highlighted values for your own values.
Add Job to Prometheus Config YML
sudo nano /etc/prometheus/prometheus.yml;
- job_name: 'nifi_jmx'
# metrics_path defaults to '/metrics'
# scheme defaults to 'http'
scrape_interval: 5s
static_configs:
- targets: ['10.111.22.44:7474']
PushGateway
Download PushGateway
sudo cd /u01/downloads;
sudo wget https://github.com/prometheus/pushgateway/releases/download/v1.4.0/pushgateway-1.4.0.linux-amd64.tar.gz;
sudo tar xvzf pushgateway-1.4.0.linux-amd64.tar.gz && mv pushgateway-1.4.0.linux-amd64/pushgateway
/usr/local/bin/pushgateway;
PushGateway
Create User
sudo useradd -m -s /bin/false pushgateway && id pushgateway;
sudo chown pushgateway:pushgateway /usr/local/bin/pushgateway;
Create User
sudo nano /etc/prometheus/prometheus.yml;
global:
scrape_interval: 1s
scrape_configs:
- job_name: 'pushgateway'
honor_labels: true
Static_configs:
- targets: ['10.111.22.33:9091']
Adjust the firewall
sudo firewall-cmd --add-port=9091/tcp --permanent && firewall-cmd --reload;
Note: just need to change the highlighted values for your own values.
PushGateway
Creating a Systemd service file for Prometheus Server
sudo nano /etc/systemd/system/pushgateway.service;
[Unit]
Description=Custom Metrics on PushGateway
Wants=network-online.target
After=network-online.target
[Service]
User=pushgateway
Group=pushgateway
Type=simple
ExecStart=/usr/local/bin/pushgateway 
--web.listen-address=:9091 
--web.enable-admin-api 
--web.telemetry-path=/metrics 
--persistence.file=/tmp/metric.store 
--persistence.interval=5m
[Install]
WantedBy=multi-user.target
Note: just need to change the highlighted values for your own values.
PushGateway
Reload the Systemctl
sudo systemctl daemon-reload;
Now start and enable Prometheus to run on boot
sudo systemctl start pushgateway && sudo systemctl enable pushgateway;
Confirm Pushgateway is UP
sudo netstat -tunlp | grep pushgateway;
Note: just need to change the highlighted values for your own values.
PushGateway
Create Top Custom Metrics Script
sudo nano metricsTOP;
#!/bin/bash
# CPU Usage %
z=$(ps aux | grep -v '[' )
while read -r z
do
var=$var$(awk 'NR>1 {print "cpu_usage{user=""$1"" , pid=""$2"" , process=""$11"", arg=""$12" "$13" "$14" "$15"" }", $3z}');
done <<< "$z"
curl -X POST -H "Content-Type: text/plain" --data "$var
" http://localhost:9091/metrics/job/top/instance/hostname01
# Memory Usage Bytes
x=$(ps aux | grep -v '[' )
while read -r x
do
var2=$var2$(awk 'NR>1 {print "memory_usage{user=""$1"" , pid=""$2"" , process=""$11"", arg=""$12" "$13" "$14" "$15"" }", $6x}');
done <<< "$x"
curl -X POST -H "Content-Type: text/plain" --data "$var2
" http://localhost:9091/metrics/job/top/instance/hostname01
sudo chmod u+x metricsTOP && ./metricsTOP;
PushGateway
Create Crontab Job
sudo contrab -e;
* * * * * for i in {1..60}; do /path/metricsTOP & sleep 1; done
Create IOTop Custom Metrics Script
sudo nano metricsTOP;
* * * * * for i in {1..60}; do /path/metricsTOP & sleep 1; done
PushGateway
Create IOTop Custom Metrics Script
# IO Usage %
t=$(iotop -Pkqbn 1 | grep -v '[' )
while read -r t
do
var3=$var3$(awk 'NR>2 {print "iotop_usage{user=""$3"" , pid=""$1"" , stream="%" ,process=""$12"", arg=""$13" "$14" "$15" "$16"" }", $10}');
done <<< "$t"
curl -X POST -H "Content-Type: text/plain" --data "$var3
" http://localhost:9091/metrics/job/iotop/instance/hostname01
# IO Read Kbs
u=$(iotop -Pkqbn 1 | grep -v '[' )
while read -r u
do
var4=$var4$(awk 'NR>2 {print "iotop_read{user=""$3"" , pid=""$1"" , stream="read" ,process=""$12"", arg=""$13" "$14" "$15" "$16"" }", $4}');
done <<< "$u"
curl -X POST -H "Content-Type: text/plain" --data "$var4
" http://localhost:9091/metrics/job/iotop/instance/hostname01
# IO Write Kbs
v=$(iotop -Pkqbn 1 | grep -v '[' )
while read -r v
do
var5=$var5$(awk 'NR>2 {print "iotop_write{user=""$3"" , pid=""$1"" , stream="write" ,process=""$12"", arg=""$13" "$14" "$15" "$16"" }", $6}');
done <<< "$v"
curl -X POST -H "Content-Type: text/plain" --data "$var5
" http://localhost:9091/metrics/job/iotop/instance/hostname01
Note: just need to change the highlighted values for your own values.
Grafana
Grafana
Thanks
Big Data Engineer
Tiago Simões

Más contenido relacionado

La actualidad más candente

An example Hadoop Install
An example Hadoop InstallAn example Hadoop Install
An example Hadoop InstallMike Frampton
 
Hadoop installation
Hadoop installationHadoop installation
Hadoop installationAnkit Desai
 
Set up Hadoop Cluster on Amazon EC2
Set up Hadoop Cluster on Amazon EC2Set up Hadoop Cluster on Amazon EC2
Set up Hadoop Cluster on Amazon EC2IMC Institute
 
Running hadoop on ubuntu linux
Running hadoop on ubuntu linuxRunning hadoop on ubuntu linux
Running hadoop on ubuntu linuxTRCK
 
Install and Configure Ubuntu for Hadoop Installation for beginners
Install and Configure Ubuntu for Hadoop Installation for beginners Install and Configure Ubuntu for Hadoop Installation for beginners
Install and Configure Ubuntu for Hadoop Installation for beginners Shilpa Hemaraj
 
Hadoop single node setup
Hadoop single node setupHadoop single node setup
Hadoop single node setupMohammad_Tariq
 
Automated infrastructure is on the menu
Automated infrastructure is on the menuAutomated infrastructure is on the menu
Automated infrastructure is on the menujtimberman
 
DevOps(4) : Ansible(2) - (MOSG)
DevOps(4) : Ansible(2) - (MOSG)DevOps(4) : Ansible(2) - (MOSG)
DevOps(4) : Ansible(2) - (MOSG)Soshi Nemoto
 
Ansible 實戰:top down 觀點
Ansible 實戰:top down 觀點Ansible 實戰:top down 觀點
Ansible 實戰:top down 觀點William Yeh
 
Automated Java Deployments With Rpm
Automated Java Deployments With RpmAutomated Java Deployments With Rpm
Automated Java Deployments With RpmMartin Jackson
 
Vagrant, Ansible, and OpenStack on your laptop
Vagrant, Ansible, and OpenStack on your laptopVagrant, Ansible, and OpenStack on your laptop
Vagrant, Ansible, and OpenStack on your laptopLorin Hochstein
 
DevOps(3) : Ansible - (MOSG)
DevOps(3) : Ansible - (MOSG)DevOps(3) : Ansible - (MOSG)
DevOps(3) : Ansible - (MOSG)Soshi Nemoto
 
[오픈소스컨설팅] 프로메테우스 모니터링 살펴보고 구성하기
[오픈소스컨설팅] 프로메테우스 모니터링 살펴보고 구성하기[오픈소스컨설팅] 프로메테우스 모니터링 살펴보고 구성하기
[오픈소스컨설팅] 프로메테우스 모니터링 살펴보고 구성하기Ji-Woong Choi
 
From Dev to DevOps - Codemotion ES 2012
From Dev to DevOps - Codemotion ES 2012From Dev to DevOps - Codemotion ES 2012
From Dev to DevOps - Codemotion ES 2012Carlos Sanchez
 
How to Develop Puppet Modules: From Source to the Forge With Zero Clicks
How to Develop Puppet Modules: From Source to the Forge With Zero ClicksHow to Develop Puppet Modules: From Source to the Forge With Zero Clicks
How to Develop Puppet Modules: From Source to the Forge With Zero ClicksCarlos Sanchez
 
Making Your Capistrano Recipe Book
Making Your Capistrano Recipe BookMaking Your Capistrano Recipe Book
Making Your Capistrano Recipe BookTim Riley
 
Multinode kubernetes-cluster
Multinode kubernetes-clusterMultinode kubernetes-cluster
Multinode kubernetes-clusterRam Nath
 
Preparation study of_docker - (MOSG)
Preparation study of_docker  - (MOSG)Preparation study of_docker  - (MOSG)
Preparation study of_docker - (MOSG)Soshi Nemoto
 

La actualidad más candente (20)

An example Hadoop Install
An example Hadoop InstallAn example Hadoop Install
An example Hadoop Install
 
Hadoop installation
Hadoop installationHadoop installation
Hadoop installation
 
Set up Hadoop Cluster on Amazon EC2
Set up Hadoop Cluster on Amazon EC2Set up Hadoop Cluster on Amazon EC2
Set up Hadoop Cluster on Amazon EC2
 
Hadoop on ec2
Hadoop on ec2Hadoop on ec2
Hadoop on ec2
 
Running hadoop on ubuntu linux
Running hadoop on ubuntu linuxRunning hadoop on ubuntu linux
Running hadoop on ubuntu linux
 
Install and Configure Ubuntu for Hadoop Installation for beginners
Install and Configure Ubuntu for Hadoop Installation for beginners Install and Configure Ubuntu for Hadoop Installation for beginners
Install and Configure Ubuntu for Hadoop Installation for beginners
 
Hadoop single node setup
Hadoop single node setupHadoop single node setup
Hadoop single node setup
 
Automated infrastructure is on the menu
Automated infrastructure is on the menuAutomated infrastructure is on the menu
Automated infrastructure is on the menu
 
DevOps(4) : Ansible(2) - (MOSG)
DevOps(4) : Ansible(2) - (MOSG)DevOps(4) : Ansible(2) - (MOSG)
DevOps(4) : Ansible(2) - (MOSG)
 
Ansible 實戰:top down 觀點
Ansible 實戰:top down 觀點Ansible 實戰:top down 觀點
Ansible 實戰:top down 觀點
 
Automated Java Deployments With Rpm
Automated Java Deployments With RpmAutomated Java Deployments With Rpm
Automated Java Deployments With Rpm
 
Vagrant, Ansible, and OpenStack on your laptop
Vagrant, Ansible, and OpenStack on your laptopVagrant, Ansible, and OpenStack on your laptop
Vagrant, Ansible, and OpenStack on your laptop
 
DevOps(3) : Ansible - (MOSG)
DevOps(3) : Ansible - (MOSG)DevOps(3) : Ansible - (MOSG)
DevOps(3) : Ansible - (MOSG)
 
[오픈소스컨설팅] 프로메테우스 모니터링 살펴보고 구성하기
[오픈소스컨설팅] 프로메테우스 모니터링 살펴보고 구성하기[오픈소스컨설팅] 프로메테우스 모니터링 살펴보고 구성하기
[오픈소스컨설팅] 프로메테우스 모니터링 살펴보고 구성하기
 
From Dev to DevOps - Codemotion ES 2012
From Dev to DevOps - Codemotion ES 2012From Dev to DevOps - Codemotion ES 2012
From Dev to DevOps - Codemotion ES 2012
 
How to Develop Puppet Modules: From Source to the Forge With Zero Clicks
How to Develop Puppet Modules: From Source to the Forge With Zero ClicksHow to Develop Puppet Modules: From Source to the Forge With Zero Clicks
How to Develop Puppet Modules: From Source to the Forge With Zero Clicks
 
Making Your Capistrano Recipe Book
Making Your Capistrano Recipe BookMaking Your Capistrano Recipe Book
Making Your Capistrano Recipe Book
 
Multinode kubernetes-cluster
Multinode kubernetes-clusterMultinode kubernetes-cluster
Multinode kubernetes-cluster
 
Hadoop completereference
Hadoop completereferenceHadoop completereference
Hadoop completereference
 
Preparation study of_docker - (MOSG)
Preparation study of_docker  - (MOSG)Preparation study of_docker  - (MOSG)
Preparation study of_docker - (MOSG)
 

Similar a How to go the extra mile on monitoring

Control your deployments with Capistrano
Control your deployments with CapistranoControl your deployments with Capistrano
Control your deployments with CapistranoRamazan K
 
Continuous delivery with docker
Continuous delivery with dockerContinuous delivery with docker
Continuous delivery with dockerJohan Janssen
 
Web Applications with Eclipse RT and Docker in the Cloud
Web Applications with Eclipse RT and Docker in the CloudWeb Applications with Eclipse RT and Docker in the Cloud
Web Applications with Eclipse RT and Docker in the CloudMarkus Knauer
 
Continuous Delivery: The Next Frontier
Continuous Delivery: The Next FrontierContinuous Delivery: The Next Frontier
Continuous Delivery: The Next FrontierCarlos Sanchez
 
Plone deployment made easy
Plone deployment made easyPlone deployment made easy
Plone deployment made easyKim Chee Leong
 
9 creating cent_os 7_mages_for_dpdk_training
9 creating cent_os 7_mages_for_dpdk_training9 creating cent_os 7_mages_for_dpdk_training
9 creating cent_os 7_mages_for_dpdk_trainingvideos
 
Virtualization and automation of library software/machines + Puppet
Virtualization and automation of library software/machines + PuppetVirtualization and automation of library software/machines + Puppet
Virtualization and automation of library software/machines + PuppetOmar Reygaert
 
Capistrano deploy Magento project in an efficient way
Capistrano deploy Magento project in an efficient wayCapistrano deploy Magento project in an efficient way
Capistrano deploy Magento project in an efficient waySylvain Rayé
 
Tensorflow in Docker
Tensorflow in DockerTensorflow in Docker
Tensorflow in DockerEric Ahn
 
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis OverviewLeo Lorieri
 
X64服务器 lnmp服务器部署标准 new
X64服务器 lnmp服务器部署标准 newX64服务器 lnmp服务器部署标准 new
X64服务器 lnmp服务器部署标准 newYiwei Ma
 
PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...
PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...
PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...Puppet
 
Challenges of container configuration
Challenges of container configurationChallenges of container configuration
Challenges of container configurationlutter
 
Nginx 0.8.x 安装手册
Nginx 0.8.x 安装手册Nginx 0.8.x 安装手册
Nginx 0.8.x 安装手册Yiwei Ma
 
Magento 2 Development
Magento 2 DevelopmentMagento 2 Development
Magento 2 DevelopmentDuke Dao
 
Free radius billing server with practical vpn exmaple
Free radius billing server with practical vpn exmapleFree radius billing server with practical vpn exmaple
Free radius billing server with practical vpn exmapleChanaka Lasantha
 
DCEU 18: Tips and Tricks of the Docker Captains
DCEU 18: Tips and Tricks of the Docker CaptainsDCEU 18: Tips and Tricks of the Docker Captains
DCEU 18: Tips and Tricks of the Docker CaptainsDocker, Inc.
 

Similar a How to go the extra mile on monitoring (20)

Control your deployments with Capistrano
Control your deployments with CapistranoControl your deployments with Capistrano
Control your deployments with Capistrano
 
Continuous delivery with docker
Continuous delivery with dockerContinuous delivery with docker
Continuous delivery with docker
 
Web Applications with Eclipse RT and Docker in the Cloud
Web Applications with Eclipse RT and Docker in the CloudWeb Applications with Eclipse RT and Docker in the Cloud
Web Applications with Eclipse RT and Docker in the Cloud
 
Continuous Delivery: The Next Frontier
Continuous Delivery: The Next FrontierContinuous Delivery: The Next Frontier
Continuous Delivery: The Next Frontier
 
Plone deployment made easy
Plone deployment made easyPlone deployment made easy
Plone deployment made easy
 
9 creating cent_os 7_mages_for_dpdk_training
9 creating cent_os 7_mages_for_dpdk_training9 creating cent_os 7_mages_for_dpdk_training
9 creating cent_os 7_mages_for_dpdk_training
 
Docker
DockerDocker
Docker
 
Virtualization and automation of library software/machines + Puppet
Virtualization and automation of library software/machines + PuppetVirtualization and automation of library software/machines + Puppet
Virtualization and automation of library software/machines + Puppet
 
Nodejs in Production
Nodejs in ProductionNodejs in Production
Nodejs in Production
 
Capistrano deploy Magento project in an efficient way
Capistrano deploy Magento project in an efficient wayCapistrano deploy Magento project in an efficient way
Capistrano deploy Magento project in an efficient way
 
Docker practice
Docker practiceDocker practice
Docker practice
 
Tensorflow in Docker
Tensorflow in DockerTensorflow in Docker
Tensorflow in Docker
 
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
 
X64服务器 lnmp服务器部署标准 new
X64服务器 lnmp服务器部署标准 newX64服务器 lnmp服务器部署标准 new
X64服务器 lnmp服务器部署标准 new
 
PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...
PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...
PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...
 
Challenges of container configuration
Challenges of container configurationChallenges of container configuration
Challenges of container configuration
 
Nginx 0.8.x 安装手册
Nginx 0.8.x 安装手册Nginx 0.8.x 安装手册
Nginx 0.8.x 安装手册
 
Magento 2 Development
Magento 2 DevelopmentMagento 2 Development
Magento 2 Development
 
Free radius billing server with practical vpn exmaple
Free radius billing server with practical vpn exmapleFree radius billing server with practical vpn exmaple
Free radius billing server with practical vpn exmaple
 
DCEU 18: Tips and Tricks of the Docker Captains
DCEU 18: Tips and Tricks of the Docker CaptainsDCEU 18: Tips and Tricks of the Docker Captains
DCEU 18: Tips and Tricks of the Docker Captains
 

Último

Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераMark Opanasiuk
 
ADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptxADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptxFIDO Alliance
 
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...marcuskenyatta275
 
2024 May Patch Tuesday
2024 May Patch Tuesday2024 May Patch Tuesday
2024 May Patch TuesdayIvanti
 
Google I/O Extended 2024 Warsaw
Google I/O Extended 2024 WarsawGoogle I/O Extended 2024 Warsaw
Google I/O Extended 2024 WarsawGDSC PJATK
 
Your enemies use GenAI too - staying ahead of fraud with Neo4j
Your enemies use GenAI too - staying ahead of fraud with Neo4jYour enemies use GenAI too - staying ahead of fraud with Neo4j
Your enemies use GenAI too - staying ahead of fraud with Neo4jNeo4j
 
How we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfHow we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfSrushith Repakula
 
Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessUXDXConf
 
Portal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russePortal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russe中 央社
 
AI mind or machine power point presentation
AI mind or machine power point presentationAI mind or machine power point presentation
AI mind or machine power point presentationyogeshlabana357357
 
Microsoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - QuestionnaireMicrosoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - QuestionnaireExakis Nelite
 
WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024Lorenzo Miniero
 
Collecting & Temporal Analysis of Behavioral Web Data - Tales From The Inside
Collecting & Temporal Analysis of Behavioral Web Data - Tales From The InsideCollecting & Temporal Analysis of Behavioral Web Data - Tales From The Inside
Collecting & Temporal Analysis of Behavioral Web Data - Tales From The InsideStefan Dietze
 
ERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctBrainSell Technologies
 
TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024Stephen Perrenod
 
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxFIDO Alliance
 
Oauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoftOauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoftshyamraj55
 
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...Skynet Technologies
 
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfWhere to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfFIDO Alliance
 
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfThe Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfFIDO Alliance
 

Último (20)

Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджера
 
ADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptxADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptx
 
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
 
2024 May Patch Tuesday
2024 May Patch Tuesday2024 May Patch Tuesday
2024 May Patch Tuesday
 
Google I/O Extended 2024 Warsaw
Google I/O Extended 2024 WarsawGoogle I/O Extended 2024 Warsaw
Google I/O Extended 2024 Warsaw
 
Your enemies use GenAI too - staying ahead of fraud with Neo4j
Your enemies use GenAI too - staying ahead of fraud with Neo4jYour enemies use GenAI too - staying ahead of fraud with Neo4j
Your enemies use GenAI too - staying ahead of fraud with Neo4j
 
How we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfHow we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdf
 
Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
 
Portal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russePortal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russe
 
AI mind or machine power point presentation
AI mind or machine power point presentationAI mind or machine power point presentation
AI mind or machine power point presentation
 
Microsoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - QuestionnaireMicrosoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - Questionnaire
 
WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024
 
Collecting & Temporal Analysis of Behavioral Web Data - Tales From The Inside
Collecting & Temporal Analysis of Behavioral Web Data - Tales From The InsideCollecting & Temporal Analysis of Behavioral Web Data - Tales From The Inside
Collecting & Temporal Analysis of Behavioral Web Data - Tales From The Inside
 
ERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage Intacct
 
TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024
 
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
 
Oauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoftOauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoft
 
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
 
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfWhere to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
 
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfThe Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
 

How to go the extra mile on monitoring

  • 1. How-To Go The Extra Mile on Monitoring Grafana + Prometheus + JMX + PushGateway
  • 2. Introduction With this presentation, you will be able get even more metrics from your Cluster/Applications.
  • 4. JMX Create and Download JMX Exporter Directory sudo mkdir -p /opt/jmx-exporter; sudo cd /opt/jmx-exporter; sudo wget https://repo1.maven.org/maven2/io/prometheus/jmx/jmx_prometheus_javaagent/0.15.0/jmx_prometheus_javaagent- 0.15.0.jar; Note: just need to change the highlighted values for your own values.
  • 5. JMX - Use Case Kafka Download Kafka YML sudo cd /opt/jmx-exporter; wget https://github.com/prometheus/jmx_exporter/blob/master/example_configs/kafka-2_0_0.yml; mv kafka-2_0_0.yml kafka_broker.yml; [Cloudera] CM - Kafka Configuration (broker_java_opts) -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false - javaagent:/opt/prometheus/jmx_prometheus_javaagent-0.15.0.jar=7072:/opt/prometheus/kafka_broker.yml Restart Service and Check HTTP Metrics Note: just need to change the highlighted values for your own values.
  • 6. JMX - Use Case Kafka Add Job to Prometheus Config YML sudo nano /etc/prometheus/prometheus.yml; - job_name: 'kafka_jmx' # metrics_path defaults to '/metrics' # scheme defaults to 'http' scrape_interval: 5s static_configs: - targets: ['10.111.22.33:7072'] Restart Prometheus Service sudo systemctl restart prometheus; Note: just need to change the highlighted values for your own values.
  • 7. JMX - Use Case NiFi Create NiFi Metrics Config YML sudo nano /usr/hdp/nifi/conf/nifi.yml; lowercaseOutputLabelNames: true lowercaseOutputName: true rules:- pattern: ".*" Add to Nifi Bootstrap Config File sudo nano /usr/hdp/nifi/conf/bootstrap.conf; java.arg.18=-javaagent:/opt/jmx-exporter/jmx_prometheus_javaagent- 0.15.0.jar=7474:/usr/hdp/nifi/conf/nifi.yml Note: java.arg.XX the XX value should be unique! Restart Prometheus Service sudo systemctl restart prometheus; Note: just need to change the highlighted values for your own values. Add Job to Prometheus Config YML sudo nano /etc/prometheus/prometheus.yml; - job_name: 'nifi_jmx' # metrics_path defaults to '/metrics' # scheme defaults to 'http' scrape_interval: 5s static_configs: - targets: ['10.111.22.44:7474']
  • 8. PushGateway Download PushGateway sudo cd /u01/downloads; sudo wget https://github.com/prometheus/pushgateway/releases/download/v1.4.0/pushgateway-1.4.0.linux-amd64.tar.gz; sudo tar xvzf pushgateway-1.4.0.linux-amd64.tar.gz && mv pushgateway-1.4.0.linux-amd64/pushgateway /usr/local/bin/pushgateway;
  • 9. PushGateway Create User sudo useradd -m -s /bin/false pushgateway && id pushgateway; sudo chown pushgateway:pushgateway /usr/local/bin/pushgateway; Create User sudo nano /etc/prometheus/prometheus.yml; global: scrape_interval: 1s scrape_configs: - job_name: 'pushgateway' honor_labels: true Static_configs: - targets: ['10.111.22.33:9091'] Adjust the firewall sudo firewall-cmd --add-port=9091/tcp --permanent && firewall-cmd --reload; Note: just need to change the highlighted values for your own values.
  • 10. PushGateway Creating a Systemd service file for Prometheus Server sudo nano /etc/systemd/system/pushgateway.service; [Unit] Description=Custom Metrics on PushGateway Wants=network-online.target After=network-online.target [Service] User=pushgateway Group=pushgateway Type=simple ExecStart=/usr/local/bin/pushgateway --web.listen-address=:9091 --web.enable-admin-api --web.telemetry-path=/metrics --persistence.file=/tmp/metric.store --persistence.interval=5m [Install] WantedBy=multi-user.target Note: just need to change the highlighted values for your own values.
  • 11. PushGateway Reload the Systemctl sudo systemctl daemon-reload; Now start and enable Prometheus to run on boot sudo systemctl start pushgateway && sudo systemctl enable pushgateway; Confirm Pushgateway is UP sudo netstat -tunlp | grep pushgateway; Note: just need to change the highlighted values for your own values.
  • 12. PushGateway Create Top Custom Metrics Script sudo nano metricsTOP; #!/bin/bash # CPU Usage % z=$(ps aux | grep -v '[' ) while read -r z do var=$var$(awk 'NR>1 {print "cpu_usage{user=""$1"" , pid=""$2"" , process=""$11"", arg=""$12" "$13" "$14" "$15"" }", $3z}'); done <<< "$z" curl -X POST -H "Content-Type: text/plain" --data "$var " http://localhost:9091/metrics/job/top/instance/hostname01 # Memory Usage Bytes x=$(ps aux | grep -v '[' ) while read -r x do var2=$var2$(awk 'NR>1 {print "memory_usage{user=""$1"" , pid=""$2"" , process=""$11"", arg=""$12" "$13" "$14" "$15"" }", $6x}'); done <<< "$x" curl -X POST -H "Content-Type: text/plain" --data "$var2 " http://localhost:9091/metrics/job/top/instance/hostname01 sudo chmod u+x metricsTOP && ./metricsTOP;
  • 13. PushGateway Create Crontab Job sudo contrab -e; * * * * * for i in {1..60}; do /path/metricsTOP & sleep 1; done Create IOTop Custom Metrics Script sudo nano metricsTOP; * * * * * for i in {1..60}; do /path/metricsTOP & sleep 1; done
  • 14. PushGateway Create IOTop Custom Metrics Script # IO Usage % t=$(iotop -Pkqbn 1 | grep -v '[' ) while read -r t do var3=$var3$(awk 'NR>2 {print "iotop_usage{user=""$3"" , pid=""$1"" , stream="%" ,process=""$12"", arg=""$13" "$14" "$15" "$16"" }", $10}'); done <<< "$t" curl -X POST -H "Content-Type: text/plain" --data "$var3 " http://localhost:9091/metrics/job/iotop/instance/hostname01 # IO Read Kbs u=$(iotop -Pkqbn 1 | grep -v '[' ) while read -r u do var4=$var4$(awk 'NR>2 {print "iotop_read{user=""$3"" , pid=""$1"" , stream="read" ,process=""$12"", arg=""$13" "$14" "$15" "$16"" }", $4}'); done <<< "$u" curl -X POST -H "Content-Type: text/plain" --data "$var4 " http://localhost:9091/metrics/job/iotop/instance/hostname01 # IO Write Kbs v=$(iotop -Pkqbn 1 | grep -v '[' ) while read -r v do var5=$var5$(awk 'NR>2 {print "iotop_write{user=""$3"" , pid=""$1"" , stream="write" ,process=""$12"", arg=""$13" "$14" "$15" "$16"" }", $6}'); done <<< "$v" curl -X POST -H "Content-Type: text/plain" --data "$var5 " http://localhost:9091/metrics/job/iotop/instance/hostname01 Note: just need to change the highlighted values for your own values.