Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
70 lines (64 sloc) 1.99 KB
# Following probe demonstrates the use of data integrity validator. It probes
# the local HTTP server (configured below) and verifies that the response is
# made up of the repeated pattern "cloudprober".
#
# Since the HTTP server below is configured to use the pattern "cloudprobe",
# we'll see validation failures. Generated monitoring data and logs will look
# like this:
# labels=ptype=http,probe=http_localhost,dst=localhost total=5 success=0 latency=0.000 timeouts=0 resp-code=map:code,200:5 resp-body=map:resp validation_failure=map:validator,data-integrity:5
# E1130 14:33:20.131399 27197 integrity.go:71] bytes are not in the expected format. payload[0-Replica]=[99 108 111 117 100 112 114 111 98 101 99], pattern=[99 108 111 117 100 112 114 111 98 101 114]
probe {
name: "http_localhost"
type: HTTP
targets {
host_names: "localhost"
}
interval_msec: 10000 # Probe every 10s
timeout_msec: 1000
http_probe {
relative_url: "/data_4096"
port: 3141
}
# This validator will fail as HTTP server is configured to use the pattern
# "cloudprobe".
validator {
name: "data-integrity"
integrity_validator {
pattern_string: "cloudprober"
}
}
}
server {
type: HTTP
http_server {
port: 3141
# Return a repeated pattern of "cloudprobe" at the URL /data_4096.
pattern_data_handler {
response_size: 4096
pattern: "cloudprobe"
}
}
}
# Following probe demonstrates the use of HTTP status code and regex
# validators.
probe {
name: "http_google"
type: HTTP
targets {
host_names: "www.google.com"
}
interval_msec: 10000 # Probe every 10s
timeout_msec: 1000
# This validator should succeed.
validator {
name: "status_code_2xx"
http_validator {
success_status_codes: "200-299"
}
}
# This validator will fail, notice missing 'o' in our regex.
validator {
name: "gogle_re"
regex: "gogle"
}
}
You can’t perform that action at this time.