Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Web application to get all api's happening on cloudstack platforms

NotificationsYou must be signed in to change notification settings

ravening/Cloudstack-Api-Monitoring

Repository files navigation

A Java application to monitor all the API's happening in the CloudStack platform
and to export the stats for external system

Getting Started

Steps mentioned below will tell you how to get started withe the project.

Prerequisites

What things you need to install the software and how to install them

MandatoryJava 8+Apache MavenAny IDE to import the projectMysqlOptionalDocker for running containersPrometheus and grafana to receive stats and draw graphsKafka cluster to receive cloudstack events

Installing

A step by step series of instructions that tell you how to start the project

Download the project

git clone <repo url>

Import the project into any IDE as a Maven project.

To talk to CloudStack, you need the URL endpoint, ApiKey and SecretKey.You need to enter these values in "application.properties" file.

It can connect to multiple CLoudStack endpoints simultaneously.If you have 5 data centers with CloudStack installedin different regions then you need to enter the abovementioned three parameters corresponding to the locationname.

For ex: If you have CloudStack instance running in USA,EUROPE and ASIA location, below is the configurationyou need to enter

cloudstack.private.platforms=asia,europecloudstack.public.platforms=americausa.url=<https://...>usa.apiKey=usa.secretKey=europe.url=europe.apiKey=europe.secretKey=asia.url=asia.apiKey=asia.secretKey=

Once these changes are done, you are all good to go.Only steps left is to build the packages and start the project

Build the project from the top directory using the command

mvn package -DskipTests

This will generate the jar file in the target directoryNow run the project using

java -jar target/cloudstack-stats.jar

This app stores all the logs in /var/log/cloudstack_stats.log

Getting stats

Login to mysql database to display the tables and to get all stats

mysql cloudstack_stats -u <username> -p

Exporting data to prometheus and Grafana

  1. Create a prometheus docker container using
docker run -d --name=prometheus -p 9090:9090 -v ./prometheus.yml:/etc/prometheus/prometheus.yml prom/prometheus --config.file=/etc/prometheus/prometheus.yml

This will run prometheus on port 9090

  1. Now start the grafana container
docker run -d --network=host --name=grafana -p 3000:3000 grafana/grafana
  1. Login to grafana and add both mysql and prometheus datasources

  2. Now load the dashboard present inconfig/grafana/dashboards/

Stats.jsonActive Customers.jsonAPI Count.json

About

Web application to get all api's happening on cloudstack platforms

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors2

  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp