2022-02-04 18:12:24 +01:00
## `http` sink
The `http` sink uses POST requests to a HTTP server to submit the metrics in the InfluxDB line-protocol format. It uses JSON web tokens for authentification. The sink creates batches of metrics before sending, to reduce the HTTP traffic.
### Configuration structure
```json
{
"< name > ": {
"type": "http",
2022-11-04 14:52:05 +01:00
"meta_as_tags" : [
"meta-key"
],
2022-02-10 13:12:32 +01:00
"url" : "https://my-monitoring.example.com:1234/api/write",
"jwt" : "blabla.blabla.blabla",
2023-09-20 17:41:12 +02:00
"username": "myUser",
"password": "myPW",
2022-02-08 18:06:07 +01:00
"timeout": "5s",
2022-02-10 13:12:32 +01:00
"idle_connection_timeout" : "5s",
"flush_delay": "2s",
2023-12-11 14:57:06 +01:00
"batch_size": 1000,
"precision": "s"
2022-02-04 18:12:24 +01:00
}
}
```
- `type` : makes the sink an `http` sink
2022-11-04 14:52:05 +01:00
- `meta_as_tags` : Move specific meta information to the tags in the output (optional)
2022-02-10 13:12:32 +01:00
- `url` : The full URL of the endpoint
2023-09-19 12:57:43 +02:00
- `jwt` : JSON web tokens for authentication (Using the *Bearer* scheme)
2023-09-20 17:41:12 +02:00
- `username` : username for basic authentication
- `password` : password for basic authentication
2022-02-08 18:06:07 +01:00
- `timeout` : General timeout for the HTTP client (default '5s')
2023-09-19 12:57:43 +02:00
- `max_retries` : Maximum number of retries to connect to the http server
- `idle_connection_timeout` : Timeout for idle connections (default '120s'). Should be larger than the measurement interval to keep the connection open
2022-02-10 13:12:32 +01:00
- `flush_delay` : Batch all writes arriving in during this duration (default '1s', batching can be disabled by setting it to 0)
2023-10-04 12:37:25 +02:00
- `batch_size` : Maximal batch size. If `batch_size` is reached before the end of `flush_delay` , the metrics are sent without further delay
2023-12-11 16:06:28 +01:00
- `precision` : Precision of the timestamp. Valid values are 's', 'ms', 'us' and 'ns'. (default is 'ns')
### Using HttpSink for communication with cc-metric-store
2023-12-29 14:53:12 +01:00
The cc-metric-store only accepts metrics with a timestamp precision in seconds, so it is required to set `"precision": "s"` .