Giter Club home page Giter Club logo

clusterlifecycle-state-metrics's Introduction

clusterlifecycle-state-metrics

This project generates a number of metrics used for business analysis.

Available Metrics

  • acm_managed_cluster_info

testing

  1. make run
  2. curl http://localhost:8080/metrics

Generated metrics:

curl http://localhost:8080/metrics
# HELP acm_managed_cluster_info Managed cluster information
# TYPE acm_managed_cluster_info gauge
acm_managed_cluster_info{hub_cluster_id="faddba46-201e-4d5d-bf52-9918517a9e6a",managed_cluster_id="faddba46-201e-4d5d-bf52-9918517a9e6a",vendor="OpenShift",cloud="Amazon",version="v1.16.2",created_via="Other",vcpu="4"} 1

Build/Push/Deploy on RHACM

Each steps can be run separatly:

Prereqs

  1. oc login your hub RHACM cluster.
  2. Set in the kustomization.yaml the namespace where you want the collector to be deployed.
  3. Same for servicemonitor.yaml and clusterrole_binding.yaml
  4. Set the following IMG environment variable, this is the name of the image and where it will be pushed.
export QUAY_USER=<your_user>
export IMG_TAG=<tag_you_want_to_use>
export IMG=quay.io/${QUAY_USER}/clusterlifecycle-state-metrics:${IMG_TAG}
make docker-build docker-push deploy

build

make docker-build

push

make docker-push

Deploy

make deploy

It also creates an ingress which allows to retrieve the infomration from outside of the cluster.

The metrics then will appear on prometheus.

promql examples:

  1. Retrieve the number of imported clusters per hub:
sum by (hub_cluster_id) (
   acm_managed_cluster_info 
) 

and per vendor:

sum by (hub_cluster_id, vendor) (
   acm_managed_cluster_info 
) 

and per cloud:

sum by (hub_cluster_id, cloud) (
   acm_managed_cluster_info 
) 

and per version:

sum by (hub_cluster_id, version) (
   acm_managed_cluster_info 
) 

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.