我已經在我的linux節點上安裝了prometheus。我在 Windows 服務器上有一個 go 應用程序,用于從應用導出指標。Windows 節點的指標路徑位于 /app/metrics。請注意,指標的輸出采用 json 格式。這是我的prometheus.yml:scrape_configs: - job_name: 'prometheus_metrics' static_configs: - targets: ['localhost:9090'] - job_name: 'node_exporter_metrics' static_configs: - targets: ['localhost:9100'] - job_name: 'app-qa-1' metrics_path: /app/metrics scheme: http static_configs: - targets: ['app-qa-1:1701']當我查詢指標并通過舞會工具時,我得到:error while linting: text format parsing error in line 1: invalid metric name在我的目標頁面上,我的Windows節點有這個錯誤:"INVALID" is not a valid start token這就是我的Windows節點中的指標的樣子:"api.engine.gateway.50-percentile": 0,"api.engine.gateway.75-percentile": 0,"api.engine.gateway.95-percentile": 0,"api.engine.gateway.99-percentile": 0,"api.engine.gateway.999-percentile": 0,"api.engine.gateway.count": 0,"api.engine.gateway.fifteen-minute": 0,"api.engine.gateway.five-minute": 0,
1 回答

LEATH
TA貢獻1936條經驗 獲得超7個贊
該應用程序的指標不是Prometheus基于YAML的Exposition格式。
您最好的辦法是確定是否可以將應用程序配置為導出Prometheus指標(也)。
如果沒有,您將需要一個位于Prometheus服務器和應用程序之間的代理,當Prometheus抓取該應用程序時,它會調用應用程序的指標端點并將結果轉換為Exposition格式。
據我所知,沒有一個通用的轉換導出器可以使用。但這將是有用的。您將使用端點和轉換函數對其進行配置,它將為您完成工作。
或者,您需要為應用程序編寫自己的導出器。但是,如果當前指標列表足以滿足您的需求,則可能要付出太多努力。
- 1 回答
- 0 關注
- 369 瀏覽
添加回答
舉報
0/150
提交
取消