Fix double quotes in YAML examples to singles

Increasing consistency in our code examples by using single quotes
in YAML examples, rather than the occasional double quotation marks.
parent d67081e3
...@@ -51,16 +51,16 @@ To create a new dashboard from the command line: ...@@ -51,16 +51,16 @@ To create a new dashboard from the command line:
- group: 'Group Title' - group: 'Group Title'
panels: panels:
- type: area-chart - type: area-chart
title: "Chart Title" title: 'Chart Title'
y_label: "Y-Axis" y_label: 'Y-Axis'
y_axis: y_axis:
format: number format: number
precision: 0 precision: 0
metrics: metrics:
- id: my_metric_id - id: my_metric_id
query_range: 'http_requests_total' query_range: 'http_requests_total'
label: "Instance: {{instance}}, method: {{method}}" label: 'Instance: {{instance}}, method: {{method}}'
unit: "count" unit: 'count'
``` ```
1. Save the file, commit, and push to your repository. The file must be present in your **default** branch. 1. Save the file, commit, and push to your repository. The file must be present in your **default** branch.
......
...@@ -19,14 +19,14 @@ panel_groups: ...@@ -19,14 +19,14 @@ panel_groups:
panels: panels:
- type: area-chart # or line-chart - type: area-chart # or line-chart
title: 'Area Chart Title' title: 'Area Chart Title'
y_label: "Y-Axis" y_label: 'Y-Axis'
y_axis: y_axis:
format: number format: number
precision: 0 precision: 0
metrics: metrics:
- id: area_http_requests_total - id: area_http_requests_total
query_range: 'http_requests_total' query_range: 'http_requests_total'
label: "Instance: {{instance}}, Method: {{method}}" label: 'Instance: {{instance}}, Method: {{method}}'
unit: "count" unit: "count"
``` ```
...@@ -55,23 +55,23 @@ panel_groups: ...@@ -55,23 +55,23 @@ panel_groups:
- group: 'Group Title' - group: 'Group Title'
panels: panels:
- type: anomaly-chart - type: anomaly-chart
title: "Chart Title" title: 'Chart Title'
y_label: "Y-Axis" y_label: "Y-Axis"
metrics: metrics:
- id: anomaly_requests_normal - id: anomaly_requests_normal
query_range: 'http_requests_total' query_range: 'http_requests_total'
label: "# of Requests" label: '# of Requests'
unit: "count" unit: 'count'
metrics: metrics:
- id: anomaly_requests_upper_limit - id: anomaly_requests_upper_limit
query_range: 10000 query_range: 10000
label: "Max # of requests" label: 'Max # of requests'
unit: "count" unit: 'count'
metrics: metrics:
- id: anomaly_requests_lower_limit - id: anomaly_requests_lower_limit
query_range: 2000 query_range: 2000
label: "Min # of requests" label: 'Min # of requests'
unit: "count" unit: 'count'
``` ```
Note the following properties: Note the following properties:
...@@ -93,13 +93,13 @@ panel_groups: ...@@ -93,13 +93,13 @@ panel_groups:
- group: 'Group title' - group: 'Group title'
panels: panels:
- type: bar - type: bar
title: "Http Handlers" title: 'HTTP Handlers'
x_label: 'Response Size' x_label: 'Response Size'
y_axis: y_axis:
name: "Handlers" name: 'Handlers'
metrics: metrics:
- id: prometheus_http_response_size_bytes_bucket - id: prometheus_http_response_size_bytes_bucket
query_range: "sum(increase(prometheus_http_response_size_bytes_bucket[1d])) by (handler)" query_range: 'sum(increase(prometheus_http_response_size_bytes_bucket[1d])) by (handler)'
unit: 'Bytes' unit: 'Bytes'
``` ```
...@@ -121,13 +121,13 @@ dashboard: 'Dashboard Title' ...@@ -121,13 +121,13 @@ dashboard: 'Dashboard Title'
panel_groups: panel_groups:
- group: 'Group title' - group: 'Group title'
panels: panels:
- title: "Column" - title: 'Column'
type: "column" type: 'column'
metrics: metrics:
- id: 1024_memory - id: 1024_memory
query: 'avg(sum(container_memory_usage_bytes{container_name!="POD",pod_name=~"^%{ci_environment_slug}-([^c].*|c([^a]|a([^n]|n([^a]|a([^r]|r[^y])))).*|)-(.*)",namespace="%{kube_namespace}"}) by (job)) without (job) / count(avg(container_memory_usage_bytes{container_name!="POD",pod_name=~"^%{ci_environment_slug}-([^c].*|c([^a]|a([^n]|n([^a]|a([^r]|r[^y])))).*|)-(.*)",namespace="%{kube_namespace}"}) without (job)) /1024/1024' query: 'avg(sum(container_memory_usage_bytes{container_name!="POD",pod_name=~"^%{ci_environment_slug}-([^c].*|c([^a]|a([^n]|n([^a]|a([^r]|r[^y])))).*|)-(.*)",namespace="%{kube_namespace}"}) by (job)) without (job) / count(avg(container_memory_usage_bytes{container_name!="POD",pod_name=~"^%{ci_environment_slug}-([^c].*|c([^a]|a([^n]|n([^a]|a([^r]|r[^y])))).*|)-(.*)",namespace="%{kube_namespace}"}) without (job)) /1024/1024'
unit: MB unit: MB
label: "Memory Usage" label: 'Memory Usage'
``` ```
Note the following properties: Note the following properties:
...@@ -153,19 +153,19 @@ panel_groups: ...@@ -153,19 +153,19 @@ panel_groups:
priority: 5 priority: 5
panels: panels:
- type: 'stacked-column' - type: 'stacked-column'
title: "Stacked column" title: 'Stacked column'
y_label: "y label" y_label: 'y label'
x_label: 'x label' x_label: 'x label'
metrics: metrics:
- id: memory_1 - id: memory_1
query_range: 'memory_query' query_range: 'memory_query'
label: "memory query 1" label: 'memory query 1'
unit: "count" unit: 'count'
series_name: 'group 1' series_name: 'group 1'
- id: memory_2 - id: memory_2
query_range: 'memory_query_2' query_range: 'memory_query_2'
label: "memory query 2" label: 'memory query 2'
unit: "count" unit: 'count'
series_name: 'group 2' series_name: 'group 2'
``` ```
...@@ -185,13 +185,13 @@ dashboard: 'Dashboard Title' ...@@ -185,13 +185,13 @@ dashboard: 'Dashboard Title'
panel_groups: panel_groups:
- group: 'Group Title' - group: 'Group Title'
panels: panels:
- title: "Single Stat" - title: 'Single Stat'
type: "single-stat" type: 'single-stat'
metrics: metrics:
- id: 10 - id: 10
query: 'max(go_memstats_alloc_bytes{job="prometheus"})' query: 'max(go_memstats_alloc_bytes{job="prometheus"})'
unit: MB unit: MB
label: "Total" label: 'Total'
``` ```
Note the following properties: Note the following properties:
...@@ -215,14 +215,14 @@ dashboard: 'Dashboard Title' ...@@ -215,14 +215,14 @@ dashboard: 'Dashboard Title'
panel_groups: panel_groups:
- group: 'Group Title' - group: 'Group Title'
panels: panels:
- title: "Single Stat" - title: 'Single Stat'
type: "single-stat" type: 'single-stat'
max_value: 100 max_value: 100
metrics: metrics:
- id: 10 - id: 10
query: 'max(go_memstats_alloc_bytes{job="prometheus"})' query: 'max(go_memstats_alloc_bytes{job="prometheus"})'
unit: '%' unit: '%'
label: "Total" label: 'Total'
``` ```
For example, if you have a query value of `53.6`, adding `%` as the unit results in a single stat value of `53.6%`, but if the maximum expected value of the query is `120`, the value would be `44.6%`. Adding the `max_value` causes the correct percentage value to display. For example, if you have a query value of `53.6`, adding `%` as the unit results in a single stat value of `53.6%`, but if the maximum expected value of the query is `120`, the value would be `44.6%`. Adding the `max_value` causes the correct percentage value to display.
...@@ -242,15 +242,15 @@ dashboard: 'Dashboard Title' ...@@ -242,15 +242,15 @@ dashboard: 'Dashboard Title'
panel_groups: panel_groups:
- group: 'Group Title' - group: 'Group Title'
panels: panels:
- title: "Gauge" - title: 'Gauge'
type: "gauge" type: 'gauge'
min_value: 0 min_value: 0
max_value: 1000 max_value: 1000
split: 5 split: 5
thresholds: thresholds:
values: [60, 90] values: [60, 90]
mode: "percentage" mode: 'percentage'
format: "kilobytes" format: 'kilobytes'
metrics: metrics:
- id: 10 - id: 10
query: 'floor(max(prometheus_http_response_size_bytes_bucket)/1000)' query: 'floor(max(prometheus_http_response_size_bytes_bucket)/1000)'
...@@ -289,13 +289,13 @@ dashboard: 'Dashboard Title' ...@@ -289,13 +289,13 @@ dashboard: 'Dashboard Title'
panel_groups: panel_groups:
- group: 'Group Title' - group: 'Group Title'
panels: panels:
- title: "Heatmap" - title: 'Heatmap'
type: "heatmap" type: 'heatmap'
metrics: metrics:
- id: 10 - id: 10
query: 'sum(rate(nginx_upstream_responses_total{upstream=~"%{kube_namespace}-%{ci_environment_slug}-.*"}[60m])) by (status_code)' query: 'sum(rate(nginx_upstream_responses_total{upstream=~"%{kube_namespace}-%{ci_environment_slug}-.*"}[60m])) by (status_code)'
unit: req/sec unit: req/sec
label: "Status code" label: 'Status code'
``` ```
Note the following properties: Note the following properties:
......
...@@ -103,8 +103,8 @@ When a static label is used and a query returns multiple time series, then all t ...@@ -103,8 +103,8 @@ When a static label is used and a query returns multiple time series, then all t
metrics: metrics:
- id: my_metric_id - id: my_metric_id
query_range: 'http_requests_total' query_range: 'http_requests_total'
label: "Time Series" label: 'Time Series'
unit: "count" unit: 'count'
``` ```
This may render a legend like this: This may render a legend like this:
...@@ -117,8 +117,8 @@ For labels to be more explicit, using variables that reflect time series labels ...@@ -117,8 +117,8 @@ For labels to be more explicit, using variables that reflect time series labels
metrics: metrics:
- id: my_metric_id - id: my_metric_id
query_range: 'http_requests_total' query_range: 'http_requests_total'
label: "Instance: {{instance}}, method: {{method}}" label: 'Instance: {{instance}}, method: {{method}}'
unit: "count" unit: 'count'
``` ```
The resulting rendered legend will look like this: The resulting rendered legend will look like this:
...@@ -131,8 +131,8 @@ There is also a shorthand value for dynamic dashboard labels that make use of on ...@@ -131,8 +131,8 @@ There is also a shorthand value for dynamic dashboard labels that make use of on
metrics: metrics:
- id: my_metric_id - id: my_metric_id
query_range: 'http_requests_total' query_range: 'http_requests_total'
label: "Method" label: 'Method'
unit: "count" unit: 'count'
``` ```
This works by lowercasing the value of `label` and, if there are more words separated by spaces, replacing those spaces with an underscore (`_`). The transformed value is then checked against the labels of the time series returned by the Prometheus query. If a time series label is found that is equal to the transformed value, then the label value will be used and rendered in the legend like this: This works by lowercasing the value of `label` and, if there are more words separated by spaces, replacing those spaces with an underscore (`_`). The transformed value is then checked against the labels of the time series returned by the Prometheus query. If a time series label is found that is equal to the transformed value, then the label value will be used and rendered in the legend like this:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment