Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add services_savingsplans_subscribed metric #18

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nahuel11500
Copy link

Add a ovh_exporter_services_savingsplans_subscribed metric

@nahuel11500 nahuel11500 force-pushed the feat/add-services-savingsplans-subscribed branch from 4c9dfef to c3a8b64 Compare February 19, 2025 13:15
@nahuel11500
Copy link
Author

nahuel11500 commented Feb 19, 2025

Local test of the metric with the compose is good with curl 0.0.0.0:8080/metrics | grep "ovh_exporter_services_savingsplans_subscribed"

@maxime1907
Copy link
Member

you forgot to add the routes needed in pkg/credentials/generate

@maxime1907
Copy link
Member

metric is missing some important data like period and flavor

@maxime1907
Copy link
Member

maxime1907 commented Feb 19, 2025

log messages all in lowercase like the rest of the logs

@nahuel11500 nahuel11500 force-pushed the feat/add-services-savingsplans-subscribed branch 2 times, most recently from 1f5877e to cce9f79 Compare February 19, 2025 18:11
"savings_plan_status": savingsPlanStatus,
"savings_plan_start_date": savingsPlanPeriodStartDate,
"savings_plan_end_date": savingsPlanPeriodEndDate,
}).Set(1)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

put the savingsplan size here instead

@maxime1907
Copy link
Member

thanks for the nice documentation!

README.md Outdated
go run cmd/ovh-exporter/main.go credentials
```

Once you have the credentials, create a `.env` file containing the following variables:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ovh-exporter.env

README.md Outdated
@@ -19,14 +28,55 @@ export OVH_CACHE_UPDATE_INTERVAL="300"
export SERVER_PORT="8080"
```

# Running
To use the compose, add a `.env` file at the root of your project with the variables filled in:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ovh-exporter.env

compose.yaml Outdated
OVH_CLOUD_PROJECT_INSTANCE_BILLING_PROJECT_IDS: ""
OVH_CACHE_UPDATE_INTERVAL: "300"
SERVER_PORT: "8080"
env_file: ".env"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ovh-exporter.env

compose.yaml Outdated
OVH_CACHE_UPDATE_INTERVAL: "300"
SERVER_PORT: "8080"
env_file: ".env"
# OVH_ENDPOINT: "ovh-eu"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can remove these since we explain what should be contained inside the ovh-exporter.env file

@nahuel11500 nahuel11500 force-pushed the feat/add-services-savingsplans-subscribed branch from cce9f79 to bd39989 Compare February 25, 2025 17:05
@nahuel11500
Copy link
Author

Local test successful, maybe we should add some E2E test like in kube-state-metric and a github workflow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants