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

Save data to database #12

Merged
merged 3 commits into from Oct 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/modules/ROOT/assets/images/application-logic.drawio.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions docs/modules/ROOT/pages/explanations/data-usage.adoc
@@ -0,0 +1,17 @@
= Data Usage

This page gives a brief overview how buckets data usage is saved to the postgres billing database.

== Data flow

image::application-logic.drawio.svg[]

== Data source
- Buckets are fetched from Exoscale Provider and K8s Cluster.
- The bucket names in Exoscale are unique across organisation which prevents clusters having same bucket names.

== Data saving

- The data is saved in a postgres database.
- A database must be provided in the postgres URL.
- The application ensures the initial configuration of specified database in the URL.
15 changes: 14 additions & 1 deletion go.mod
Expand Up @@ -3,11 +3,14 @@ module github.com/vshn/exoscale-metrics-collector
go 1.18

require (
github.com/appuio/appuio-cloud-reporting v0.5.0
github.com/ccremer/go-command-pipeline v0.20.0
github.com/exoscale/egoscale v0.90.1
github.com/go-logr/logr v1.2.3
github.com/go-logr/zapr v1.2.3
github.com/urfave/cli/v2 v2.16.3
github.com/jmoiron/sqlx v1.3.5
github.com/urfave/cli/v2 v2.17.1
github.com/vshn/cloudscale-metrics-collector v0.3.3
github.com/vshn/provider-exoscale v0.1.0
go.uber.org/zap v1.23.0
golang.org/x/exp v0.0.0-20220930202632-ec3f01382ef9
Expand Down Expand Up @@ -39,8 +42,17 @@ require (
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-retryablehttp v0.7.1 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/jackc/chunkreader/v2 v2.0.1 // indirect
github.com/jackc/pgconn v1.12.0 // indirect
github.com/jackc/pgio v1.0.0 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgproto3/v2 v2.3.0 // indirect
github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b // indirect
github.com/jackc/pgtype v1.11.0 // indirect
github.com/jackc/pgx/v4 v4.16.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/lopezator/migrator v0.3.0 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
Expand All @@ -60,6 +72,7 @@ require (
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa // indirect
golang.org/x/net v0.0.0-20220722155237-a158d28d115b // indirect
golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb // indirect
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f // indirect
Expand Down