-
-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #50 from K-Phoen/docs
Docs
- Loading branch information
Showing
14 changed files
with
402 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"allow": ["color"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"default": true, | ||
"no-inline-html": false, | ||
"no-hard-tabs": false, | ||
"no-trailing-punctuation": false, | ||
"no-bare-urls": false, | ||
"line-length": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Annotations | ||
|
||
> Annotations provide a way to mark points on the graph with rich events. When | ||
> you hover over an annotation you can get event description and event tags. | ||
> The text field can include links to other systems with more detail. | ||
> | ||
> — https://grafana.com/docs/grafana/latest/reference/annotations/ | ||
```yaml | ||
tags_annotations: | ||
- name: Deployments | ||
datasource: "-- Grafana --" | ||
color: "#5794F2" | ||
tags: ["deploy", "production"] | ||
``` | ||
## That was it! | ||
[Return to the index to explore the other possibilities of the module](index.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Dashboard options | ||
|
||
Generic options describing the dashboard's behavior. | ||
|
||
```yaml | ||
title: Awesome dashboard | ||
editable: true | ||
shared_crosshair: true | ||
tags: [generated, yaml] | ||
auto_refresh: 10s | ||
``` | ||
## That was it! | ||
[Return to the index to explore the other possibilities of the module](index.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# Graph panels | ||
|
||
> The main panel in Grafana is named Graph. It provides a very rich set of | ||
> graphing options. | ||
> | ||
> — https://grafana.com/docs/grafana/latest/features/panels/graph/ | ||
```yaml | ||
rows: | ||
- name: "Graph panels row" | ||
panels: | ||
- graph: | ||
title: HTTP Rate | ||
height: 400px | ||
span: 16 | ||
datasource: prometheus-default | ||
targets: | ||
- prometheus: | ||
query: "rate(promhttp_metric_handler_requests_total[$interval])" | ||
legend: "{{handler}} - {{ code }}" | ||
axes: | ||
left: { unit: short, min: 0, label: Requests } | ||
right: { hidden: true } | ||
|
||
- graph: | ||
title: Heap allocations | ||
height: 400px | ||
span: 16 | ||
datasource: prometheus-default | ||
targets: | ||
- prometheus: | ||
query: "go_memstats_heap_alloc_bytes" | ||
legend: "{{job}}" | ||
ref: A | ||
alert: | ||
title: Too many heap allocations | ||
evaluate_every: 1m | ||
for: 1m | ||
# ID of the notification channel | ||
notify: 1 | ||
message: "Wow, a we're allocating a lot." | ||
# Valid values are: no_data, alerting, keep_state, ok | ||
on_no_data: alerting | ||
# Valid values are: alerting, keep_state | ||
on_execution_error: alerting | ||
if: | ||
- operand: and | ||
# valid `func` values are: avg, sum, count, last, min, max, median, diff, percent_diff | ||
value: {func: avg, ref: A, from: 1m, to: now} | ||
threshold: {above: 23000000} | ||
# threshold: {has_no_value: true} | ||
# threshold: {below: 23000000} | ||
# threshold: {outside_range: [23000000, 26000000]} | ||
# threshold: {within_range: [23000000, 26000000]} | ||
``` | ||
|
||
## That was it! | ||
|
||
[Return to the index to explore the other possibilities of the module](index.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Getting started with Grabana | ||
|
||
## Dashboards as code | ||
|
||
* [Example](../cmd/example/) | ||
* [GoDoc](https://pkg.go.dev/github.com/K-Phoen/grabana?tab=doc) | ||
|
||
## Dashboards as YAML | ||
|
||
* [Unmarshalling a YAML file](unmarshalling_yaml.md) | ||
* [Realistic example](../cmd/yaml/example.yaml) | ||
* [Dashboard options](dashboard_options_yaml.md) | ||
* [Variables](variables_yaml.md) | ||
* [Annotations](annotations_yaml.md) | ||
* [Text panels](text_panels_yaml.md) | ||
* [Table panels](table_panels_yaml.md) | ||
* [Graph panels](graph_panels_yaml.md) | ||
* [Singlestat panels](singlestat_panels_yaml.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Singlestat panels | ||
|
||
> The Singlestat Panel allows you to show the one main summary stat of a SINGLE | ||
> series. It reduces the series into a single number (by looking at the max, | ||
> min, average, or sum of values in the series). Singlestat also provides | ||
> thresholds to color the stat or the Panel background. It can also translate | ||
> the single number into a text value, and show a sparkline summary of the series. | ||
> | ||
> — https://grafana.com/docs/grafana/latest/features/panels/singlestat/ | ||
```yaml | ||
rows: | ||
- name: "Graph panels row" | ||
panels: | ||
- single_stat: | ||
title: Heap Allocations | ||
span: 12 | ||
height: 400px | ||
datasource: prometheus-default | ||
targets: | ||
- prometheus: | ||
query: 'go_memstats_heap_alloc_bytes{job="prometheus"}' | ||
unit: bytes | ||
thresholds: ["26000000", "28000000"] | ||
# valie values are: value, background | ||
color: ["value"] | ||
# valid values are: bottom, full | ||
sparkline: bottom | ||
``` | ||
## That was it! | ||
[Return to the index to explore the other possibilities of the module](index.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Table panels | ||
|
||
> The table panel is very flexible, supporting both multiple modes for time | ||
> series as well as for table, annotation and raw JSON data. It also provides | ||
> date formatting and value formatting and coloring options. | ||
> | ||
> — https://grafana.com/docs/grafana/latest/features/panels/table_panel/ | ||
```yaml | ||
rows: | ||
- name: "Table panels row" | ||
panels: | ||
- table: | ||
title: Threads | ||
span: 12 | ||
height: 400px | ||
datasource: prometheus-default | ||
targets: | ||
- prometheus: | ||
query: "go_threads" | ||
# hides the column having a label matching the given pattern. | ||
hidden_columns: ["Time"] | ||
time_series_aggregations: | ||
- label: AVG | ||
# valid types are: avg, count, current, min, max | ||
type: avg | ||
- label: Current | ||
type: current | ||
``` | ||
## That was it! | ||
[Return to the index to explore the other possibilities of the module](index.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Text panels | ||
|
||
> The text panel lets you make information and description panels etc. for your | ||
> dashboards. | ||
> | ||
> — https://grafana.com/docs/grafana/latest/features/panels/text/ | ||
```yaml | ||
rows: | ||
- name: "Text panels row" | ||
panels: | ||
- text: | ||
title: Some awesome text? | ||
span: 6 | ||
height: 400px | ||
markdown: "Markdown syntax help: [commonmark.org/help](https://commonmark.org/help/)\n${percentile}" | ||
|
||
- text: | ||
title: Some awesome html? | ||
span: 3 | ||
height: 200px | ||
html: "Some <b>awesome</b> html?" | ||
``` | ||
## That was it! | ||
[Return to the index to explore the other possibilities of the module](index.md) |
Oops, something went wrong.