-
Notifications
You must be signed in to change notification settings - Fork 67
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
fix: validating prometheus target #1077
base: master
Are you sure you want to change the base?
Conversation
…metheus errors (except bad data error type)
@@ -9,6 +9,8 @@ import ( | |||
"strings" | |||
"time" | |||
|
|||
prometheus "github.com/prometheus/client_golang/api/prometheus/v1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А проверял как-то, что на выражениях, специфичных для виктории, ничего не поедет?
/build |
/build |
/build |
Build and push Docker images with tag: fix-validating-prometheus-target.2024-09-20.edfaa20 |
2 similar comments
Build and push Docker images with tag: fix-validating-prometheus-target.2024-09-20.edfaa20 |
Build and push Docker images with tag: fix-validating-prometheus-target.2024-09-20.edfaa20 |
http.StatusForbidden: {}, | ||
} | ||
|
||
if _, leadTo500 := codes4xxLeadTo500[statusCode]; statusCode/100 == 4 && !leadTo500 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
statusCode/100 == 4
давай вынесем в функцию определяющую 400ый код + я бы все же переписал на statusCode >= 400 && statusCode < 500
просто из-за читаемости
Changed the status code and returned description
Before this PR on any error from prometheus the response with status code 500 was returned.
Now if the error is caused by bad target the response with status code 400 is returned.