Page 1
promgen - prometheus management tool
tokuhirom
Page 3
Web Application Engineer
• Server side engineer
• Java
• Perl
• Server Admin
Page 4
www1.example.com
node_exporter (httpd)
jmx_exporter (httpd)
Periodic GET request
Page 7
It’s good for lazy web programmers
Get data → Get stats
Async and lazy
Page 8
Easy to integrate with grafana
Page 9
But there’s no server list management tool
Page 10
official method to manage servers, is writing YAML.
With consul or something
Page 11
YAML file contains: exporter port number
alerting rules
Page 12
Server admins need to write BIG YAML FILE.
Page 13
Editing YAML via github pull-request
Page 14
We want to manage it via web app.
Page 15
We wrote web application to manage server list.
Page 16
We are managing the server list in our deployment tool
Page 17
promgen can integrate with our deployment tool
(Of course, it’s pluggable)
Page 19
Note: We haven’t use consul or similar
tool(now).
Page 20
Promgen
• Simple prometheus manager app
• exporter port management
• alert management
Page 26
ProjectService
Project
Project
Host
Host
Host
Data structure
Managed by Deploy tool
Farm
Farm
Farm
Page 27
Alerting
Alert Manager Hipchatpromgen-alerting
Web hook
Mail
MySQL
Page 28
Architecture
• Ruby
• Sequel
• MySQL
• erubis
• sinatra
Page 30
I want to run it on prometheus host.
We shouldn’t use much memory
Page 31
Part 2. Monitoring Java
processes via Prometheus
Page 32
There are 3 patterns
Page 33
1. Collect data from MBean in target JVM
App JVM (Runs jmx_exporter jetty) prom
HTTP
Page 34
• Pros
• Easy to run
• Cons
• Hard to maintain YAML file
Page 35
- pattern: '^com.zaxxer.hikari<type=Pool \((\w+)\)><>ThreadsAwaitingConnection'
name: hikaricp_pool_threads_awaiting_connection
labels:
source: "$1"
help: "HikariCP threads awaiting connection(pending threads) $1"
type: GAUGE
Page 36
2. Collect data from JMX outside from target JVM
App JVM
jmx_exporter JVM prom
HTTPJMX
Page 37
• Pros
• Easy to deploy
• Safety
• Cons
• Memory overhead
• Hard to maintain YAML file
Page 38
3. Collect data by simpleclient_java
App JVM (Run simpleclient_java jetty) prom
HTTP
Page 39
• Pros
• Clean
• lightweight
• no YAML required
• Cons
• Requires coding
Page 40
simpleclient_java
Page 41
simpleclient_dropwizard
Drop wizard metrics
MetricRegistryclient_java
Page 42
simpleclient_hotspot
JVM core client_java
Default
Page 43
simpleclient_log4j/logback
log4j/logback client_java
Error/Warn rate
Page 44
simpleclient_springboot
Spring Boot Metrics client_java
NEW!
Page 45
simpleclient_jetty
Jetty requests
status etc.
client_java
NEW!
Page 46
simpleclient_hikaricp
HikariCP client_java
REJECTED!