No description
Find a file
dependabot[bot] cb144b90bc
build(deps): Bump the gomod group across 1 directory with 5 updates
Bumps the gomod group with 3 updates in the / directory: [github.com/hetznercloud/hcloud-go/v2](https://github.com/hetznercloud/hcloud-go), [github.com/onsi/ginkgo/v2](https://github.com/onsi/ginkgo) and [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang).


Updates `github.com/hetznercloud/hcloud-go/v2` from 2.12.0 to 2.13.1
- [Release notes](https://github.com/hetznercloud/hcloud-go/releases)
- [Changelog](https://github.com/hetznercloud/hcloud-go/blob/main/CHANGELOG.md)
- [Commits](https://github.com/hetznercloud/hcloud-go/compare/v2.12.0...v2.13.1)

Updates `github.com/onsi/ginkgo/v2` from 2.19.1 to 2.20.2
- [Release notes](https://github.com/onsi/ginkgo/releases)
- [Changelog](https://github.com/onsi/ginkgo/blob/master/CHANGELOG.md)
- [Commits](https://github.com/onsi/ginkgo/compare/v2.19.1...v2.20.2)

Updates `github.com/onsi/gomega` from 1.34.0 to 1.34.1
- [Release notes](https://github.com/onsi/gomega/releases)
- [Changelog](https://github.com/onsi/gomega/blob/master/CHANGELOG.md)
- [Commits](https://github.com/onsi/gomega/compare/v1.34.0...v1.34.1)

Updates `github.com/prometheus/client_golang` from 1.19.1 to 1.20.3
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/v1.20.3/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.19.1...v1.20.3)

Updates `golang.org/x/crypto` from 0.25.0 to 0.26.0
- [Commits](https://github.com/golang/crypto/compare/v0.25.0...v0.26.0)

---
updated-dependencies:
- dependency-name: github.com/hetznercloud/hcloud-go/v2
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: gomod
- dependency-name: github.com/onsi/ginkgo/v2
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: gomod
- dependency-name: github.com/onsi/gomega
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: gomod
- dependency-name: github.com/prometheus/client_golang
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: gomod
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: gomod
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-09 04:10:16 +00:00
.github build(deps): Bump the github-actions group across 1 directory with 2 updates (#146) 2024-07-25 20:33:34 +02:00
e2e fix: pipeline linting issues 2024-01-17 20:32:50 +01:00
fetcher fix: use new fields for traffic pricing 2024-07-25 20:59:46 +02:00
helm/hcloud-pricing-exporter Release Helm chart for v0.10.0 2024-07-25 21:08:36 +02:00
.chartreleaser.yaml Add helm chart for easy deployment 2021-03-06 17:13:57 +01:00
.editorconfig fix: Correct settings for YAML files 2023-01-25 21:36:40 +01:00
.gitignore fix: codecov action 2024-05-29 21:20:25 +02:00
.golangci.yml Adapt go linting 2022-12-14 14:38:40 +01:00
.goreleaser.yml fix: goreleaser process 2024-05-29 20:32:35 +02:00
Dockerfile Fix build target and linting issues 2021-03-05 21:02:07 +01:00
go.mod build(deps): Bump the gomod group across 1 directory with 5 updates 2024-09-09 04:10:16 +00:00
go.sum build(deps): Bump the gomod group across 1 directory with 5 updates 2024-09-09 04:10:16 +00:00
LICENSE Prepare initial project layout 2021-03-05 16:35:29 +01:00
main.go feat: read HCLOUD_TOKEN from file (#142) 2024-05-29 20:15:53 +02:00
README.md chore: Add new feature to the README 2023-01-25 21:27:50 +01:00
version.yaml Release Helm chart for v0.10.0 2024-07-25 21:08:36 +02:00

hcloud-pricing-exporter

Build Status PkgGoDev Go Report Card Docker Pulls Artifact HUB

A Prometheus exporter that connects to your HCloud account and collects data on your current expenses. The aim is to make cost of cloud infrastructure more transparent and manageable, especially for private projects.

Please note that no guarantees on correctness are made and any financial decisions should be always be based on the billing and cost functions provided by HCloud itself. Some hourly costs are estimations based on monthly costs, if the HCloud API does not provide an hourly expense.

Deployment

To run the exporter from the CLI you need to run the following commands:

# Just run it with the default settings
./hcloud-pricing-exporter -hcloud-token <TOKEN>

# Get the token from an ENV variable
export HCLOUD_TOKEN=<TOKEN>
./hcloud-pricing-exporter

# Run the exporter on a different port with another fetch interval
./hcloud-pricing-exporter -port 1234 -fetch-interval 45m

Alternatively, the exporter can be run by using the provided docker image:

docker run jangraefen/hcloud-pricing-exporter:latest -e HCLOUD_TOKEN=<TOKEN> -p 8080:8080

If you want to deploy the exporter to a Kubernetes environment, you can use the provided helm chart. Just perform the following commands:

helm repo add hcloud-pricing-exporter https://jangraefen.github.io/hcloud-pricing-exporter
helm repo update
helm upgrade --install hcloud-pricing-exporter hcloud-pricing-exporter/hcloud-pricing-exporter --version {VERSION}

Exported metrics

  • hcloud_pricing_floatingip_hourly{name, location, type} (Estimated based on the monthly price)
  • hcloud_pricing_floatingip_monthly{name, location, type}
  • hcloud_pricing_loadbalancer_hourly{name, location, type}
  • hcloud_pricing_loadbalancer_monthly{name, location, type}
  • hcloud_pricing_primaryip_hourly{name, datacenter, type}
  • hcloud_pricing_primaryip_monthly{name, datacenter, type}
  • hcloud_pricing_server_hourly{name, location, type}
  • hcloud_pricing_server_monthly{name, location, type}
  • hcloud_pricing_server_backups_hourly{name, location, type}
  • hcloud_pricing_server_backups_monthly{name, location, type}
  • hcloud_pricing_server_traffic_hourly{name, location, type} (Estimated based on the monthly price)
  • hcloud_pricing_server_traffic_monthly{name, location, type}
  • hcloud_pricing_snapshot_hourly{name} (Estimated based on the monthly price)
  • hcloud_pricing_snapshot_monthly{name}
  • hcloud_pricing_volume_hourly{name, location, bytes} (Estimated based on the monthly price)
  • hcloud_pricing_volume_monthly{name, location, bytes}

Each exported metric can also be enriched with additional labels, coming from the actual labels on the Hetzner resource. To expose additional labels, use the -additional-labels label1,label2,... command line parameter.