prometheus – Zak Abdel-Illah https://zai.dev Automation Enthusiast Fri, 13 Dec 2024 14:14:40 +0000 en-US hourly 1 https://wordpress.org/?v=6.7.1 https://zai.dev/wp-content/uploads/2024/06/android-chrome-512x512-1-150x150.png prometheus – Zak Abdel-Illah https://zai.dev 32 32 Exoscale Exporter for Prometheus https://zai.dev/2024/09/04/exoscale-exporter-for-prometheus/ Wed, 04 Sep 2024 11:18:20 +0000 https://zai.dev/?p=830

I’d built a Prometheus exporter for Exoscale, allowing me to visualize cloud spending and resource usage from a central location alongside AWS and DigitalOcean.

The Exoscale exporter is built using Go and leverages the latest version of Exoscale’s Go API, egoscale v3 and includes basic integration tests and automatic package building for all major platforms and architectures.

Some of the metrics exported are;

  • Organization Information: Usage, Address, API Keys
  • Compute Resource Summary: Instances, Kubernetes, Node Pools
  • Storage Resource Summary: SOS Buckets & Usage, Block Volumes
  • Networking Resource Summary: Domain & Records, Load Balancers

By integrating organizational data from Exoscale into the Prometheus ecosystem, I can now configure alerts for spending or resource usage on either Exoscale specifically or for all platforms using AlertManager.

I can also identify where I may have left resources behind using Grafana, in the event I’m manually creating them or my IaC executions didn’t do a proper clean-up.

Metric Browser in Grafana; Showing some values exported from the Exporter

I decided to deploy the exporter to my Kubernetes cluster, scraping based on the default interval of 2 minutes. This is roughly a good balance between;

  • When a new billing amount gets updated (hourly)
  • How often infrastructure elements themselves gets updated (could be on a minutely-basis)
  • How much data gets consumed by the time-series

I chose Kubernetes cluster rather than a server-less solution or a dedicated VM so that I can optimize the costs of running the exporter by sharing resources, in addition to abstracting the cloud provider away from the application.

]]>