Skip to content

Commit

Permalink
document new http collector params
Browse files Browse the repository at this point in the history
  • Loading branch information
adamancini committed Sep 27, 2024
1 parent 311d254 commit de63078
Showing 1 changed file with 37 additions and 12 deletions.
49 changes: 37 additions & 12 deletions docs/source/collect/http.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,44 @@ The http collector can be specified multiple times in a collector spec.

## Parameters

The `http` collector can be either of `get`, `post` or `put`.
The `http` collector can be either of `get`, `post` or `put`.

In addition to the [shared collector properties](/collect/collectors/#shared-properties), it accepts the following parameters:

- ##### `url` (Required)
- ##### `url` string (Required)

The URL to make the HTTP request against.

- ##### `insecureSkipVerify` (Optional)
- ##### `tls.cacert` string (Optional)

When present, the CA certificate to use for verifying the server's certificate.
Valid options are a string containing the certificate in PEM format, or a path to a file or direcotry on disk containing the certificate.

- ##### `proxy` string (Optional)

When present, the proxy to use for the request.
The proxy address must be a valid URL in the format `scheme://[user:password@]host:port`.

- ##### `insecureSkipVerify` boolean (Optional)

When set to true, this will make connections to untrusted or self-signed certs.
This defaults to false.

- ##### `headers` (Optional)
- ##### `headers` string (Optional)

When present, additional headers to send with the request.
By default, there are no headers added to the request.

- ##### `body` (Optional)
- ##### `body` string (Optional)

When present, the body to be send with the request.
By default, there is no body included in a request.
This parameter is not supported if the method is `get`.

- ##### `timeout` (Optional)
- ##### `timeout` string (Optional)

When present, the timeout for the request.
Expressed as a string duration, such as `30s`, `5m`, `1h`.

## Example Collector Definition

Expand All @@ -51,9 +67,19 @@ spec:
get:
url: http://api:3000/healthz
timeout: 5s
- http:
collectorName: proxy
get:
url: https://replicated.app
proxy: https://proxy.example.com:3130
timeout: 15s
tls:
cacert: |-
-----BEGIN CERTIFICATE-----
<truncated>
-----END CERTIFICATE-----
```
### POST/PUT
The `post` and `put` methods will issue an HTTP or HTTPS POST or PUT request to the specified URL.
Expand All @@ -72,10 +98,9 @@ spec:
insecureSkipVerify: true
body: '{"disable-service": true}'
headers:
Content-Type: "application/json"
Content-Type: 'application/json'
```


## Included resources

Result of each collector will be stored in the root directory of the support bundle.
Expand All @@ -97,9 +122,9 @@ Response received from the server will be stored in the `"response"` key of the
"Server": "nginx/1.8.1",
"Strict-Transport-Security": "max-age=31536000; includeSubDomains"
},
"raw_json": {
"status": "healthy"
}
"raw_json": {
"status": "healthy"
}
}
}
```
Expand Down

0 comments on commit de63078

Please sign in to comment.