创建采集配置
开发中
POST
https://api.flashcat.cloud/api/n9e-plus/collect
最后修改时间:2025-03-13 02:56:54
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.flashcat.cloud/api/n9e-plus/collect' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "Clickhouse",
"group_id": 4,
"queries": [
{
"key": "tags",
"op": "==",
"values": [
"region=bj",
"bus=a"
]
},
{
"key": "group_ids",
"op": "==",
"values": [
4
]
}
],
"enable_time": [],
"disabled": 0,
"component": "ClickHouse",
"component_id": 0,
"cate": "clickhouse",
"content": "# # collect interval\n# interval = 15\n\n# Read metrics from one or many ClickHouse servers\n[[instances]]\n ## Username for authorization on ClickHouse server\n username = \"default\"\n\n ## Password for authorization on ClickHouse server\n # password = \"\"\n\n ## HTTP(s) timeout while getting metrics values\n ## The timeout includes connection time, any redirects, and reading the\n ## response body.\n # timeout = 5\n\n ## List of servers for metrics scraping\n ## metrics scrape via HTTP(s) clickhouse interface\n ## https://clickhouse.tech/docs/en/interfaces/http/\n # servers = [\"http://127.0.0.1:8123\"]\n\n ## If \"auto_discovery\"\" is \"true\" plugin tries to connect to all servers\n ## available in the cluster with using same \"user:password\" described in\n ## \"user\" and \"password\" parameters and get this server hostname list from\n ## \"system.clusters\" table. See\n ## - https://clickhouse.tech/docs/en/operations/system_tables/#system-clusters\n ## - https://clickhouse.tech/docs/en/operations/server_settings/settings/#server_settings_remote_servers\n ## - https://clickhouse.tech/docs/en/operations/table_engines/distributed/\n ## - https://clickhouse.tech/docs/en/operations/table_engines/replication/#creating-replicated-tables\n # auto_discovery = true\n\n ## Filter cluster names in \"system.clusters\" when \"auto_discovery\" is \"true\"\n ## when this filter present then \"WHERE cluster IN (...)\" filter will apply\n ## please use only full cluster names here, regexp and glob filters is not\n ## allowed for \"/etc/clickhouse-server/config.d/remote.xml\"\n ## <yandex>\n ## <remote_servers>\n ## <my-own-cluster>\n ## <shard>\n ## <replica><host>clickhouse-ru-1.local</host><port>9000</port></replica>\n ## <replica><host>clickhouse-ru-2.local</host><port>9000</port></replica>\n ## </shard>\n ## <shard>\n ## <replica><host>clickhouse-eu-1.local</host><port>9000</port></replica>\n ## <replica><host>clickhouse-eu-2.local</host><port>9000</port></replica>\n ## </shard>\n ## </my-onw-cluster>\n ## </remote_servers>\n ##\n ## </yandex>\n ##\n ## example: cluster_include = [\"my-own-cluster\"]\n # cluster_include = []\n\n ## Filter cluster names in \"system.clusters\" when \"auto_discovery\" is\n ## \"true\" when this filter present then \"WHERE cluster NOT IN (...)\"\n ## filter will apply\n ## example: cluster_exclude = [\"my-internal-not-discovered-cluster\"]\n # cluster_exclude = []\n\n ## Optional TLS Config\n # tls_ca = \"/etc/telegraf/ca.pem\"\n # tls_cert = \"/etc/telegraf/cert.pem\"\n # tls_key = \"/etc/telegraf/key.pem\"\n ## Use TLS but skip chain & host verification\n # insecure_skip_verify = false\n\n # [[instances.metrics]]\n # mesurement = \"sessions\"\n # label_fields = [ \"status\", \"type\" ]\n # metric_fields = [ \"value\" ]\n # timeout = \"3s\"\n # request = '\'''\'''\''\n # SELECT status, type, COUNT(*) as value FROM v$session GROUP BY status, type\n # '\'''\'''\''\n",
"version": "7c74222a8ef9324c18bceb70d5472c27"
}'
响应示例响应示例
{
"err":""
}
请求参数
Body 参数application/json