Cleanup metrics handling

This commit is contained in:
Daniel Berteaud 2024-03-27 11:58:37 +01:00
parent 8ca4189c93
commit 4d873fa548
3 changed files with 12 additions and 5 deletions

View File

@ -5,6 +5,8 @@ job "miniflux" {
region = "global"
group "miniflux" {
count = 1
@ -22,9 +24,13 @@ job "miniflux" {
port = 8085
meta {
alloc = "${NOMAD_ALLOC_INDEX}"
job = "${NOMAD_JOB_NAME}"
namespace = "${NOMAD_NAMESPACE}"
alloc = "${NOMAD_ALLOC_INDEX}"
datacenter = "${NOMAD_DC}"
group = "${NOMAD_GROUP_NAME}"
job = "${NOMAD_JOB_NAME}"
namespace = "${NOMAD_NAMESPACE}"
node = "${node.unique.name}"
region = "${NOMAD_REGION}"
}
connect {

View File

@ -10,7 +10,7 @@ job "[[ .instance ]]" {
network {
mode = "bridge"
[[- if $c.prometheus.enabled ]]
[[- if conv.ToBool .prometheus.enabled ]]
port "metrics" {}
[[- end ]]
}
@ -62,7 +62,7 @@ job "[[ .instance ]]" {
env {
LISTEN_ADDR = "127.0.0.1:8085"
BASE_URL = "[[ .miniflux.public_url ]]"
[[- if $c.prometheus.enabled ]]
[[- if conv.ToBool $c.prometheus.enabled ]]
METRICS_COLLECTOR = 1
[[- end ]]
}

View File

@ -43,5 +43,6 @@ miniflux:
# Prometheus configuration
prometheus:
enabled: '[[ .prometheus.available ]]'
metrics_url: http://localhost:8085/metrics