Skip to content
Snippets Groups Projects
Verified Commit cd877c78 authored by Réthelyi Bálint's avatar Réthelyi Bálint :no_mouth:
Browse files

update prometheus metrics realy

parent c3ea3cdf
No related branches found
No related tags found
No related merge requests found
Pipeline #8626 waiting for manual action
...@@ -105,7 +105,7 @@ Upgrade helm: ...@@ -105,7 +105,7 @@ Upgrade helm:
script: script:
- bash - bash
- cd "$CI_PROJECT_DIR"/k8s - cd "$CI_PROJECT_DIR"/k8s
- envsubst < values.yml | helm upgrade --install --wait becskasszasch . -n apps --values - - envsubst < values.yaml | helm upgrade --install --wait becskasszasch . -n apps --values -
rules: rules:
- if: $CI_COMMIT_TAG - if: $CI_COMMIT_TAG
when: manual when: manual
...@@ -127,10 +127,14 @@ func init() { ...@@ -127,10 +127,14 @@ func init() {
} }
for _, p := range prod { for _, p := range prod {
s, _ := GetSpends(p.ID) s, _ := GetSpends(p.ID)
var a float64
if s != nil { if s != nil {
spendsNow.With(prometheus.Labels{"product": p.Name}).Add(float64(s[0].Amount)) for _, u := range s {
a += float64(u.Amount)
} }
} }
spendsNow.With(prometheus.Labels{"product": p.Name}).Add(a)
}
} }
......
...@@ -4,4 +4,4 @@ set -o allexport ...@@ -4,4 +4,4 @@ set -o allexport
source secret.env source secret.env
set +o allexport set +o allexport
envsubst < values.yml | helm upgrade --install --wait becskasszasch . -n apps --values - envsubst < values.yaml | helm upgrade --install --wait becskasszasch . -n apps --values -
...@@ -7,5 +7,5 @@ POSTGRES: "${POSTGRES}" ...@@ -7,5 +7,5 @@ POSTGRES: "${POSTGRES}"
POSTGRES_PASS: "${POSTGRES_PASS}" POSTGRES_PASS: "${POSTGRES_PASS}"
POSTGRES_USER: "${POSTGRES_USER}" POSTGRES_USER: "${POSTGRES_USER}"
POSTGRES_DB: "${POSTGRES_DB}" POSTGRES_DB: "${POSTGRES_DB}"
Tag: "v1.5.7" Tag: "v1.5.8"
REGISTRY_CONF: "${REGISTRY_CONF}" REGISTRY_CONF: "${REGISTRY_CONF}"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment