浣跨敤Recoding Rules浼樺寲鎬ц兘
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了浣跨敤Recoding Rules浼樺寲鎬ц兘相关的知识,希望对你有一定的参考价值。
鏍囩锛?a href='http://www.mamicode.com/so/1/%e6%9c%ba%e5%88%b6' title='鏈哄埗'>鏈哄埗
鍛婅 瀹炴椂 job 鎯呭喌 pat 璁$畻 name requests閫氳繃PromQL鍙互瀹炴椂瀵筆rometheus涓噰闆嗗埌鐨勬牱鏈暟鎹繘琛屾煡璇紝鑱氬悎浠ュ強鍏跺畠鍚勭杩愮畻鎿嶄綔銆傝€屽湪鏌愪簺PromQL杈冧负澶嶆潅涓旇绠楅噺杈冨ぇ鏃讹紝鐩存帴浣跨敤PromQL鍙兘浼氬鑷碢rometheus鍝嶅簲瓒呮椂鐨勬儏鍐点€?br> 杩欐椂闇€瑕佷竴绉嶈兘澶熺被浼间簬鍚庡彴鎵瑰鐞嗙殑鏈哄埗鑳藉鍦ㄥ悗鍙板畬鎴愯繖浜涘鏉傝繍绠楃殑璁$畻锛屽浜庝娇鐢ㄨ€呰€岃█鍙渶瑕佹煡璇㈣繖浜涜繍绠楃粨鏋滃嵆鍙€?br> Prometheus閫氳繃Recoding Rule瑙勫垯鏀寔杩欑鍚庡彴璁$畻鐨勬柟寮忥紝鍙互瀹炵幇瀵瑰鏉傛煡璇㈢殑鎬ц兘浼樺寲锛屾彁楂樻煡璇㈡晥鐜囥€?/p>
瀹氫箟Recoding rules
鍦≒rometheus閰嶇疆鏂囦欢涓紝閫氳繃rule_files瀹氫箟recoding rule瑙勫垯鏂囦欢鐨勮闂矾寰勩€?/p>
rule_files:
[ - <filepath_glob> ... ]
姣忎竴涓鍒欐枃浠堕€氳繃浠ヤ笅鏍煎紡杩涜瀹氫箟锛?/p>
groups:
[ - <rule_group> ]
涓€涓畝鍗曠殑瑙勫垯鏂囦欢鍙兘鏄繖涓牱瀛愮殑锛?/p>
groups:
- name: example
rules:
- record: job:http_inprogress_requests:sum
expr: sum(http_inprogress_requests) by (job)
rule_group鐨勫叿浣撻厤缃」濡備笅鎵€绀猴細
# The name of the group. Must be unique within a file.
name: <string>
# How often rules in the group are evaluated.
[ interval: <duration> | default = global.evaluation_interval ]
rules:
[ - <rule> ... ]
涓庡憡璀﹁鍒欎竴鑷达紝涓€涓猤roup涓嬪彲浠ュ寘鍚鏉¤鍒檙ule銆?/p>
# The name of the time series to output to. Must be a valid metric name.
record: <string>
# The PromQL expression to evaluate. Every evaluation cycle this is
# evaluated at the current time, and the result recorded as a new set of
# time series with the metric name as given by 鈥榬ecord鈥?
expr: <string>
# Labels to add or overwrite before storing the result.
labels:
[ <labelname>: <labelvalue> ]
鏍规嵁瑙勫垯涓殑瀹氫箟锛孭rometheus浼氬湪鍚庡彴瀹屾垚expr涓畾涔夌殑PromQL琛ㄨ揪寮忚绠楋紝骞朵笖灏嗚绠楃粨鏋滀繚瀛樺埌鏂扮殑鏃堕棿搴忓垪record涓€傚悓鏃惰繕鍙互閫氳繃labels涓鸿繖浜涙牱鏈坊鍔犻澶栫殑鏍囩銆?/p>
杩欎簺瑙勫垯鏂囦欢鐨勮绠楅鐜囦笌鍛婅瑙勫垯璁$畻棰戠巼涓€鑷达紝閮介€氳繃global.evaluation_interval瀹氫箟:
global:
[ evaluation_interval: <duration> | default = 1m ]
以上是关于浣跨敤Recoding Rules浼樺寲鎬ц兘的主要内容,如果未能解决你的问题,请参考以下文章
绋嬪簭鎬ц兘浼樺寲涔嬬綉缁滀紶杈撲笌鏁版嵁瀛樺偍浼樺寲锛堜簲锛変笅
[WebSocket]浣跨敤WebSocket瀹炵幇瀹炴椂澶氫汉绛旈瀵规垬娓告垙
寮€婧?| UnLua锛氳吘璁紑婧愮殑 Unreal Engine 4 涓嬬壒鎬т赴瀵屼笖楂樺害浼樺寲鐨?Lua 鑴氭湰鎻掍欢