Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

document new http collector params #584

Merged
merged 2 commits into from
Oct 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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. This parameter will also read from the `HTTPS_PROXY` environment variable set in the shell.
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