<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                # **定義記錄規則** <br /> ## **配置規則** Prometheus支持兩種類型的規則,并可以對其進行配置,然后定期進行評估:記錄規則和警報規則。 要將規則包含在Prometheus中,請創建一個包含必要規則語句的文件,并使Prometheus通過Prometheus配置中的`rule_files`字段加載該文件。 規則文件使用YAML。 通過將`SIGHUP`發送到Prometheus進程,可以在運行時重新加載規則文件。 僅當所有規則文件格式正確時,更改才會生效。 ## **語法檢查規則** 在不啟動Prometheus服務器的情況下快速檢查規則文件在語法上是否正確,請安裝并運行Prometheus的promtool命令行工具: ~~~ go get github.com/prometheus/prometheus/cmd/promtool promtool check rules /path/to/example.rules.yml ~~~ 當該文件中語法有效時,檢查器將已解析規則的文本打印到標準輸出,然后以返回狀態為0而退出。 如果存在任何語法錯誤或無效的輸入參數,它將打印一條錯誤消息到標準錯誤,并以返回狀態為1而退出。 ## **記錄規則** 記錄規則(Recording rules)允許您可以預先計算經常需要的或計算量大的表達式,并將其結果保存為一組新的時間序列。 這樣,查詢預先計算的結果通常比每次需要原始表達式都要快得多。 這對于dashboard特別有用,dashboard每次刷新時都需要重復查詢相同的表達式。 記錄和警報規則存在于規則組(a rule group)中。 組中的規則以定期的時間間隔順序運行。 規則文件的語法為: ~~~ groups: [ - <rule_group> ] ~~~ 一個簡單的示例規則文件是: ~~~ 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> ... ] ~~~ ### **<rule>** 記錄規則的語法如下: ~~~ # 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 'record'. expr: <string> # Labels to add or overwrite before storing the result. labels: [ <labelname>: <labelvalue> ] ~~~ 報警規則的語法如下 ~~~ # The name of the alert. Must be a valid metric name. alert: <string> # The PromQL expression to evaluate. Every evaluation cycle this is # evaluated at the current time, and all resultant time series become # pending/firing alerts. expr: <string> # Alerts are considered firing once they have been returned for this long. # Alerts which have not yet fired for long enough are considered pending. [ for: <duration> | default = 0s ] # Labels to add or overwrite for each alert. labels: [ <labelname>: <tmpl_string> ] # Annotations to add to each alert. annotations: [ <labelname>: <tmpl_string> ] ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看