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

Serve with Prometheus Output does not 503 on failed check #992

Open
jameshounshell opened this issue Oct 21, 2024 · 2 comments
Open

Serve with Prometheus Output does not 503 on failed check #992

jameshounshell opened this issue Oct 21, 2024 · 2 comments
Labels

Comments

@jameshounshell
Copy link

jameshounshell commented Oct 21, 2024

Unlike the other output modes (ex: documentation/json), the prometheus output does not report 503 at /healthz when a test fails.

Is this by design? If so could something be added to the docs to say this is the exception.

Thanks in advance!

For example using this goss.yaml

file:
  /etc/nothinghere:
    exists: true

Run this command goss -g goss.yaml serve -f prometheus --format-options verbose

Then curl localhost:8080/healthz and examine the status code. Other format options return 503, while prometheus option returns 200.

@aelsabbahy
Copy link
Member

I assume it's by design, that feature was added by @petemounce. He can probably provide more accurate information than me.

@petemounce
Copy link
Collaborator

Ah, I think no; that's not by design. I think outputs/prometheus.go L87 should return 1 when there are any failure outcomes vs the unconditional 0 it does now, or the -1 it does on system-error.

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

No branches or pull requests

3 participants