Skip to content

Commit

Permalink
move examples and defs over to this repo
Browse files Browse the repository at this point in the history
original plan was to have seperats docs and code repos
but as the code readme is the main grafana info point am now
combining the two
  • Loading branch information
andymchugh committed Feb 21, 2024
1 parent 3bd59cc commit da1c568
Show file tree
Hide file tree
Showing 12 changed files with 668 additions and 0 deletions.
4 changes: 4 additions & 0 deletions examples/darkThemeSvg1.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions examples/darkThemeSvg2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions examples/lightThemeSvg1.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions examples/lightThemeSvg2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
70 changes: 70 additions & 0 deletions examples/panelConfig1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
---

#------------------------------------------------------------------------------
# YAML Aliases to simplify maintenance

anchorLinks:
- link: &grafana-home
url: "https://grafana.com/"
params: "time"

#------------------------------------------------------------------------------
# Panel Config

cellIdPreamble: "cell-"
cells:
drawio:
link:
url: "https://app.diagrams.net/?p=svgdata"
docs:
link:
url: "https://github.com/andymchugh/andrewbmchugh-flow-panel-docs/blob/main/README.md"
inbox_depth:
dataRef: "test-data-large-sin"
label:
separator: "cr"
units: "none"
decimalPoints: 0
labelColor:
gradientMode: "hue"
thresholds:
- {color: "green", level: 0}
- {color: "orange", level: 500}
- {color: "red", level: 1000}
link: *grafana-home
db_transactions:
dataRef: "test-data-large-cos"
label:
separator: "cr"
units: "ops"
decimalPoints: 0
fillColor:
gradientMode: "hue"
thresholds:
- {color: "semi-dark-green", level: 0}
- {color: "orange", level: 400}
- {color: "red", level: 800}
link: *grafana-home
start_rate:
dataRef: "test-data-small-sin"
label:
separator: "colon"
units: "pps"
decimalPoints: 0
labelColor:
gradientMode: "hue"
thresholds:
- {color: "green", level: 0}
- {color: "orange", level: 100}
link: *grafana-home
active_workers:
dataRef: "test-data-small-cos"
label:
separator: "cr"
units: "none"
decimalPoints: 0
labelColor:
gradientMode: "hue"
thresholds:
- {color: "#888888", level: 0}
- {color: "light-blue", level: 100}
104 changes: 104 additions & 0 deletions examples/panelConfig2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
---

gradientMode: "hue"
cellIdPreamble: "cell-"
cells:
inhouse_queue_depth:
dataRef: "test-data-large-cos"
label:
separator: "cr"
units: "none"
decimalPoints: 0
labelColor:
thresholdsRef: "queuedepth"
linkRef: "grafana-home"
inhouse_queue_count:
dataRef: "test-data-small-sin"
label:
separator: "cr"
units: "none"
decimalPoints: 0
labelColor:
thresholdsRef: "queuecount"
linkRef: "grafana-home"
rabbitmq_queue_depth:
dataRef: "test-data-large-sin"
label:
separator: "cr"
units: "none"
decimalPoints: 0
labelColor:
thresholdsRef: "queuedepth"
linkRef: "grafana-home"
rabbitmq_queue_count:
dataRef: "test-data-small-cos"
label:
separator: "cr"
units: "none"
decimalPoints: 0
labelColor:
thresholdsRef: "queuecount"
linkRef: "grafana-home"
mem_queue_depth:
dataRef: "test-data-large-sin"
label:
separator: "cr"
units: "none"
decimalPoints: 0
labelColor:
thresholdsRef: "queuedepth"
linkRef: "grafana-home"
db_transactions:
dataRef: "test-data-large-sin"
label:
separator: "cr"
units: "ops"
decimalPoints: 0
labelColor:
thresholdsRef: "dbtrans"
linkRef: "grafana-home"
duplicate_lock_rate:
dataRef: "test-data-small-cos"
label:
separator: "cr"
units: "ops"
decimalPoints: 0
labelColor:
thresholdsRef: "dbtrans"
linkRef: "grafana-home"
inhouse_queue_latency:
dataRef: "test-data-small-sin"
label:
separator: "cr"
units: "s"
decimalPoints: 1
labelColor:
thresholdsRef: "queuelatency"
linkRef: "grafana-home"
wakeup_queue_latency:
dataRef: "test-data-small-sin"
label:
separator: "cr"
units: "s"
decimalPoints: 1
labelColor:
thresholdsRef: "queuelatency"
linkRef: "grafana-home"
rabbitmq_latency:
dataRef: "test-data-small-cos"
label:
separator: "cr"
units: "s"
decimalPoints: 1
labelColor:
thresholdsRef: "queuelatency"
linkRef: "grafana-home"
rabbitmq_slowness:
dataRef: "test-data-small-cos"
label:
separator: "space"
units: "s"
decimalPoints: 1
labelColor:
thresholdsRef: "queuelatency"
linkRef: "grafana-home"
82 changes: 82 additions & 0 deletions examples/panelConfigGrafanaVariables.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
---

# This panelConfig is intended for use with Svg1. It sets all the widgets to drive from the
# same time series with the same thresholds and no gradient to make it easier to understand.
#
# To work, the grafana variable has to impact a query, which is impossible to do with a
# test data drive. But we can work around that by adding the variable to the panel title.
# To explore this feature:
# - Add a grafana text variable 'site'
# - Add a grafana text variable 'environment'
# - Change your panel title to 'Example Flow Panel - ${site} - ${environment}'
#
# With that in place:
# - Set site='Cicely'. See the threshold values (impacting color) on 'Inbox Depth' half
# - Set environment='prod'. See the threshold values (impacting color) on 'Inbox Depth' half
# - Set both and now the Inbox thresholds are a quarter
variableThresholdScalars:
site:
- {variableValuePattern: ".*Cicely.*", thresholdScalar: 0.5, cellIdPatternScope: [".*box.*"]}
environment:
- {variableValuePattern: "prod", thresholdScalar: 0.5, cellIdPatternScope: [".*box.*"]}

#------------------------------------------------------------------------------
# YAML Aliases to simplify maintenance

anchorLinks:
- link: &grafana-home
url: "https://grafana.com/"
params: "time"
- thresholds: &thresholds
- {color: "semi-dark-green", level: 0}
- {color: "orange", level: 400}
- {color: "red", level: 800}

#------------------------------------------------------------------------------
# Panel Config

gradientMode: "none"
cellIdPreamble: "cell-"
cells:
drawio:
link:
url: "https://app.diagrams.net/?p=svgdata"
docs:
link:
url: "https://github.com/andymchugh/andrewbmchugh-flow-panel-docs/blob/main/README.md"
inbox_depth:
dataRef: "test-data-large-cos"
label:
separator: "cr"
units: "none"
decimalPoints: 0
labelColor:
thresholds: *thresholds
link: *grafana-home
db_transactions:
dataRef: "test-data-large-cos"
label:
separator: "cr"
units: "ops"
decimalPoints: 0
fillColor:
thresholds: *thresholds
link: *grafana-home
start_rate:
dataRef: "test-data-large-cos"
label:
separator: "colon"
units: "pps"
decimalPoints: 0
labelColor:
thresholds: *thresholds
link: *grafana-home
active_workers:
dataRef: "test-data-large-cos"
label:
separator: "cr"
units: "none"
decimalPoints: 0
labelColor:
thresholds: *thresholds
link: *grafana-home
91 changes: 91 additions & 0 deletions examples/panelConfigGrafanaVariablesWithDataRefOverrides.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
---

# This panelConfig is intended for use with Svg1. It sets all the widgets to drive from the
# same time series with the same thresholds and no gradient to make it easier to understand.
#
# In addition to the variable scalars described below, this example also demonstrates how to
# drive the different attributes of a cell from different data series. Each cell is setup to
# drive the displayed label value from "test-data-small-cos" but the thresholds from
# "test-data-large-cos".
#
# To work, the grafana variable has to impact a query, which is impossible to do with a
# test data drive. But we can work around that by adding the variable to the panel title.
# To explore this feature:
# - Add a grafana text variable 'site'
# - Add a grafana text variable 'environment'
# - Change your panel title to 'Example Flow Panel - ${site} - ${environment}'
#
# With that in place:
# - Set site='Cicely'. See the threshold values (impacting color) on 'Inbox Depth' half
# - Set environment='prod'. See the threshold values (impacting color) on 'Inbox Depth' half
# - Set both and now the Inbox thresholds are a quarter
variableThresholdScalars:
site:
- {variableValuePattern: ".*Cicely.*", thresholdScalar: 0.5, cellIdPatternScope: [".*box.*"]}
environment:
- {variableValuePattern: "prod", thresholdScalar: 0.5, cellIdPatternScope: [".*box.*"]}

#------------------------------------------------------------------------------
# YAML Aliases to simplify maintenance

anchorLinks:
- link: &grafana-home
url: "https://grafana.com/"
params: "time"
- thresholds: &thresholds
- {color: "semi-dark-green", level: 0}
- {color: "orange", level: 400}
- {color: "red", level: 800}

#------------------------------------------------------------------------------
# Panel Config

gradientMode: "none"
cellIdPreamble: "cell-"
cells:
drawio:
link:
url: "https://app.diagrams.net/?p=svgdata"
docs:
link:
url: "https://github.com/andymchugh/andrewbmchugh-flow-panel-docs/blob/main/README.md"
inbox_depth:
dataRef: "test-data-large-cos"
label:
dataRef: "test-data-small-cos"
separator: "cr"
units: "none"
decimalPoints: 0
labelColor:
thresholds: *thresholds
link: *grafana-home
db_transactions:
label:
dataRef: "test-data-small-cos"
separator: "cr"
units: "ops"
decimalPoints: 0
fillColor:
dataRef: "test-data-large-cos"
thresholds: *thresholds
link: *grafana-home
start_rate:
label:
dataRef: "test-data-small-cos"
separator: "colon"
units: "pps"
decimalPoints: 0
labelColor:
dataRef: "test-data-large-cos"
thresholds: *thresholds
link: *grafana-home
active_workers:
dataRef: "test-data-small-cos"
label:
separator: "cr"
units: "none"
decimalPoints: 0
labelColor:
dataRef: "test-data-large-cos"
thresholds: *thresholds
link: *grafana-home
Loading

0 comments on commit da1c568

Please sign in to comment.