/metrics_proxy

prometheus proxy for obtaining metrics from an openshift apiserver /metrics endpoint

Primary LanguageGo

metrics proxy

Created in order to proxy prometheus requests using oc and a generated kubeconfig file. Allows prometheus to listen locally on port 8080, fetching metrics data from an OpenShift api server using a kubeconfig file generated by the OpenShift installer.

Building

make

Running

/bin/metrics --kubeconfig=/path/to/kubeconfig

Using

Once the server is running, simply update your Prometheus config with a new scrape_configs stanza pointed to localhost:8080. Example of a prometheus.yml file:

global:
  scrape_interval

scrape_configs:
  - job_name: 'prometheus'
    scrape_interval: 5s
    static_configs:
      - targets: ['localhost:9090']

scrape_configs:
  - job_name: 'apiserver'
    scrape_interval: 5s
    static_configs:
      - targets: ['localhost:8080']

If you are able to successfully perform the command oc get --raw /metrics, then you'll be able to successfully use this server.