Built-in Servers
Cloudprober includes built-in servers that can be enabled through configuration. These servers can act as targets for other probes. For example, you can run two Cloudprober instances on different machines, with one instance’s servers acting as targets and the other instance probing those targets.
These servers are useful for monitoring the underlying infrastructure, such as underlying network or load balancers.
Cloudprober (probes) ===(Network)===> Cloudprober (servers)
HTTP Server
server {
type: HTTP
http_server {
port: 8080
}
}
This creates an HTTP server that responds on the port 8080
. This HTTP server
supports the following two endpoints by default:
/healthcheck
- returns ‘OK’ if instance is not in the lameduck mode./lameduck
- returns the lameduck status (true/false).
Lameduck mode is a mode in which a server is still running but is signaling that it is about to go down for maintenance so new requests should not be sent to it. This is typically used with load balancers to take out a backend for maintenance without returning any actual errors.
TODO(manugarg): Document how a Cloudprober can be put in the lameduck mode.
Data Handlers
You can also add custom data handlers to the above HTTP server:
server {
type: HTTP
http_server {
port: 8080
pattern_data_handler {
response_size: 1024
}
pattern_data_handler {
response_size: 4
pattern: "four"
}
}
}
Above configuration adds the following two URLs to the HTTP server:
/data_1024
which responds with 1024 bytes ofcloudprobercloudprober...(repeated)
./data_4
which responds withfour
.
These endpoints are useful to monitor other aspects of the underlying network like MTU, and consistency (make sure data is not getting corrupted), etc.
See this for all HTTP server configuration options.
UDP
UDP server can either echo packets back or completely ignore them. In echo mode, you can use it along with the UDP probe type.
server {
type: UDP
udp_server {
port: 85
type: ECHO
}
}
server {
type: UDP
udp_server {
port: 90
type: DISCARD
}
}
See ServerConf for all UDP server configuration options.
GRPC
See ServerConf for all GRPC server configuration options.