forked from apache/cloudstack
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CLOUDSTACK-9998: Prometheus Exporter for CloudStack (apache#2287)
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>
- Loading branch information
1 parent
ed7811a
commit 0fedbdd
Showing
13 changed files
with
915 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<!-- | ||
Licensed to the Apache Software Foundation (ASF) under one | ||
or more contributor license agreements. See the NOTICE file | ||
distributed with this work for additional information | ||
regarding copyright ownership. The ASF licenses this file | ||
to you under the Apache License, Version 2.0 (the | ||
"License"); you may not use this file except in compliance | ||
with the License. You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, | ||
software distributed under the License is distributed on an | ||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
KIND, either express or implied. See the License for the | ||
specific language governing permissions and limitations | ||
under the License. | ||
--> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<artifactId>cloud-plugin-integrations-prometheus-exporter</artifactId> | ||
<name>Apache CloudStack Plugin - Prometheus Exporter</name> | ||
<parent> | ||
<groupId>org.apache.cloudstack</groupId> | ||
<artifactId>cloudstack-plugins</artifactId> | ||
<version>4.11.0.0-SNAPSHOT</version> | ||
<relativePath>../../pom.xml</relativePath> | ||
</parent> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.apache.cloudstack</groupId> | ||
<artifactId>cloud-utils</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.cloudstack</groupId> | ||
<artifactId>cloud-api</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.cloudstack</groupId> | ||
<artifactId>cloud-engine-schema</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
</dependencies> | ||
</project> |
18 changes: 18 additions & 0 deletions
18
plugins/integrations/prometheus/resources/META-INF/cloudstack/prometheus/module.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
name=prometheus | ||
parent=api |
27 changes: 27 additions & 0 deletions
27
...rations/prometheus/resources/META-INF/cloudstack/prometheus/spring-prometheus-context.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<!-- | ||
Licensed to the Apache Software Foundation (ASF) under one | ||
or more contributor license agreements. See the NOTICE file | ||
distributed with this work for additional information | ||
regarding copyright ownership. The ASF licenses this file | ||
to you under the Apache License, Version 2.0 (the | ||
"License"); you may not use this file except in compliance | ||
with the License. You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, | ||
software distributed under the License is distributed on an | ||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
KIND, either express or implied. See the License for the | ||
specific language governing permissions and limitations | ||
under the License. | ||
--> | ||
<beans xmlns="http://www.springframework.org/schema/beans" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://www.springframework.org/schema/beans | ||
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd"> | ||
|
||
<bean id="prometheusExporterServer" class="org.apache.cloudstack.metrics.PrometheusExporterServerImpl" /> | ||
<bean id="prometheusExporter" class="org.apache.cloudstack.metrics.PrometheusExporterImpl" /> | ||
|
||
</beans> |
24 changes: 24 additions & 0 deletions
24
plugins/integrations/prometheus/src/org/apache/cloudstack/metrics/PrometheusExporter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Licensed to the Apache Software Foundation (ASF) under one | ||
// or more contributor license agreements. See the NOTICE file | ||
// distributed with this work for additional information | ||
// regarding copyright ownership. The ASF licenses this file | ||
// to you under the Apache License, Version 2.0 (the | ||
// "License"); you may not use this file except in compliance | ||
// with the License. You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, | ||
// software distributed under the License is distributed on an | ||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
// KIND, either express or implied. See the License for the | ||
// specific language governing permissions and limitations | ||
// under the License. | ||
package org.apache.cloudstack.metrics; | ||
|
||
public interface PrometheusExporter { | ||
|
||
void updateMetrics(); | ||
|
||
String getMetrics(); | ||
} |
Oops, something went wrong.