Skip to content

Prometheus exporter for the OVH cloud API

License

Notifications You must be signed in to change notification settings

ssube/ovh-exporter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OVH Exporter

This is a Prometheus exporter for the OVH cloud API.

API Auth

The OVH API uses a signed token, generated by their SDK, using an app key/secret and consumer secret. The full process is described in https://docs.ovh.com/gb/en/api/first-steps-with-ovh-api/#advanced-usage-pair-ovhcloud-apis-with-an-application_2.

  1. Sign up as a new app using the /createToken endpoint for your selected API, such as https://api.us.ovhcloud.com/createToken/
  2. Put the resulting secrets in an .env file or k8s secret
  3. Mount or source those secrets before running node index.js

Configuration

The following environment variables must be set:

  • OVH_ENDPOINT
    • the name of the API endpoint to be used
    • like ovh-ca, ovh-eu, ovh-us
  • OVH_APP
    • the application key, AK in the docs
  • OVH_SECRET
    • the secret application key, AS in the docs
  • OVH_CONSUMER
    • the secret consumer key, CK in the docs
  • OVH_PROJECT
    • the ID of your public cloud project

Metrics

The API has a number of GET endpoints that expose project usage and quota information. Some of these are collected and exposed as Prometheus metrics.

  • ovh_project_quota_max
    • region
      • name
    • resource
      • cores
      • instances
      • memory
  • ovh_project_quota_used
    • region
      • name
    • resource
      • cores
      • instances
      • memory
  • ovh_swift_bucket_bytes_total
    • bucket
      • name
    • region
      • name
  • ovh_swift_bucket_objects_total
    • bucket
      • name
    • region
      • name

Metrics are fetched once on startup, then on a scheduled interval, by default every 10 minutes.