-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CLOUDSTACK-9998: Prometheus Exporter for CloudStack #2287
Conversation
This implements a CloudStack Prometheus exporter as a plugin, that serves metrics on a HTTP port. New global settings: 1. prometheus.exporter.enable - (default: false), Enable the prometheus exporter plugin, management server restart needed. 2. prometheus.exporter.port - (default: 9595), The prometheus exporter server port. 3. prometheus.exporter.allowed.ips - (default: 127.0.0.1), List of comma separated prometheus server ips (with no spaces) that should be allowed to access the URLs. The following list of metrics are provided per pop (zone) with the exporter: • Per host: o CPU cores: used, total o CPU usage: used, total (in MHz) o Memory usage: used, total (in MiBs) o Total VMs running on the host • CPU cores: allocated (per zone) • CPU usage: allocated (per zone, in MHz) • Memory usage: allocated (per zone, in MiBs) • Hosts: online, offline, total • VMs: in all states -- starting, running, stopping, stopped, destroyed, expunging, migrating, error, unknown • Volumes: ready, destroyed, total • Primary Storage Pool: (Disk size) used, allocated, unallocated, total (in GiBs) • Secondary Storage Pool: (Disk size) used, allocated, unallocated, total (in GiBs) • Private IPs: allocated, total • Public IPs: allocated, total • Shared Network IPs: allocated, total • VLANs: allocated, total Additional metrics for the environment: • Summed domain (level=1) limit for CPU cores • Summed domain (level=1) limit for memory/ram Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
@blueorangutan package |
@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
Packaging result: ✔centos6 ✔centos7 ✔debian. JID-1137 |
@blueorangutan test |
@rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
Trillian test result (tid-1564)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm mostly. one remark
super(); | ||
} | ||
|
||
private void addHostMetrics(final List<Item> metricsList, final long dcId, final String zoneName, final String zoneUuid) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would love to see this method split. It doesn't fit in my mind. Guess it doesn't differ for the functionality.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I kept this method to follow the hierarical metrics output at host level in a zone; splitting may make redundant loops.
public abstract String toMetricsString(); | ||
} | ||
|
||
class ItemVM extends Item { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a lot of doublures in fields i.e. zoneName and zoneUuid or even zoneFilter. maybe a different hierarchy is an idea.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What approach should we take?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM tests don't show any new failures
This implements a CloudStack Prometheus exporter as a plugin, that serves
metrics on a HTTP port.
FS: https://cwiki.apache.org/confluence/display/CLOUDSTACK/CloudStack+Metrics+Exporter+for+Prometheus
Prometheus: https://prometheus.io/
New global settings:
exporter plugin, management server restart needed.
server port.
separated prometheus server ips (with no spaces) that should be allowed to
access the URLs.
The following list of metrics are provided per pop (zone) with the exporter:
• Per host:
o CPU cores: used, total
o CPU usage: used, total (in MHz)
o Memory usage: used, total (in MiBs)
o Total VMs running on the host
• CPU cores: allocated (per zone)
• CPU usage: allocated (per zone, in MHz)
• Memory usage: allocated (per zone, in MiBs)
• Hosts: online, offline, total
• VMs: in all states -- starting, running, stopping, stopped, destroyed,
expunging, migrating, error, unknown
• Volumes: ready, destroyed, total
• Primary Storage Pool: (Disk size) used, allocated, unallocated, total (in GiBs)
• Secondary Storage Pool: (Disk size) used, allocated, unallocated, total (in GiBs)
• Private IPs: allocated, total
• Public IPs: allocated, total
• Shared Network IPs: allocated, total
• VLANs: allocated, total
Additional metrics for the environment:
• Summed domain (level=1) limit for CPU cores
• Summed domain (level=1) limit for memory/ram
Pinging for review - @ustcweizhou @DaanHoogland @borisstoyanov @nvazquez @PaulAngus and others