10 lines
4.6 KiB
JSON
10 lines
4.6 KiB
JSON
{
|
|
"Format": "hcl2",
|
|
"JobID": "prometheus",
|
|
"JobModifyIndex": 13995677,
|
|
"Namespace": "default",
|
|
"Source": "job \"prometheus\" {\n # region = \"global\"\n datacenters = [\"dc1\"]\n type = \"service\"\n\n # priority = 50\n\n constraint {\n attribute = \"${attr.kernel.name}\"\n value = \"linux\"\n }\n constraint {\n attribute = \"${attr.unique.hostname}\"\n operator = \"regexp\"\n value = \"odroid.*\"\n }\n\n # constraint {\n # \tattribute = \"${attr.unique.hostname}\"\n # operator = \"regexp\"\n # value = \"pi.*\"\n # }\n\n update {\n # Stagger updates every 60 seconds\n stagger = \"60s\"\n max_parallel = 1\n }\n group \"prometheus\" {\n count = 2\n\n restart {\n attempts = 2\n interval = \"1m\"\n delay = \"10s\"\n mode = \"delay\"\n }\n\n task \"prometheus\" {\n driver = \"docker\"\n\n config {\n image = \"prom/prometheus\"\nargs = [\"--web.enable-admin-api\",\"--config.file=/etc/prometheus/prometheus.yml\"]\n \n\n ports = [\"http\"]\n memory_hard_limit = \"512\"\n volumes = [\n \"local/prometheus.yml:/etc/prometheus/prometheus.yml\",\n \"local/alerts.yml:/etc/prometheus/alerts.yml\",\n ]\n\n // \"/mnt/gv0/prom_data:/data\",\n // \"/etc/localtime:/etc/localtime\",\n\n logging {\n type = \"json-file\"\n }\n }\n\n service {\n name = \"${TASKGROUP}\"\n tags = [\"global\", \"prometheus\"]\n port = \"http\"\n\n check {\n name = \"alive\"\n type = \"http\"\n interval = \"10s\"\n timeout = \"120s\"\n path = \"/status\"\n port = \"http\"\n }\n }\n\n template {\n change_mode = \"signal\"\n change_signal = \"SIGHUP\"\n data = \"{{ key \\\"prometheus_yml\\\" }}\"\n destination = \"local/prometheus.yml\"\n }\n\n template {\n change_mode = \"restart\"\n \n destination = \"local/alerts.yml\"\n data = \"{{ key \\\"alerts\\\" }}\"\n }\n resources {\n cpu = 500 # 500 MHz\n memory = 48 # 128MB\n }\n # Specify configuration related to log rotation\n logs {\n max_files = 10\n max_file_size = 15\n }\n kill_timeout = \"10s\"\n } ## end prometheus\n\n task \"alertmanager\" {\n driver = \"docker\"\n\n config {\n image = \"prom/alertmanager\"\n\n ports = [\"alerthttp\"]\n\n // volumes = [\n // \"local/alertmanager.yml:/etc/prometheus/prometheus.yml\",\n // ]\n args = [\"--config.file=/local/alertmanager.yml\"]\n // \"/mnt/gv0/prom_data:/data\",\n // \"/etc/localtime:/etc/localtime\",\n\n logging {\n type = \"json-file\"\n }\n }\n\n service {\n name = \"${TASK}\"\n tags = [\"global\", \"prometheus\"]\n port = \"alerthttp\"\n\n check {\n name = \"alive\"\n type = \"http\"\n interval = \"60s\"\n timeout = \"120s\"\n path = \"/status\"\n port = \"http\"\n }\n }\n\n template {\n data = <<EOH\nglobal:\nreceivers:\n - name: default-receiver\n - name: gotify-webhook\n webhook_configs:\n - url: \"http://prometheus.service.dc1.consul:9094/gotify_webhook\"\nroute:\n group_wait: 10s\n group_interval: 5m\n receiver: gotify-webhook\n repeat_interval: 3h\n\nEOH\n\n destination = \"local/alertmanager.yml\"\n }\n resources {\n cpu = 128 # 500 MHz\n memory = 48 # 128MB\n }\n # Specify configuration related to log rotation\n logs {\n max_files = 10\n max_file_size = 15\n }\n kill_timeout = \"10s\"\n } ## end alertmanager\n\n task \"gotifybridge\" {\n driver = \"docker\"\n config {\n image = \"ghcr.io/druggeri/alertmanager_gotify_bridge\"\n ports = [\"gotifybridge\"]\n args = [\"--debug\"]\n }\n env {\n GOTIFY_TOKEN=\"AQ7l7NVgtylam86\"\n GOTIFY_ENDPOINT=\"http://gotify.service.dc1.consul/message\"\n }\n}\n\n network {\n port \"http\" {\n static = 9090\n to = 9090\n }\n port \"alerthttp\" {\n static = 9093\n to = 9093\n }\n port \"gotifybridge\" {\n static = 9094\n to = 8080\n }\n }\n }\n}\n",
|
|
"VariableFlags": null,
|
|
"Variables": "",
|
|
"Version": 0
|
|
} |