Skip to content

Commit

Permalink
PMM-12913 migrate /v1/server/leaderHealthCheck endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
ademidoff committed Mar 19, 2024
1 parent f003f63 commit 8c53f02
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion api/MIGRATION_TO_V3.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ GET /logz.zip GET /v1/server/logs.zip
GET /v1/version GET /v1/server/version ✅ /v1/version is now a redirect to /v1/server/version
GET /v1/readyz GET /v1/server/readyz ✅ /v1/readyz is now a redirect to /v1/server/readyz
POST /v1/AWSInstanceCheck GET /v1/server/AWSInstance ✅
POST /v1/leaderHealthCheck GET /v1/server/leaderHealthCheck
POST /v1/leaderHealthCheck GET /v1/server/leaderHealthCheck
POST /v1/settings/Change PUT /v1/server/settings ✅
POST /v1/settings/Get GET /v1/server/settings ✅
POST /v1/updates/Check GET /v1/server/updates
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions api/server/v1/server.proto
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,7 @@ service ServerService {
// LeaderHealthCheck checks if the instance is the leader in a cluster.
rpc LeaderHealthCheck(LeaderHealthCheckRequest) returns (LeaderHealthCheckResponse) {
option (google.api.http) = {
post: "/v1/leaderHealthCheck"
body: "*"
get: "/v1/server/leaderHealthCheck"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
summary: "Check Leadership"
Expand Down
8 changes: 4 additions & 4 deletions managed/services/grafana/auth_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ var rules = map[string]role{
"/v1/user": viewer,

// must be available without authentication for health checking
"/v1/readyz": none, // TODO: remove before v3 GA
"/v1/server/readyz": none,
"/v1/leaderHealthCheck": none,
"/ping": none, // PMM 1.x variant
"/v1/readyz": none, // TODO: remove before v3 GA
"/v1/server/readyz": none,
"/v1/server/leaderHealthCheck": none,
"/ping": none, // PMM 1.x variant

// must not be available without authentication as it can leak data
"/v1/version": viewer, // TODO: remove before v3 GA
Expand Down
4 changes: 2 additions & 2 deletions managed/testdata/haproxy/haproxy.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ frontend https_front

backend http_back
option httpchk
http-check send meth POST uri /v1/leaderHealthCheck ver HTTP/1.1 hdr Host www
http-check send meth POST uri /v1/server/leaderHealthCheck ver HTTP/1.1 hdr Host www
http-check expect status 200
server pmm-server-active-http pmm-server-active:80 check
server pmm-server-passive-http pmm-server-passive:80 check backup
server pmm-server-passive-2-http pmm-server-passive-2:80 check backup

backend https_back
option httpchk
http-check send meth POST uri /v1/leaderHealthCheck ver HTTP/1.1 hdr Host www
http-check send meth POST uri /v1/server/leaderHealthCheck ver HTTP/1.1 hdr Host www
http-check expect status 200
server pmm-server-active-https pmm-server-active:443 check ssl verify none backup
server pmm-server-passive-https pmm-server-passive:443 check ssl verify none backup
Expand Down

0 comments on commit 8c53f02

Please sign in to comment.