influxdb 慢查詢日志輸出處理


[coordinator]
  # The time threshold when a query will be logged as a slow query.  This limit can be set to help
  # discover slow or resource intensive queries.  Setting the value to 0 disables the slow query logging.
  # 設置慢查詢時間,超過多少視為慢查詢.***核心更改配置****
  log-queries-after = "1ns"
[http]
  # Determines whether HTTP request logging is enabled.
 # 設置http請求的日志不打印,(線上量比較大) log-enabled = false [logging] # Determines which level of logs will be emitted. The available levels # are error, warn, info, and debug. Logs that are equal to or above the # specified level will be emitted. error, warn, info
# 設置線上日志打印級別為警告級別. level = "warn"

輸出日志示例:

2021-08-17T08:12:52.428499Z     warn    Detected slow query: SELECT * FROM gps WHERE time > now() - 5m (qid: 17, database: gps, threshold: 1ns) {"log_id": "0W0nUHMG000", "service": "query"}

 

 

 

附1: 配置支持單位

 

 

線上influxdb異常,需要定位原因,所以打開了慢查詢日志.

log-queries-after = "1ns"

配置成了1ns了,總該隨隨便便一個查詢就能觸發吧!

啟動驗證,結果沒有觸發.[尷尬]

查看文檔

 

 

 我就是雙擊influxd.exe執行的啊!也是相同目錄咋還不生效呢?

驗證發現,需要命令行(cmd)執行 

influxd -config D:/software/influxdb-1.8.0-1/influxdb.conf

更改完畢,完美本地復現.

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM