Skip to content

Commit aff9707

Browse files
committed
[grafana] SpiceDB dashboard: add graphs for cache hit/miss rate and ratio
1 parent 2cdf9ef commit aff9707

File tree

1 file changed

+265
-1
lines changed
  • operations/observability/mixins/meta/dashboards/components

1 file changed

+265
-1
lines changed

operations/observability/mixins/meta/dashboards/components/spicedb.json

Lines changed: 265 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,9 +555,273 @@
555555
],
556556
"title": "New database connections",
557557
"type": "timeseries"
558+
},
559+
{
560+
"collapsed": false,
561+
"gridPos": {
562+
"h": 1,
563+
"w": 24,
564+
"x": 0,
565+
"y": 28
566+
},
567+
"id": 14,
568+
"panels": [],
569+
"title": "Cache",
570+
"type": "row"
571+
},
572+
{
573+
"datasource": {
574+
"type": "prometheus",
575+
"uid": "P4169E866C3094E38"
576+
},
577+
"fieldConfig": {
578+
"defaults": {
579+
"color": {
580+
"mode": "palette-classic"
581+
},
582+
"custom": {
583+
"axisCenteredZero": false,
584+
"axisColorMode": "text",
585+
"axisLabel": "",
586+
"axisPlacement": "auto",
587+
"barAlignment": 0,
588+
"drawStyle": "line",
589+
"fillOpacity": 0,
590+
"gradientMode": "none",
591+
"hideFrom": {
592+
"legend": false,
593+
"tooltip": false,
594+
"viz": false
595+
},
596+
"lineInterpolation": "linear",
597+
"lineWidth": 1,
598+
"pointSize": 5,
599+
"scaleDistribution": {
600+
"type": "linear"
601+
},
602+
"showPoints": "auto",
603+
"spanNulls": false,
604+
"stacking": {
605+
"group": "A",
606+
"mode": "none"
607+
},
608+
"thresholdsStyle": {
609+
"mode": "off"
610+
}
611+
},
612+
"mappings": [],
613+
"min": 0,
614+
"thresholds": {
615+
"mode": "absolute",
616+
"steps": [
617+
{
618+
"color": "green",
619+
"value": null
620+
},
621+
{
622+
"color": "red",
623+
"value": 80
624+
}
625+
]
626+
}
627+
},
628+
"overrides": [
629+
{
630+
"matcher": {
631+
"id": "byRegexp",
632+
"options": "/Hit.*/"
633+
},
634+
"properties": [
635+
{
636+
"id": "color",
637+
"value": {
638+
"fixedColor": "green",
639+
"mode": "fixed",
640+
"seriesBy": "max"
641+
}
642+
}
643+
]
644+
},
645+
{
646+
"matcher": {
647+
"id": "byRegexp",
648+
"options": "/Miss.*/"
649+
},
650+
"properties": [
651+
{
652+
"id": "color",
653+
"value": {
654+
"fixedColor": "red",
655+
"mode": "fixed",
656+
"seriesBy": "last"
657+
}
658+
}
659+
]
660+
}
661+
]
662+
},
663+
"gridPos": {
664+
"h": 8,
665+
"w": 12,
666+
"x": 0,
667+
"y": 29
668+
},
669+
"id": 13,
670+
"interval": "1m",
671+
"options": {
672+
"legend": {
673+
"calcs": [],
674+
"displayMode": "list",
675+
"placement": "bottom",
676+
"showLegend": true
677+
},
678+
"tooltip": {
679+
"mode": "single",
680+
"sort": "none"
681+
}
682+
},
683+
"targets": [
684+
{
685+
"datasource": {
686+
"type": "prometheus",
687+
"uid": "P4169E866C3094E38"
688+
},
689+
"editorMode": "code",
690+
"expr": "rate (sum (spicedb_cache_hits_total[$__rate_interval]))",
691+
"legendFormat": "Hit",
692+
"range": true,
693+
"refId": "A"
694+
},
695+
{
696+
"datasource": {
697+
"type": "prometheus",
698+
"uid": "P4169E866C3094E38"
699+
},
700+
"editorMode": "code",
701+
"expr": "rate (sum (spicedb_cache_misses_total[$__rate_interval]))",
702+
"hide": false,
703+
"legendFormat": "Miss",
704+
"range": true,
705+
"refId": "B"
706+
},
707+
{
708+
"datasource": {
709+
"type": "prometheus",
710+
"uid": "P4169E866C3094E38"
711+
},
712+
"editorMode": "code",
713+
"expr": "spicedb",
714+
"hide": false,
715+
"legendFormat": "__auto",
716+
"range": true,
717+
"refId": "C"
718+
}
719+
],
720+
"title": "Cache Hit & Miss Rates [1m]",
721+
"type": "timeseries"
722+
},
723+
{
724+
"datasource": {
725+
"type": "prometheus",
726+
"uid": "P4169E866C3094E38"
727+
},
728+
"fieldConfig": {
729+
"defaults": {
730+
"color": {
731+
"fixedColor": "yellow",
732+
"mode": "fixed"
733+
},
734+
"custom": {
735+
"axisCenteredZero": false,
736+
"axisColorMode": "text",
737+
"axisLabel": "",
738+
"axisPlacement": "auto",
739+
"barAlignment": 0,
740+
"drawStyle": "line",
741+
"fillOpacity": 0,
742+
"gradientMode": "none",
743+
"hideFrom": {
744+
"legend": false,
745+
"tooltip": false,
746+
"viz": false
747+
},
748+
"lineInterpolation": "linear",
749+
"lineWidth": 1,
750+
"pointSize": 5,
751+
"scaleDistribution": {
752+
"type": "linear"
753+
},
754+
"showPoints": "auto",
755+
"spanNulls": false,
756+
"stacking": {
757+
"group": "A",
758+
"mode": "none"
759+
},
760+
"thresholdsStyle": {
761+
"mode": "off"
762+
}
763+
},
764+
"mappings": [],
765+
"min": 0,
766+
"thresholds": {
767+
"mode": "absolute",
768+
"steps": [
769+
{
770+
"color": "green",
771+
"value": null
772+
}
773+
]
774+
}
775+
},
776+
"overrides": []
777+
},
778+
"gridPos": {
779+
"h": 8,
780+
"w": 12,
781+
"x": 12,
782+
"y": 29
783+
},
784+
"id": 16,
785+
"interval": "1m",
786+
"options": {
787+
"legend": {
788+
"calcs": [],
789+
"displayMode": "list",
790+
"placement": "bottom",
791+
"showLegend": true
792+
},
793+
"tooltip": {
794+
"mode": "single",
795+
"sort": "none"
796+
}
797+
},
798+
"targets": [
799+
{
800+
"datasource": {
801+
"type": "prometheus",
802+
"uid": "P4169E866C3094E38"
803+
},
804+
"editorMode": "code",
805+
"expr": "rate (sum (spicedb_cache_hits_total[$__rate_interval])) / rate (sum (spicedb_cache_misses_total[$__rate_interval]))",
806+
"legendFormat": "Ratio",
807+
"range": true,
808+
"refId": "A"
809+
},
810+
{
811+
"datasource": {
812+
"type": "prometheus",
813+
"uid": "P4169E866C3094E38"
814+
},
815+
"hide": false,
816+
"refId": "C"
817+
}
818+
],
819+
"title": "Cache Hit/Miss Ratio[1m]",
820+
"type": "timeseries"
558821
}
559822
],
560-
"schemaVersion": 37,
823+
"refresh": "",
824+
"schemaVersion": 38,
561825
"style": "dark",
562826
"tags": [],
563827
"templating": {

0 commit comments

Comments
 (0)