<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>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                # Dashboard YAML properties > 原文:[https://docs.gitlab.com/ee/operations/metrics/dashboards/yaml.html](https://docs.gitlab.com/ee/operations/metrics/dashboards/yaml.html) * [**Dashboard (top-level) properties**](#dashboard-top-level-properties) * [**Templating (`templating`) properties**](#templating-templating-properties) * [**Links (`links`) properties**](#links-links-properties) * [**Panel group (`panel_groups`) properties**](#panel-group-panel_groups-properties) * [**Panel (`panels`) properties**](#panel-panels-properties) * [**Axis (`panels[].y_axis`) properties**](#axis-panelsy_axis-properties) * [**Metrics (`metrics`) properties**](#metrics-metrics-properties) * [Dynamic labels](#dynamic-labels) * [Dashboard YAML syntax validation](#dashboard-yaml-syntax-validation) # Dashboard YAML properties[](#dashboard-yaml-properties "Permalink") 儀表板包含幾個組件: * 模板變量. * 面板組,由面板組成. * 支持一個或多個指標的面板. 下表概述了預期屬性的詳細信息. ## **Dashboard (top-level) properties**[](#dashboard-top-level-properties "Permalink") | Property | Type | Required | Description | | --- | --- | --- | --- | | `dashboard` | string | yes | 前往儀表板. 每個文件只能定義一個儀表板. | | `panel_groups` | array | yes | 應在儀表板上的面板組. | | `templating` | hash | no | 可以在其下添加模板相關選項的頂級鍵. | | `links` | array | no | 添加鏈接以顯示在儀表板上. | ## **Templating (`templating`) properties**[](#templating-templating-properties "Permalink") | Property | Type | Required | Description | | --- | --- | --- | --- | | `variables` | hash | yes | 可以在這里定義變量. | 閱讀有關[模板](templating_variables.html)的文檔. ## **Links (`links`) properties**[](#links-links-properties "Permalink") | Property | Type | Required | Description | | --- | --- | --- | --- | | `url` | string | yes | 鏈接的地址. | | `title` | string | no | 顯示鏈接的標題. | | `type` | string | no | 鏈接的類型. 指定鏈接類型,可以是: `grafana` | 閱讀有關[鏈接](index.html#add-related-links-to-custom-dashboards)的文檔. ## **Panel group (`panel_groups`) properties**[](#panel-group-panel_groups-properties "Permalink") | Property | Type | Required | Description | | --- | --- | --- | --- | | `group` | string | required | 前往面板組. | | `priority` | number | 可選,默認為按文件順序 | 命令顯示在儀表板上. 數字越高意味著優先級越高,該頁面上的優先級越高. 數字不必是連續的. | | `panels` | array | required | 應在面板組中的面板. | 面板組中的面板排成一排,每行包含兩個面板. 該規則的一個例外是一行上的單個面板:這些面板將采用其所在行的整個寬度. ## **Panel (`panels`) properties**[](#panel-panels-properties "Permalink") | Property | Type | Required | Description | | --- | --- | --- | --- | | `type` | enum | 不,默認為`area-chart` | 指定要使用的面板類型,例如`area-chart` , `line-chart`或`anomaly-chart` . [查看所有面板類型的文檔.](panel_types.html) | | `title` | string | yes | 前往面板. | | `y_label` | string | 不,但強烈鼓勵 | 面板的 Y 軸標簽. | | `y_axis` | string | no | 面板的 Y 軸配置. | | `max_value` | number | no | 分母值用于計算[基于百分位數的結果](panel_types.html#percentile-based-results) | | `weight` | number | 否,默認為按文件順序 | 順序出現在分組中. 較低的數字表示較高的優先級,在頁面上較高. 數字不必是連續的. | | `metrics` | array | yes | 應在面板中顯示的指標. 當`type`是`area-chart`或`line-chart` ,可以顯示任意數量的度量標準,而當`type`是`anomaly-chart`時,只能顯示 3 個度量標準. | | `links` | array | no | 添加鏈接以顯示在圖表的[上下文菜單上](index.html#chart-context-menu) . | ## **Axis (`panels[].y_axis`) properties**[](#axis-panelsy_axis-properties "Permalink") | Property | Type | Required | Description | ? | | --- | --- | --- | --- | --- | | `name` | string | 不,但強烈鼓勵 | 面板的 Y 軸標簽. 如果設置,則替換`y_label` . | ? | | `format` | string | 否,默認為`engineering` | 使用的單位格式. 請參閱[單位](yaml_number_format.html)的[完整列表](yaml_number_format.html) . | ? | | `precision` | number | 否,默認為`2` | 要顯示在數字中的小數位數. | ? | ## **Metrics (`metrics`) properties**[](#metrics-metrics-properties "Permalink") | Property | Type | Required | Description | | --- | --- | --- | --- | | `id` | string | no | 用于將儀表板指標與數據庫記錄相關聯. 在儀表板配置文件中必須唯一. [警報所](../alerts.html)必需(尚未啟用支持,請參閱[相關問題](https://gitlab.com/gitlab-org/gitlab/-/issues/27980) ). | | `unit` | string | yes | 定義查詢的返回數據的單位. | | `label` | string | 不,但強烈鼓勵 | 定義查詢的圖例標簽. 在面板指標內應唯一. 可以包含時間序列標簽作為內插變量. | | `query` | string | 是,如果沒有定義`query_range` | 定義用于填充圖表/面板的 Prometheus 查詢. 如果定義,將使用[Prometheus API](https://s0prometheus0io.icopy.site/docs/prometheus/latest/querying/api/)的`query`端點. | | `query_range` | string | 是,如果未定義`query` | 定義用于填充圖表/面板的 Prometheus 查詢. 如果定義,將使用[Prometheus API](https://s0prometheus0io.icopy.site/docs/prometheus/latest/querying/api/)的`query_range`端點. | | `step` | number | 不,如果未定義,則計算值 | 定義查詢解析步長(以秒為單位). 同一面板上的指標應使用相同的`step`值. | ## Dynamic labels[](#dynamic-labels "Permalink") 從 Prometheus 查詢返回多個時間序列時,動態標簽很有用. 當使用靜態標簽并且查詢返回多個時間序列時,所有圖例項將被標記為相同,這使得識別每個時間序列變得困難: ``` metrics: - id: my_metric_id query_range: 'http_requests_total' label: "Time Series" unit: "count" ``` 這可能會生成如下圖例: [![repeated legend label chart](https://img.kancloud.cn/9d/d6/9dd6f9fec91b7b24207be35584cc4ef1_1006x66.png)](../../../user/project/integrations/img/prometheus_dashboard_repeated_label.png) 為了使標簽更明確,使用反映時間序列標簽的變量是一個好習慣. 渲染圖例時,變量將被時間序列標簽的值替換: ``` metrics: - id: my_metric_id query_range: 'http_requests_total' label: "Instance: {{instance}}, method: {{method}}" unit: "count" ``` 生成的渲染圖例將如下所示: [![legend with label variables](https://img.kancloud.cn/46/7f/467ffea1db602e03ecd1b66006e4158b_1082x104.png)](../../../user/project/integrations/img/prometheus_dashboard_label_variables.png) 動態儀表板標簽還有一個簡寫值,該標簽僅使用一個時間序列標簽: ``` metrics: - id: my_metric_id query_range: 'http_requests_total' label: "Method" unit: "count" ``` 這可以通過降低`label`的值來實現,如果還有更多的單詞用空格分隔,請用下劃線( `_` )替換這些空格. 然后根據 Prometheus 查詢返回的時間序列的標簽檢查轉換后的值. 如果找到與轉換后的值相等的時間序列標簽,則將使用標簽值并將其呈現在圖例中,如下所示: [![legend with label shorthand variable](https://img.kancloud.cn/75/d1/75d11b48334a2c3834d93bb40a63341d_1020x62.png)](../../../user/project/integrations/img/prometheus_dashboard_label_variable_shorthand.png) ## Dashboard YAML syntax validation[](#dashboard-yaml-syntax-validation "Permalink") 在 GitLab 13.1 中[引入](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/33202) . 要確認您的儀表板定義包含有效的 YAML 語法,請執行以下操作: 1. 導航 **存儲庫>文件** . 2. 導航到存儲庫中的儀表板文件. 3. 查看文件內容上方顯示的有關文件的信息窗格. 具有有效語法的文件顯示**Metrics 儀表板 YAML 定義有效** ,而具有無效語法的文件顯示**Metrics Dashboard YAML 定義無效** . [![Metrics Dashboard_YAML_syntax_validation](https://img.kancloud.cn/91/7e/917ea25b521f9547a0a952458ca5e444_1000x295.png)](../../../user/project/integrations/img/prometheus_dashboard_yaml_validation_v13_1.png) 當" **指標儀表板" YAML 定義無效時** ,將至少顯示以下消息之一: 1. `dashboard: can't be blank` [learn more](../../../operations/metrics/dashboards/yaml.html#dashboard-top-level-properties) 2. `panel_groups: should be an array of panel_groups objects` [learn more](../../../operations/metrics/dashboards/yaml.html#dashboard-top-level-properties) 3. `group: can't be blank` [learn more](../../../operations/metrics/dashboards/yaml.html#panel-group-panel_groups-properties) 4. `panels: should be an array of panels objects` [learn more](../../../operations/metrics/dashboards/yaml.html#panel-group-panel_groups-properties) 5. `title: can't be blank` [learn more](../../../operations/metrics/dashboards/yaml.html#panel-panels-properties) 6. `metrics: should be an array of metrics objects` [learn more](../../../operations/metrics/dashboards/yaml.html#panel-panels-properties) 7. `query: can't be blank` [learn more](../../../operations/metrics/dashboards/yaml.html#metrics-metrics-properties) 8. `query_range: can't be blank` [learn more](../../../operations/metrics/dashboards/yaml.html#metrics-metrics-properties) 9. `unit: can't be blank` [learn more](../../../operations/metrics/dashboards/yaml.html#metrics-metrics-properties) 10. `YAML syntax: The parsed YAML is too big` 當 YAML 文件大于 1 MB 時顯示. 11. `YAML syntax: Invalid configuration format` 當 YAML 文件為空或不包含有效的 YAML 時顯示. 指標儀表板 YAML 定義驗證信息也可以作為[GraphQL API 字段獲得](../../../api/graphql/reference/index.html#metricsdashboard)
                  <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>

                              哎呀哎呀视频在线观看