Sign inSign up

askbe/ovhcloud-exporter

By askbe

•Updated over 1 year ago

The OVHCloud-Exporter is a tool designed to export key metrics related to OVHCloud services usage

Image
Monitoring & observability
0

139

askbe/ovhcloud-exporter repository overview

⁠OVHCloud Metrics Exporter

⁠Description

The OVHCloud Metrics Exporter is a tool designed to export key metrics related to OVHCloud services usage to a monitoring system like Prometheus. This project collects data on monthly billing amounts from OVHCloud, SMS credit usage, and the number of SMS sent, by utilizing the OVHCloud API.

The following information is retrieved from the OVHCloud API:

  • Total monthly bill amount (including taxes)
  • Remaining SMS credits for each SMS service
  • Number of SMS sent per day for each SMS service

These metrics are exposed via an HTTP interface, formatted for easy integration with Prometheus. This project can be run inside a Docker container for simplified management and deployment.

⁠Features

  • Retrieve billing information from OVHCloud via the API.
  • Export monthly billing amount (including taxes) as the metric ovhcloud_bill_monthly_amount.
  • Track remaining SMS credits for each SMS service as the metric ovhcloud_sms_credits_count.
  • Track the number of SMS sent per day for each SMS service as the metric ovhcloud_sms_sent_daily.
  • HTTP API to expose metrics for Prometheus scraping.

⁠Installation

⁠Generate Api Token

Create a token for you OVHCloud Account here : https://www.ovh.com/auth/api/createToken⁠

Required rights:

  • GET /sms/*
  • GET /me/bill/*
⁠Environment Variables

Before starting the exporter, you need to configure the following environment variables:

  • OVHCLOUDEXPORTER_ENDPOINT: The OVHCloud endpoint to use (default is ovh-eu).
  • OVHCLOUDEXPORTER_APPLICATION_KEY: Your OVHCloud application key.
  • OVHCLOUDEXPORTER_APPLICATION_SECRET: Your OVHCloud application secret.
  • OVHCLOUDEXPORTER_CONSUMER_KEY: Your OVHCloud consumer key.
  • OVHCLOUDEXPORTER_HTTP_PORT: The port on which the exporter will listen (default is 8080).
  • OVHCLOUDEXPORTER_DELAY_IN_MINUTES: The interval (in minutes) for metric updates (default is 1).
⁠Running with Docker
docker run -e OVHCLOUDEXPORTER_APPLICATION_KEY=<your_application_key> \
            -e OVHCLOUDEXPORTER_APPLICATION_SECRET=<your_application_secret> \
            -e OVHCLOUDEXPORTER_CONSUMER_KEY=<your_consumer_key> \
            -p 8080:8080 ovhcloud-exporter

The metrics will be exposed at http://localhost:8080/metrics and can be scraped by Prometheus.

⁠Exposed Metrics

  • ovhcloud_bill_monthly_amount: Total monthly bill amount (including taxes).
  • ovhcloud_sms_credits_count: Remaining SMS credits for each SMS service.
  • ovhcloud_sms_sent_daily: Number of SMS sent per day for each SMS service.

⁠Contributing

Contributions are welcome! If you'd like to improve this project https://codeberg.org/askbe/ovhcloud-exporter⁠, feel free to open an issue or submit a pull request.

Tag summary

Content type

Image

Digest

sha256:d2b1fbecf…

Size

10.7 MB

Last updated

over 1 year ago

docker pull askbe/ovhcloud-exporter:1.0.1