Each target kind accepts a specific set of connection fields. Sending a field that does not apply to the chosen kind (for example, ssl_mode on a redis target) will return a validation error.
Explore documentation
Create a collector metric target
Creates a new monitoring target on a collector.
Headers
Bearer $TOKEN
Body parameters
The type of target. Valid options are postgres, mysql, redis, mongodb, memcached, elasticsearch, nginx, apache, kafka, and prometheus.
The hostname or IP address of the target.
The port number. Required for database kinds, optional for process kinds.
The service or container name. Required for process kinds (nginx, apache, kafka, prometheus).
The IP address the process listens on. Only accepted for nginx, apache, and kafka.
The full scrape URL (e.g. http://10.0.0.5:9090/metrics). Required for prometheus targets.
The username for authentication. Only accepted for database kinds and elasticsearch.
The password for authentication. Only accepted for database kinds and elasticsearch. Write-only — never returned in responses.
An API key for authentication. Only accepted for elasticsearch. Write-only — never returned in responses.
The SSL mode for the connection. Required for postgres. Valid options are disable, require, and verify-ca.
The TLS mode for the connection. Required for mysql. Valid options are false, true, skip-verify, and preferred.
The connection scheme. Only accepted for elasticsearch. Valid options are http and https. Defaults to http if omitted.
Set to false to create the target in a disabled state. Defaults to true.
Fields accepted per kind
| Kind | Required fields | Optional fields |
|---|---|---|
postgres |
host, port, ssl_mode |
username, password |
mysql |
host, port, tls |
username, password |
redis |
host, port |
username, password |
mongodb |
host, port |
username, password |
memcached |
host, port |
username, password |
elasticsearch |
host, port |
username, password, api_key, scheme |
nginx |
host, service |
port, listen_ip |
apache |
host, service |
port, listen_ip |
kafka |
host, service |
port, listen_ip |
prometheus |
host, service, endpoint |
— |
The target was created successfully.
Response body
Validation failed due to invalid parameters.
Response body
Example: PostgreSQL target
Example: Elasticsearch target with API key
Example: Nginx process target
Example: Prometheus target
Example: Create disabled