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
It can be used as metrics endpoint/gateway of workload by setting metric values via http API
It can be used to stress Prometheus by generating any number of metrics
It can be helpful for applications Grafana dashboard develop by creating mock metrics
Steps
Install Openshift and IBM Bedrock Monitoring Service
Optionally you can edit the configmap defined in example/openshift.yaml file to change generated metrics.
oc create -f example/openshift.yaml
Open <CP console>/prometheus to check the existence of metrics
In the default configuration yaml above, you can see,
You can configure Counter metrics and Gauge metrics
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)
label.name is the label name. label.valueset is the label value set. It will select randomly from them as label value.
number is exact metric series number. But series are not fixed as label values are selected randomly.
Guage metrics' value will change randomly in between upper value and lower value when valuemode is auto.
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.