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:
- group: 'Group Title'
panels:
- type: area-chart
title: "Chart Title"
y_label: "Y-Axis"
title: 'Chart Title'
y_label: 'Y-Axis'
y_axis:
format: number
precision: 0
metrics:
- id: my_metric_id
query_range: 'http_requests_total'
label: "Instance: {{instance}}, method: {{method}}"
unit: "count"
label: 'Instance: {{instance}}, method: {{method}}'
unit: 'count'
```
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:
panels:
- type: area-chart # or line-chart
title: 'Area Chart Title'
y_label: "Y-Axis"
y_label: 'Y-Axis'
y_axis:
format: number
precision: 0
metrics:
- id: area_http_requests_total
query_range: 'http_requests_total'
label: "Instance: {{instance}}, Method: {{method}}"
label: 'Instance: {{instance}}, Method: {{method}}'
unit: "count"
```
......@@ -55,23 +55,23 @@ panel_groups:
- group: 'Group Title'
panels:
- type: anomaly-chart
title: "Chart Title"
title: 'Chart Title'
y_label: "Y-Axis"
metrics:
- id: anomaly_requests_normal
query_range: 'http_requests_total'
label: "# of Requests"
unit: "count"
label: '# of Requests'
unit: 'count'
metrics:
- id: anomaly_requests_upper_limit
query_range: 10000
label: "Max # of requests"
unit: "count"
label: 'Max # of requests'
unit: 'count'
metrics:
- id: anomaly_requests_lower_limit
query_range: 2000
label: "Min # of requests"
unit: "count"
label: 'Min # of requests'
unit: 'count'
```
Note the following properties:
......@@ -93,13 +93,13 @@ panel_groups:
- group: 'Group title'
panels:
- type: bar
title: "Http Handlers"
title: 'HTTP Handlers'
x_label: 'Response Size'
y_axis:
name: "Handlers"
name: 'Handlers'
metrics:
- 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'
```
......@@ -121,13 +121,13 @@ dashboard: 'Dashboard Title'
panel_groups:
- group: 'Group title'
panels:
- title: "Column"
type: "column"
- title: 'Column'
type: 'column'
metrics:
- 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'
unit: MB
label: "Memory Usage"
label: 'Memory Usage'
```
Note the following properties:
......@@ -153,19 +153,19 @@ panel_groups:
priority: 5
panels:
- type: 'stacked-column'
title: "Stacked column"
y_label: "y label"
title: 'Stacked column'
y_label: 'y label'
x_label: 'x label'
metrics:
- id: memory_1
query_range: 'memory_query'
label: "memory query 1"
unit: "count"
label: 'memory query 1'
unit: 'count'
series_name: 'group 1'
- id: memory_2
query_range: 'memory_query_2'
label: "memory query 2"
unit: "count"
label: 'memory query 2'
unit: 'count'
series_name: 'group 2'
```
......@@ -185,13 +185,13 @@ dashboard: 'Dashboard Title'
panel_groups:
- group: 'Group Title'
panels:
- title: "Single Stat"
type: "single-stat"
- title: 'Single Stat'
type: 'single-stat'
metrics:
- id: 10
query: 'max(go_memstats_alloc_bytes{job="prometheus"})'
unit: MB
label: "Total"
label: 'Total'
```
Note the following properties:
......@@ -215,14 +215,14 @@ dashboard: 'Dashboard Title'
panel_groups:
- group: 'Group Title'
panels:
- title: "Single Stat"
type: "single-stat"
- title: 'Single Stat'
type: 'single-stat'
max_value: 100
metrics:
- id: 10
query: 'max(go_memstats_alloc_bytes{job="prometheus"})'
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.
......@@ -242,15 +242,15 @@ dashboard: 'Dashboard Title'
panel_groups:
- group: 'Group Title'
panels:
- title: "Gauge"
type: "gauge"
- title: 'Gauge'
type: 'gauge'
min_value: 0
max_value: 1000
split: 5
thresholds:
values: [60, 90]
mode: "percentage"
format: "kilobytes"
mode: 'percentage'
format: 'kilobytes'
metrics:
- id: 10
query: 'floor(max(prometheus_http_response_size_bytes_bucket)/1000)'
......@@ -289,13 +289,13 @@ dashboard: 'Dashboard Title'
panel_groups:
- group: 'Group Title'
panels:
- title: "Heatmap"
type: "heatmap"
- title: 'Heatmap'
type: 'heatmap'
metrics:
- id: 10
query: 'sum(rate(nginx_upstream_responses_total{upstream=~"%{kube_namespace}-%{ci_environment_slug}-.*"}[60m])) by (status_code)'
unit: req/sec
label: "Status code"
label: 'Status code'
```
Note the following properties:
......
......@@ -103,8 +103,8 @@ When a static label is used and a query returns multiple time series, then all t
metrics:
- id: my_metric_id
query_range: 'http_requests_total'
label: "Time Series"
unit: "count"
label: 'Time Series'
unit: 'count'
```
This may render a legend like this:
......@@ -117,8 +117,8 @@ For labels to be more explicit, using variables that reflect time series labels
metrics:
- id: my_metric_id
query_range: 'http_requests_total'
label: "Instance: {{instance}}, method: {{method}}"
unit: "count"
label: 'Instance: {{instance}}, method: {{method}}'
unit: 'count'
```
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
metrics:
- id: my_metric_id
query_range: 'http_requests_total'
label: "Method"
unit: "count"
label: 'Method'
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:
......
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