Jump to content

Citoid/Prometheus

From Wikitech

You can test citoid locally with Prometheus.

Download Prometheus

https://prometheus.io/docs/prometheus/latest/getting_started/

Local config

For citoid

In your config.dev.yaml

# Metrics reporters
metrics:
  - type: prometheus
    port: 9100

For Prometheus

Your prometheus.yml should look like

# A scrape configuration containing exactly one endpoint to scrape:
# Here it's citoid.
scrape_configs:
  # The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
  - job_name: 'prometheus'
    static_configs:
    - targets: ['localhost:9100']

  - job_name: 'citoid'
    static_configs:
    - targets: ['localhost:9102']

Then run both citoid and prometheus

./prometheus --config.file=prometheus.yml

And from your citoid directory

npm start

Testing

Make a few requests to citoid.

Navigate to http://localhost:9090/ to look for data collected from those queries, i.e. search citoid_input_type_total in the search bar.