From 54a41c3c1bad45d1130cb5f6eea4b72571e15f37 Mon Sep 17 00:00:00 2001 From: pengshiyu <1940607002@qq.com> Date: Tue, 21 Nov 2023 11:45:07 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 2 +- doc/source/manual/question.md | 29 +++++++++++++++++++++-------- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 898f76e56c..2b9363ff28 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,5 @@ - v1.5.27(2023-11-21) - - + - 新增prometheus接口/metrics域名数据 - v1.5.25(2023-10-23) - 修复 证书申请列表无法搜索的问题 diff --git a/doc/source/manual/question.md b/doc/source/manual/question.md index 3f714db707..f62e274c6b 100644 --- a/doc/source/manual/question.md +++ b/doc/source/manual/question.md @@ -117,6 +117,16 @@ DB_CONNECT_URL=postgresql://root:123456@localhost:5432/data_domain ## 10、支持`prometheus` 的`/metrics`接口 +请求地址:http://127.0.0.1:8000/metrics + +示例 + +``` +POST http://127.0.0.1:8000/metrics +Content-Type: application/json +Authorization: Bearer +``` + 1、第一步、需要在 `系统设置/API KEY` 获取授权key 2、第二步、配置 prometheus.yml @@ -126,14 +136,17 @@ scrape_configs: bearer_token: 'f60c03bfff8bb42dcf6821542e5fd11e' ``` -请求地址:http://127.0.0.1:8000/metrics - -示例 +如果是夜莺-Nightingale [参考文档](https://flashcat.cloud/docs/content/flashcat-monitor/categraf/plugin/prometheus/) -``` -POST http://127.0.0.1:8000/metrics -Content-Type: application/json -Authorization: Bearer +```yaml +[[instances.domain]] +urls = [ + "http://127.0.0.1:8000/metrics" +] + +url_label_key = "instance" +url_label_value = "{{.Host}}" +headers = ["Authorization", "Bearer f60c03bfff8bb42dcf6821542e5fd11e"] ``` 返回数据示例: @@ -160,7 +173,7 @@ domain_admin{domain="www.163.com",group_name="",root_domain="163.com"} 153.0 domain_info{domain="163.com",group_name="百度系"} 1392.0 domain_info{domain="qq.com",group_name=""} 3535.0 ``` - + ## 11、部分域名无法查询到信息 已知不支持的域名后缀:`.lc`、`.ml`、`.ai`、`.my`、`.ch`、`.edu.cn`