Web service for discovery of computer instances in Yandex.Сloud
Environment variables:
YC_COMPUTE_SD_FOLDER_ID
- Folder IDYC_COMPUTE_SD_SERVICE_ACCOUNT_ID
- Service account ID withcompute.viewer
roleYC_COMPUTE_SD_KEY_ID
- Key ID in service accountYC_COMPUTE_SD_PRIVATE_KEY
- Private part of key
Add following labels to yandex.cloud instances:
prometheus_*_port=*
: e.g.prometheus_node_exporter_port=9100
prometheus_job=*
: e.g.prometheus_job=my_awesome_service
Without at least one prometheus_*_port
label and prometheus_job
label targets will be not discovered by service
Example response (GET /api/v1/discover
) with following labels on yc instance:
prometheus_node_exporter_port=9100
prometheus_awesome_service_exporter_port=8080
prometheus_job=awesome-service
[
{
"targets": [
"127.0.0.1:9100",
"127.0.0.1:8080"
],
"labels": {
"yc_id": "1234567890",
"yc_folder_id": "1234567890",
"yc_zone_id": "ru-central1-a",
"yc_fqdn": "awesome-service-app-1.ru-central1.internal",
"hostname": "awesome-service-app-1",
"job": "awesome-service"
}
}
]