URL monitor
- Last Updated 3/31/2023, 12:34:01 PM UTC
- About 3 min read
Plugin info
name: url-mon
Monitors the health of one or more URLs reporting:
- response time
- response status
- unexpected response body
- timeout
- error
# Prerequisites
None
# Events
Event | Description |
---|---|
url/status/regexp_unmatched | boolean 1/0, set to 1 when the response did not match the provided regexp |
url/status/timeout | boolean 1/0, set to 1 when the request timed out before getting a response |
url/status/error | the error message that caused the request to fail |
# Metrics
Metric | Description |
---|---|
url/status/response_time | response time in milliseconds |
url/status/response_code | http response status |
# Configuration
This section describes the configuration settings for this plugin.
Important Sensitive data should be stored inside the agent secrets store and referenced in this file using notation
${secret key}
. For examplehttps://${my-api/user}:${my-api/passwd}@127.0.0.1:9200/v1
.
Name | Type | Required | Default | Description |
---|---|---|---|---|
default_timeout | duration string | No | 5s | How long to wait for a request |
default_proxy | string | No | Proxy URL | |
default_max_redirects | int | No | 10 | Max number of HTTP redirect to follow |
default_max_retries | int | No | 5 | Max number of retries in case of failure |
urls | map[string]URL Configuration | Yes | List of URLs to probe |
# URL Configuration
Name | Type | Required | Default | Description |
---|---|---|---|---|
name | string | No | Human readable name for the URL which is conveyed as the metric/event dimension identifying the URL | |
name | string | Yes | The URL to probe (can contain secrets) | |
headers | map[string]string | No | HTTP request header name value pairs (can contain secrets) | |
body | string | No | Request body (can contain secrets) | |
method | string | No | GET | HTTP request method (GET, POST, PUT, HEAD, OPTIONS, DELETE, TRACE, CONNECT ) |
timeout | duration string | No | default_timeout | How long to wait for a request |
max_redirects | int | No | default_max_redirects | Max number of HTTP redirect to follow |
retries | int | No | default_max_retries | Max number of retries in case of failure |
proxy | string | No | default_proxy | Proxy URL |
no_proxy | bool | No | false | Do not use default_proxy |
expect_response_regexp | string | No | Response must match this regular expression | |
tls | TLS Configuration | No | TLS settings |
# TLS Configuration
Name | Type | Required | Default | Description |
---|---|---|---|---|
ca_path | string | No | Path to CA cert file to use | |
cert_path | string | No | Path to client certificate to use | |
key_path | string | No | Path to client private key to use | |
key_passphrase | string | No | Passphrase to unlock private key (can contain secrets)) | |
insecure_skip_verify | boolean | No | false | Do no verify peer certificate |
# Example Configuration
default_timeout: 5s
default_max_redirects: 10
default_max_retries: 5
urls:
"google":
url: https://www.google.com
"github-members":
url: https://api.github.com/orgs/arisant/members
headers:
"Accept": "application/vnd.github.v3+json"
"Authorization": "Bearer ${github_oauth_token}"