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

bug: Prometheus unable to scrape /metrics #406

Closed
astraldawn opened this issue Jan 19, 2023 · 1 comment
Closed

bug: Prometheus unable to scrape /metrics #406

astraldawn opened this issue Jan 19, 2023 · 1 comment
Labels
area/metrics Related to metrics bug Something isn't working

Comments

@astraldawn
Copy link

Describe the bug

Prometheus is unable to scrape metrics for latest (as of 90bb8f7), no issue with stable

What do you see?

In http://localhost:9090/targets, a single target with:

  • State: DOWN
  • Error: "INVALID" is not a valid start token

What do you expect to see?

In http://localhost:9090/targets, a single target with:

  • State: UP

List the steps that must be taken to reproduce this issue

  1. Run the example in https://github.com/TwiN/gatus/blob/master/.examples/docker-compose-grafana-prometheus
  2. Go to http://localhost:9090/targets, the error message appears
  3. Swap tag to stable
  4. Error message disappears after a short while

Version

latest (90bb8f7)

Additional information

Go to localhost:8080/metrics

  • latest: attempts to download metrics.gz
  • stable: plaintext page with prometheus metrics
@astraldawn astraldawn added the bug Something isn't working label Jan 19, 2023
@TwiN
Copy link
Owner

TwiN commented Jan 20, 2023

Excellent catch.

This appears to be the root cause prometheus/client_golang#622

I've recently enabled gzip compression on the entire router, and it seems like because promhttp.Handler() uses its own compression, it causes an issue.

@TwiN TwiN closed this as completed in 24e207c Jan 20, 2023
@TwiN TwiN added the area/metrics Related to metrics label Jan 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/metrics Related to metrics bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants