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

Alertmanager API version fix(prometheus 3) #530

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

axxyhtrx
Copy link

I got an error with that installation:

time=2024-11-17T05:52:03.562Z level=ERROR source=main.go:601 msg="Error loading config (--config.file=/etc/prometheus/prometheus.yml)" file=/etc/prometheus/prometheus.yml err="parsing YAML file /etc/prometheus/prometheus.yml: expected Alertmanager api version to be one of [v2] but got v1"

Fixed by change of alertmanager api to v2.

bump alermanager api to v2 due to error:

time=2024-11-17T05:52:03.562Z level=ERROR source=main.go:601 msg="Error loading config (--config.file=/etc/prometheus/prometheus.yml)" file=/etc/prometheus/prometheus.yml err="parsing YAML file /etc/prometheus/prometheus.yml: expected Alertmanager api version to be one of [v2] but got v1"

Signed-off-by: Anatoly Kolpakov <[email protected]>
@SvetaO
Copy link

SvetaO commented Nov 18, 2024

Hello, in addition to original bug message, I can confirm that change to v2 makes it possible to run 'prometheus' container and do not break anything.


$ git diff
diff --git a/prometheus-grafana/prometheus/prometheus.yml b/prometheus-grafana/prometheus/prometheus.yml
index 18c44da..da07356 100644
--- a/prometheus-grafana/prometheus/prometheus.yml
+++ b/prometheus-grafana/prometheus/prometheus.yml
@@ -8,7 +8,7 @@ alerting:
     - targets: []
     scheme: http
     timeout: 10s
-    api_version: v1
+    api_version: v2
 scrape_configs:
 - job_name: prometheus
   honor_timestamps: true
$ docker compose up -d
[+] Running 2/0
 ✔ Container grafana     Running                                                                                                                                                    0.0s 
 ✔ Container prometheus  Started                                                                                                                                                    0.0s 
$ docker ps | grep -iE "grafana|prometheus"
CONTAINER ID   IMAGE                                     COMMAND                  CREATED             STATUS             PORTS                                             NAMES
17876b7fc5b5   prom/prometheus                           "/bin/prometheus --c…"   About an hour ago   Up 11 seconds      0.0.0.0:9090->9090/tcp, :::9090->9090/tcp         prometheus
d3a9e5c5bad3   grafana/grafana                           "/run.sh"                About an hour ago   Up About an hour   0.0.0.0:3000->3000/tcp, :::3000->3000/tcp         grafana

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants