From 9e3f2b897c73f3122ef8b588fd10071e6947c0fb Mon Sep 17 00:00:00 2001 From: Aline Abler Date: Fri, 17 Nov 2023 09:40:28 +0100 Subject: [PATCH] Change envPrefix to match new component name --- Makefile | 3 +-- README.md | 12 ++++++------ main.go | 2 +- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 6a4ffd2..3ffb8bf 100644 --- a/Makefile +++ b/Makefile @@ -36,7 +36,6 @@ build-docker: build-bin ## Build docker image ensure-prometheus: .cache/prometheus ## Ensures that Prometheus is installed in the project dir. Downloads it if necessary. .PHONY: test -test: export ACR_DB_URL = postgres://user:password@localhost:55432/db?sslmode=disable test: ensure-prometheus go test ./... -tags integration -coverprofile cover.out -covermode atomic @@ -72,4 +71,4 @@ clean: # current date in UTC in ISO 8601 format (RFC 3339) with Z as timezone that works on both linux and macos .PHONY: current-date current-date: - date -u +"%Y-%m-%dT%H:%M:%SZ" \ No newline at end of file + date -u +"%Y-%m-%dT%H:%M:%SZ" diff --git a/README.md b/README.md index 9547f8f..ab9b5b8 100644 --- a/README.md +++ b/README.md @@ -23,12 +23,12 @@ oc login --server=https://api.cloudscale-lpg-2.appuio.cloud:6443 kubectl --as cluster-admin -nvshn-appuio-mimir service/vshn-appuio-mimir-query-frontend 8080 # Set environment -export ACR_PROM_URL="http://localhost:8080/prometheus" -export ACR_ORG_ID="appuio-managed-openshift-billing" # mimir organization in which data is stored -export ACR_ODOO_URL=https://test.central.vshn.ch/api/v2/product_usage_report_POST -export ACR_ODOO_OAUTH_TOKEN_URL="https://test.central.vshn.ch/api/v2/authentication/oauth2/token" -export ACR_ODOO_OAUTH_CLIENT_ID="your_client_id" # see https://docs.central.vshn.ch/rest-api.html#_authentication_and_authorization -export ACR_ODOO_OAUTH_CLIENT_SECRET="your_client_secret" +export AR_PROM_URL="http://localhost:8080/prometheus" +export AR_ORG_ID="appuio-managed-openshift-billing" # mimir organization in which data is stored +export AR_ODOO_URL=https://test.central.vshn.ch/api/v2/product_usage_report_POST +export AR_ODOO_OAUTH_TOKEN_URL="https://test.central.vshn.ch/api/v2/authentication/oauth2/token" +export AR_ODOO_OAUTH_CLIENT_ID="your_client_id" # see https://docs.central.vshn.ch/rest-api.html#_authentication_and_authorization +export AR_ODOO_OAUTH_CLIENT_SECRET="your_client_secret" # Run a query go run . report --query 'sum by (label) (metric)' --begin "2023-07-08T13:00:00Z" --product-id "your-odoo-product-id" --instance-jsonnet 'local labels = std.extVar("labels"); "instance-%(label)s" % labels' --unit-id "your_odoo_unit_id" --timerange 1h --item-description-jsonnet '"This is a description."' --item-group-description-jsonnet 'local labels = std.extVar("labels"); "Instance %(label)s" % labels' diff --git a/main.go b/main.go index d01897e..cc4cf45 100644 --- a/main.go +++ b/main.go @@ -24,7 +24,7 @@ var ( appLongName = "Reporting for APPUiO Cloud" // envPrefix is the global prefix to use for the keys in environment variables - envPrefix = "ACR" + envPrefix = "AR" ) func main() {