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

feat: Send errors in prometheus rest api format #108

Merged
merged 1 commit into from
Jun 17, 2022

Conversation

jkroepke
Copy link
Member

@jkroepke jkroepke commented Jun 7, 2022

This PR changes the format of all error related http responses.

Instead send error as plain text, capsule the error into a json that follows normal prometheus API responses. https://prometheus.io/docs/prometheus/latest/querying/api/#http-api

The motivations of this change is to make errors visible in Grafana. Otherwise, errors are hard to debug, since the errors are not logged.

Before:
grafana-error

After:
image

injectproxy/utils.go Outdated Show resolved Hide resolved
Copy link
Member

@squat squat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, this is a really helpful change :)

injectproxy/routes.go Outdated Show resolved Hide resolved
@jkroepke
Copy link
Member Author

jkroepke commented Jun 7, 2022

Is it possible to create a release after this merge? I'm happy to see if #108 and #106 are live.

injectproxy/utils.go Outdated Show resolved Hide resolved
@jkroepke
Copy link
Member Author

jkroepke commented Jun 8, 2022

I hope, everything is fine now.

injectproxy/utils.go Outdated Show resolved Hide resolved
Signed-off-by: Jan-Otto Kröpke <jok@cloudeteer.de>
@squat
Copy link
Member

squat commented Jun 15, 2022

Thanks for working on this @jkroepke 🎉

@squat squat merged commit 02d43ed into prometheus-community:master Jun 17, 2022
@jkroepke jkroepke deleted the error-prom-api branch June 17, 2022 14:02
Kirchen99 pushed a commit to Kirchen99/prom-label-proxy that referenced this pull request Jun 17, 2022
…#108)

Signed-off-by: Jan-Otto Kröpke <jok@cloudeteer.de>
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.

None yet

2 participants