idealista / prom2teams

prom2teams is an HTTP server built with Python that receives alert notifications from a previously configured Prometheus Alertmanager instance and forwards it to Microsoft Teams using defined connectors
Apache License 2.0
268 stars 84 forks source link

[BUG] PROM2TEAMS_PROMETHEUS_METRICS #325

Closed ebini closed 1 year ago

ebini commented 1 year ago

Description

setting the Environment Variable PROM2TEAMS_PROMETHEUS_METRICS=true (like in the README.md is not working (anymore)

Steps to Reproduce

set PROM2TEAMS_PROMETHEUS_METRICS=true connecting to /metrics returns still 404

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>404 Not Found</title>
<h1>Not Found</h1>
<p>The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.</p>

Expected behavior: metrics data

Actual behavior: 404

Reproduces how often: always

Environment

deployed in k8s cluster verified setting by "shelling" into the container

/opt/prom2teams $ printenv | grep PROM2TEAMS_PROMETHEUS_METRICS
PROM2TEAMS_PROMETHEUS_METRICS=true

Additional Information

worked in older versions (but this was long time ago)

santi-eidu commented 1 year ago

Metrics are in port 9090, are you checking this port? I cannot reproduce the error.

mateuszdrab commented 1 year ago

Is there a way to revert to the old behavior? The helm chart does not have a port for metrics and I'm running with Rancher's fork of prom2teams included in rancher-alerting-drivers so even if resolved here, it will take long time to get pulled into their repo. I already had to manually add the ServiceMonitor resource and switch to using their dev branch.

https://github.com/idealista/prom2teams/blob/340d47d30d4263d7a5608206c5e884553c2dc0e2/prom2teams/app/configuration.py#L133 I think setting the ENV config parameter would revert the old behavior, but I'm not sure how to achieve that.

I rolled back to version 4.0.0 for now

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.