Git Product home page Git Product logo

prometheus-metrics-server-simulator's Introduction

prometheus-metrics-server-simulator

A configurable prometheus metrics server simulator. It can be configured to generate different number of metrics with different labels. An example is file example/config.yaml. In example/openshift.yaml it demos how to generate configmap for it..

User Cases

  1. It can be used as metrics endpoint/gateway of workload by setting metric values via http API

    UC1

  2. It can be used to stress Prometheus by generating any number of metrics

    UC2

  3. It can be helpful for applications Grafana dashboard develop by creating mock metrics

Steps

  1. Install Openshift and IBM Bedrock Monitoring Service
  2. Optionally you can edit the configmap defined in example/openshift.yaml file to change generated metrics.
  3. oc create -f example/openshift.yaml
  4. Open <CP console>/prometheus to check the existence of metrics

Configration syntax

counters:
  - prefix: mock_metric_counter
    number: 3
    labels:
    - name: app
      valueset:
      - "prometheus-mock-metrics-server"
    - name: client_addr
      valueset:
      - "client1"
      - "client2"
      - "client3"
  - prefix: mock_metric_request_total
    labels:
    - name: app
      valueset:
      - "prometheus-mock-metrics-server"
    valuemode: http
    
gauges:
  - prefix: mock_metric_gauges
    number: 4
    range:
      upper: 1000
      lower: 2
    labels:
    - name: app
      valueset:
      - "prometheus-mock-metrics-server"
    - name: client_addr
      valueset:
      - "client1"
      - "client2"
      - "client3"

In the default configuration yaml above, you can see,

  1. You can configure Counter metrics and Gauge metrics
  2. prefix is metric name prefix. When number is 1 it is exactly metric name. When number is greater than 1 metric names will be <prefix>-index. index is [0,number)
  3. label.name is the label name. label.valueset is the label value set. It will select randomly from them as label value.
  4. number is exact metric series number. But series are not fixed as label values are selected randomly.
  5. Guage metrics' value will change randomly in between upper value and lower value when valuemode is auto.
  6. valuemode can be http or auto. Default value is auto.
    • http
      Metric value will be changed by curl -XPUT http://localhost:8080/metrics/value -d "$data" -H "Content-Type: application/json" . An example of payload is in example/setvalue.json file. Its value is real value for guage metric and increment for Counter value.
    • auto
      Metric value will change randomly and automatically.

prometheus-metrics-server-simulator's People

Contributors

dongyingbo avatar imgbotapp avatar johnwalicki avatar stevemar avatar

Stargazers

Amirbekyan avatar Andrii Veklychev avatar Qi Qian avatar Pim Snel avatar yuzx2008 avatar jnubugo avatar Filippo Brintazzoli avatar yasenn avatar 陈醇 avatar feiyuw avatar  avatar  avatar  avatar  avatar

Watchers

JJ Asghar avatar James Cloos avatar Thai Tran avatar  avatar  avatar

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.