From d35163de69d7d91634fc58875ec72fa81372cc75 Mon Sep 17 00:00:00 2001 From: Christophe Lambin Date: Tue, 14 Jan 2025 22:08:14 +0100 Subject: [PATCH] feat: optionally tag exported dashboards (#10) --- go.mod | 4 +- go.sum | 4 +- grope.go | 6 +- internal/{ => grope}/cli.go | 3 +- internal/{ => grope}/cli_test.go | 2 +- internal/{ => grope}/exporter.go | 33 +- internal/{ => grope}/exporter_test.go | 73 +- internal/{ => grope}/fetcher.go | 4 +- internal/{ => grope}/fetcher_test.go | 2 +- internal/{ => grope}/formatter.go | 8 +- ...stexportdashboards-filtered_by_folder.yaml | 3 +- ...testexportdashboards-filtered_by_name.yaml | 3 +- .../testexportdashboards-override.yaml | 6 +- .../testdata/testexportdashboards-paged.yaml | 6 +- .../testdata/testexportdashboards-tagged.yaml | 38 + .../testexportdashboards-unfiltered.yaml | 6 +- .../testdata/testexportdatasources.yaml | 0 test.yaml | 4636 ----------------- 18 files changed, 174 insertions(+), 4663 deletions(-) rename internal/{ => grope}/cli.go (96%) rename internal/{ => grope}/cli_test.go (98%) rename internal/{ => grope}/exporter.go (74%) rename internal/{ => grope}/exporter_test.go (78%) rename internal/{ => grope}/fetcher.go (99%) rename internal/{ => grope}/fetcher_test.go (99%) rename internal/{ => grope}/formatter.go (94%) rename internal/{ => grope}/testdata/testexportdashboards-filtered_by_folder.yaml (87%) rename internal/{ => grope}/testdata/testexportdashboards-filtered_by_name.yaml (87%) rename internal/{ => grope}/testdata/testexportdashboards-override.yaml (87%) rename internal/{ => grope}/testdata/testexportdashboards-paged.yaml (87%) create mode 100644 internal/grope/testdata/testexportdashboards-tagged.yaml rename internal/{ => grope}/testdata/testexportdashboards-unfiltered.yaml (87%) rename internal/{ => grope}/testdata/testexportdatasources.yaml (100%) delete mode 100644 test.yaml diff --git a/go.mod b/go.mod index c28571e..a67a88b 100644 --- a/go.mod +++ b/go.mod @@ -2,12 +2,14 @@ module github.com/clambin/grope go 1.23 +toolchain go1.23.4 + require ( github.com/clambin/go-common/charmer v0.2.0 github.com/clambin/go-common/set v0.4.3 github.com/go-openapi/strfmt v0.23.0 github.com/gosimple/slug v1.15.0 - github.com/grafana/grafana-openapi-client-go v0.0.0-20241126111151-59d2d35e24eb + github.com/grafana/grafana-openapi-client-go v0.0.0-20250108132429-8d7e1f158f65 github.com/grafana/grafana-operator/v5 v5.15.1 github.com/spf13/cobra v1.8.1 github.com/spf13/viper v1.19.0 diff --git a/go.sum b/go.sum index 6484c01..917618e 100644 --- a/go.sum +++ b/go.sum @@ -66,8 +66,8 @@ github.com/gosimple/slug v1.15.0 h1:wRZHsRrRcs6b0XnxMUBM6WK1U1Vg5B0R7VkIf1Xzobo= github.com/gosimple/slug v1.15.0/go.mod h1:UiRaFH+GEilHstLUmcBgWcI42viBN7mAb818JrYOeFQ= github.com/gosimple/unidecode v1.0.1 h1:hZzFTMMqSswvf0LBJZCZgThIZrpDHFXux9KeGmn6T/o= github.com/gosimple/unidecode v1.0.1/go.mod h1:CP0Cr1Y1kogOtx0bJblKzsVWrqYaqfNOnHzpgWw4Awc= -github.com/grafana/grafana-openapi-client-go v0.0.0-20241126111151-59d2d35e24eb h1:fdtb12RMGDBdQwUuWw9SnBWO2kANZGlfh++tIVBYjbU= -github.com/grafana/grafana-openapi-client-go v0.0.0-20241126111151-59d2d35e24eb/go.mod h1:hiZnMmXc9KXNUlvkV2BKFsiWuIFF/fF4wGgYWEjBitI= +github.com/grafana/grafana-openapi-client-go v0.0.0-20250108132429-8d7e1f158f65 h1:AnfwjPE8TXJO8CX0Q5PvtzGta9Ls3iRASWVV4jHl4KA= +github.com/grafana/grafana-openapi-client-go v0.0.0-20250108132429-8d7e1f158f65/go.mod h1:hiZnMmXc9KXNUlvkV2BKFsiWuIFF/fF4wGgYWEjBitI= github.com/grafana/grafana-operator/v5 v5.15.1 h1:5oRVXO1rsJNwekUHJaX9UvgW44bii0Pzc1snfpIof3Y= github.com/grafana/grafana-operator/v5 v5.15.1/go.mod h1:C8o2wwaoZXvjnKag5fqBOToooR6NtvAEb9hFx8aJdMI= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= diff --git a/grope.go b/grope.go index 0503701..aaa373f 100644 --- a/grope.go +++ b/grope.go @@ -2,13 +2,13 @@ package main import ( "github.com/clambin/go-common/charmer" - "github.com/clambin/grope/internal" + "github.com/clambin/grope/internal/grope" "os" ) func main() { - if err := internal.RootCmd.Execute(); err != nil { - charmer.GetLogger(&internal.RootCmd).Error("failed to run", "err", err) + if err := grope.RootCmd.Execute(); err != nil { + charmer.GetLogger(&grope.RootCmd).Error("failed to run", "err", err) os.Exit(1) } } diff --git a/internal/cli.go b/internal/grope/cli.go similarity index 96% rename from internal/cli.go rename to internal/grope/cli.go index 9f1c2ed..38c048c 100644 --- a/internal/cli.go +++ b/internal/grope/cli.go @@ -1,4 +1,4 @@ -package internal +package grope import ( "fmt" @@ -50,6 +50,7 @@ func init() { var args = charmer.Arguments{ "debug": {Default: false, Help: "Log debug messages"}, "namespace": {Default: "default", Help: "Namespace for k8s config maps"}, + "tag": {Default: "", Help: "Dashboard tag (optional)"}, "grafana.url": {Default: "http://localhost:3000", Help: "Grafana URL"}, "grafana.token": {Default: "", Help: "Grafana API token (must have admin rights)"}, "grafana.operator.label.name": {Default: "dashboards", Help: "label used to select the grafana instance (grafana-operator only)"}, diff --git a/internal/cli_test.go b/internal/grope/cli_test.go similarity index 98% rename from internal/cli_test.go rename to internal/grope/cli_test.go index eff3450..a5dc42d 100644 --- a/internal/cli_test.go +++ b/internal/grope/cli_test.go @@ -1,4 +1,4 @@ -package internal +package grope import ( "github.com/spf13/viper" diff --git a/internal/exporter.go b/internal/grope/exporter.go similarity index 74% rename from internal/exporter.go rename to internal/grope/exporter.go index 1b85507..2cd867c 100644 --- a/internal/exporter.go +++ b/internal/grope/exporter.go @@ -1,7 +1,8 @@ -package internal +package grope import ( "cmp" + "errors" "fmt" "github.com/go-openapi/strfmt" goapi "github.com/grafana/grafana-openapi-client-go/client" @@ -15,6 +16,7 @@ type exporter struct { logger *slog.Logger client *grafanaClient formatter formatter + tag string folders bool } @@ -31,6 +33,7 @@ func makeExporter(v *viper.Viper, l *slog.Logger) (*exporter, error) { return &exporter{ logger: l, client: client, + tag: v.GetString("tag"), formatter: formatter{ namespace: cmp.Or(v.GetString("namespace"), "default"), grafanaLabelName: cmp.Or(v.GetString("grafana.operator.label.name"), "dashboards"), @@ -71,6 +74,11 @@ func (e exporter) exportDashboards(w io.Writer, args ...string) error { if err != nil { return fmt.Errorf("error fetching dashboard: %w", err) } + if e.tag != "" { + if err = tagDashboard(dashboard, e.tag); err != nil { + return fmt.Errorf("error tagging dashboard: %w", err) + } + } if err = e.formatter.formatDashboard(w, dashboard); err != nil { return fmt.Errorf("error formating dashboard %q: %w", dashboard.Title, err) } @@ -85,3 +93,26 @@ func (e exporter) exportDataSources(w io.Writer) error { } return err } + +func tagDashboard(db Dashboard, tag string) error { + jsonModel, ok := db.Model.(map[string]any) + if !ok { + return fmt.Errorf("unexpected model type: %T; expected map[string]any", db.Model) + } + tagsAny, ok := jsonModel["tags"] + if !ok { + return errors.New("dashboard does not contain tags") + } + tags, ok := tagsAny.([]any) + if !ok { + return fmt.Errorf("unexpected tags type: %T; expected []any", tagsAny) + } + for _, t := range tags { + if t.(string) == tag { + return nil + } + } + tags = append(tags, tag) + jsonModel["tags"] = tags + return nil +} diff --git a/internal/exporter_test.go b/internal/grope/exporter_test.go similarity index 78% rename from internal/exporter_test.go rename to internal/grope/exporter_test.go index 6656328..d209436 100644 --- a/internal/exporter_test.go +++ b/internal/grope/exporter_test.go @@ -1,4 +1,4 @@ -package internal +package grope import ( "bytes" @@ -37,6 +37,16 @@ func TestExportDashboards(t *testing.T) { }, wantErr: assert.NoError, }, + { + name: "tagged", + config: func() *viper.Viper { + v := viper.New() + v.Set("grafana.url", "http://grafana") + v.Set("tag", "grope") + return v + }, + wantErr: assert.NoError, + }, { name: "filtered by name", config: func() *viper.Viper { @@ -117,8 +127,8 @@ func TestExportDashboards(t *testing.T) { } exp.client.dashboardClient.dashboardFetcher = fakeDashboardFetcher{ dashboards: map[string]any{ - "1": map[string]string{"foo": "bar"}, - "2": map[string]string{"foo": "bar"}, + "1": map[string]any{"foo": "bar", "tags": []any{}}, + "2": map[string]any{"foo": "bar", "tags": []any{}}, }, } @@ -234,3 +244,60 @@ func (f fakeDataSourceFetcher) GetDataSources(_ ...datasources.ClientOption) (*d ok.Payload = f.dataSources return ok, nil } + +func Test_tagDashboard(t *testing.T) { + tests := []struct { + name string + db Dashboard + wantErr assert.ErrorAssertionFunc + }{ + { + name: "valid: no tags", + db: Dashboard{Model: map[string]any{ + "tags": []any{}, + }}, + wantErr: assert.NoError, + }, + { + name: "valid: tags", + db: Dashboard{Model: map[string]any{ + "tags": []any{"foo", "bar"}, + }}, + wantErr: assert.NoError, + }, + { + name: "valid: grope tag already exists", + db: Dashboard{Model: map[string]any{ + "tags": []any{"foo", "bar", "grope"}, + }}, + wantErr: assert.NoError, + }, + { + name: "invalid: tags not present", + db: Dashboard{Model: map[string]any{}}, + wantErr: assert.Error, + }, + { + name: "invalid: tags invalid type", + db: Dashboard{Model: map[string]any{ + "tags": "foo", + }}, + wantErr: assert.Error, + }, + { + name: "invalid: model invalid type", + db: Dashboard{Model: "124"}, + wantErr: assert.Error, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + err := tagDashboard(tt.db, "grope") + tt.wantErr(t, err) + + if err == nil { + assert.Contains(t, tt.db.Model.(map[string]any)["tags"], "grope") + } + }) + } +} diff --git a/internal/fetcher.go b/internal/grope/fetcher.go similarity index 99% rename from internal/fetcher.go rename to internal/grope/fetcher.go index 6e6e295..d0eff54 100644 --- a/internal/fetcher.go +++ b/internal/grope/fetcher.go @@ -1,4 +1,4 @@ -package internal +package grope import ( "fmt" @@ -34,9 +34,9 @@ type dataSourceFetcher interface { type Dashboards []Dashboard type Dashboard struct { + Model models.JSON Folder string Title string - Model models.JSON } func yieldDashboards(c dashboardClient, folders bool, args ...string) iter.Seq2[Dashboard, error] { diff --git a/internal/fetcher_test.go b/internal/grope/fetcher_test.go similarity index 99% rename from internal/fetcher_test.go rename to internal/grope/fetcher_test.go index 4eac8a7..91e7ac1 100644 --- a/internal/fetcher_test.go +++ b/internal/grope/fetcher_test.go @@ -1,4 +1,4 @@ -package internal +package grope import ( "errors" diff --git a/internal/formatter.go b/internal/grope/formatter.go similarity index 94% rename from internal/formatter.go rename to internal/grope/formatter.go index b5007b6..c4cc5d6 100644 --- a/internal/formatter.go +++ b/internal/grope/formatter.go @@ -1,4 +1,4 @@ -package internal +package grope import ( "bytes" @@ -6,7 +6,7 @@ import ( "fmt" "github.com/gosimple/slug" "github.com/grafana/grafana-openapi-client-go/models" - grafanav1beta1 "github.com/grafana/grafana-operator/v5/api/v1beta1" + "github.com/grafana/grafana-operator/v5/api/v1beta1" "gopkg.in/yaml.v3" "io" "iter" @@ -52,7 +52,7 @@ func (f formatter) formatDashboard(w io.Writer, dashboard Dashboard) error { } dashboardCR := grafanaOperatorCustomResource{ - APIVersion: grafanav1beta1.GroupVersion.String(), + APIVersion: v1beta1.GroupVersion.String(), Kind: "GrafanaDashboard", Metadata: metadata{ Name: slug.Make(dashboard.Title), @@ -91,7 +91,7 @@ func (f formatter) grafanaOperatorCustomResources(dataSources []*models.DataSour return func(yield func(grafanaOperatorCustomResource) bool) { for _, dataSource := range dataSources { cr := grafanaOperatorCustomResource{ - APIVersion: grafanav1beta1.GroupVersion.String(), + APIVersion: v1beta1.GroupVersion.String(), Kind: "GrafanaDataSource", Metadata: metadata{ Name: "datasource-" + slug.Make(dataSource.Name), diff --git a/internal/testdata/testexportdashboards-filtered_by_folder.yaml b/internal/grope/testdata/testexportdashboards-filtered_by_folder.yaml similarity index 87% rename from internal/testdata/testexportdashboards-filtered_by_folder.yaml rename to internal/grope/testdata/testexportdashboards-filtered_by_folder.yaml index 820bcc3..77e345b 100644 --- a/internal/testdata/testexportdashboards-filtered_by_folder.yaml +++ b/internal/grope/testdata/testexportdashboards-filtered_by_folder.yaml @@ -12,5 +12,6 @@ spec: dashboards: grafana json: | { - "foo": "bar" + "foo": "bar", + "tags": [] } diff --git a/internal/testdata/testexportdashboards-filtered_by_name.yaml b/internal/grope/testdata/testexportdashboards-filtered_by_name.yaml similarity index 87% rename from internal/testdata/testexportdashboards-filtered_by_name.yaml rename to internal/grope/testdata/testexportdashboards-filtered_by_name.yaml index 820bcc3..77e345b 100644 --- a/internal/testdata/testexportdashboards-filtered_by_name.yaml +++ b/internal/grope/testdata/testexportdashboards-filtered_by_name.yaml @@ -12,5 +12,6 @@ spec: dashboards: grafana json: | { - "foo": "bar" + "foo": "bar", + "tags": [] } diff --git a/internal/testdata/testexportdashboards-override.yaml b/internal/grope/testdata/testexportdashboards-override.yaml similarity index 87% rename from internal/testdata/testexportdashboards-override.yaml rename to internal/grope/testdata/testexportdashboards-override.yaml index 3086020..2e0bb4d 100644 --- a/internal/testdata/testexportdashboards-override.yaml +++ b/internal/grope/testdata/testexportdashboards-override.yaml @@ -12,7 +12,8 @@ spec: dashboards: local-grafana json: | { - "foo": "bar" + "foo": "bar", + "tags": [] } --- apiVersion: grafana.integreatly.org/v1beta1 @@ -28,5 +29,6 @@ spec: dashboards: local-grafana json: | { - "foo": "bar" + "foo": "bar", + "tags": [] } diff --git a/internal/testdata/testexportdashboards-paged.yaml b/internal/grope/testdata/testexportdashboards-paged.yaml similarity index 87% rename from internal/testdata/testexportdashboards-paged.yaml rename to internal/grope/testdata/testexportdashboards-paged.yaml index ce85dc9..d1fe6d3 100644 --- a/internal/testdata/testexportdashboards-paged.yaml +++ b/internal/grope/testdata/testexportdashboards-paged.yaml @@ -12,7 +12,8 @@ spec: dashboards: grafana json: | { - "foo": "bar" + "foo": "bar", + "tags": [] } --- apiVersion: grafana.integreatly.org/v1beta1 @@ -28,5 +29,6 @@ spec: dashboards: grafana json: | { - "foo": "bar" + "foo": "bar", + "tags": [] } diff --git a/internal/grope/testdata/testexportdashboards-tagged.yaml b/internal/grope/testdata/testexportdashboards-tagged.yaml new file mode 100644 index 0000000..267c568 --- /dev/null +++ b/internal/grope/testdata/testexportdashboards-tagged.yaml @@ -0,0 +1,38 @@ +--- +apiVersion: grafana.integreatly.org/v1beta1 +kind: GrafanaDashboard +metadata: + name: db-1 + namespace: default +spec: + allowCrossNamespaceImport: true + folder: folder 1 + instanceSelector: + matchLabels: + dashboards: grafana + json: | + { + "foo": "bar", + "tags": [ + "grope" + ] + } +--- +apiVersion: grafana.integreatly.org/v1beta1 +kind: GrafanaDashboard +metadata: + name: db-2 + namespace: default +spec: + allowCrossNamespaceImport: true + folder: folder 2 + instanceSelector: + matchLabels: + dashboards: grafana + json: | + { + "foo": "bar", + "tags": [ + "grope" + ] + } diff --git a/internal/testdata/testexportdashboards-unfiltered.yaml b/internal/grope/testdata/testexportdashboards-unfiltered.yaml similarity index 87% rename from internal/testdata/testexportdashboards-unfiltered.yaml rename to internal/grope/testdata/testexportdashboards-unfiltered.yaml index ce85dc9..d1fe6d3 100644 --- a/internal/testdata/testexportdashboards-unfiltered.yaml +++ b/internal/grope/testdata/testexportdashboards-unfiltered.yaml @@ -12,7 +12,8 @@ spec: dashboards: grafana json: | { - "foo": "bar" + "foo": "bar", + "tags": [] } --- apiVersion: grafana.integreatly.org/v1beta1 @@ -28,5 +29,6 @@ spec: dashboards: grafana json: | { - "foo": "bar" + "foo": "bar", + "tags": [] } diff --git a/internal/testdata/testexportdatasources.yaml b/internal/grope/testdata/testexportdatasources.yaml similarity index 100% rename from internal/testdata/testexportdatasources.yaml rename to internal/grope/testdata/testexportdatasources.yaml diff --git a/test.yaml b/test.yaml deleted file mode 100644 index 58c0560..0000000 --- a/test.yaml +++ /dev/null @@ -1,4636 +0,0 @@ ---- -apiVersion: grafana.integreatly.org/v1beta1 -kind: GrafanaDashboard -metadata: - name: circuit-breakers - namespace: development -spec: - allowCrossNamespaceImport: true - folder: "Media Apps" - instanceSelector: - matchLabels: - dashboards: local-grafana - json: | - { - "annotations": { - "list": [ - { - "builtIn": 1, - "datasource": { - "type": "grafana", - "uid": "-- Grafana --" - }, - "enable": true, - "hide": true, - "iconColor": "rgba(0, 211, 255, 1)", - "name": "Annotations \u0026 Alerts", - "type": "dashboard" - } - ] - }, - "editable": true, - "fiscalYearStartMonth": 0, - "graphTooltip": 0, - "id": 5891, - "links": [], - "panels": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 0 - }, - "id": 1, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "disableTextWrap": false, - "editorMode": "code", - "expr": "circuit_breaker_state", - "fullMetaSearch": false, - "includeNullMetadata": true, - "instant": false, - "legendFormat": "{{circuit_breaker}}", - "range": true, - "refId": "A", - "useBackend": false - } - ], - "title": "State", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 0 - }, - "id": 2, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "disableTextWrap": false, - "editorMode": "code", - "expr": "sum by (circuit_breaker) (delta(circuit_breaker_consecutive_successes[$__rate_interval]))", - "fullMetaSearch": false, - "includeNullMetadata": true, - "instant": false, - "legendFormat": "{{circuit_breaker}}", - "range": true, - "refId": "A", - "useBackend": false - } - ], - "title": "Consecutive successes (delta)", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ - { - "__systemRef": "hideSeriesFrom", - "matcher": { - "id": "byNames", - "options": { - "mode": "exclude", - "names": [ - "transmission" - ], - "prefix": "All except:", - "readOnly": true - } - }, - "properties": [ - { - "id": "custom.hideFrom", - "value": { - "legend": false, - "tooltip": false, - "viz": true - } - } - ] - } - ] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 8 - }, - "id": 3, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "disableTextWrap": false, - "editorMode": "code", - "expr": "sum by (circuit_breaker) (circuit_breaker_consecutive_errors)", - "fullMetaSearch": false, - "includeNullMetadata": true, - "instant": false, - "legendFormat": "{{circuit_breaker}}", - "range": true, - "refId": "A", - "useBackend": false - } - ], - "title": "Consecutive errors", - "type": "timeseries" - } - ], - "refresh": "30s", - "schemaVersion": 39, - "tags": [], - "templating": { - "list": [] - }, - "time": { - "from": "now-30m", - "to": "now" - }, - "timepicker": {}, - "timezone": "browser", - "title": "circuit breakers", - "uid": "edmojkptntm2oc", - "version": 2, - "weekStart": "" - } ---- -apiVersion: grafana.integreatly.org/v1beta1 -kind: GrafanaDashboard -metadata: - name: media-server - namespace: development -spec: - allowCrossNamespaceImport: true - folder: "Media Apps" - instanceSelector: - matchLabels: - dashboards: local-grafana - json: | - { - "annotations": { - "list": [ - { - "builtIn": 1, - "datasource": { - "type": "datasource", - "uid": "grafana" - }, - "enable": true, - "hide": true, - "iconColor": "rgba(0, 211, 255, 1)", - "name": "Annotations \u0026 Alerts", - "target": { - "limit": 100, - "matchAny": false, - "tags": [], - "type": "dashboard" - }, - "type": "dashboard" - } - ] - }, - "editable": true, - "fiscalYearStartMonth": 0, - "graphTooltip": 0, - "id": 5889, - "links": [], - "liveNow": false, - "panels": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 0 - }, - "id": 35, - "title": "OpenVPN", - "type": "row" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "description": "", - "fieldConfig": { - "defaults": { - "decimals": 1, - "mappings": [], - "max": 1, - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "red", - "value": null - }, - { - "color": "#EAB839", - "value": 0.9 - }, - { - "color": "dark-green", - "value": 0.99 - } - ] - }, - "unit": "percentunit" - }, - "overrides": [] - }, - "gridPos": { - "h": 5, - "w": 3, - "x": 0, - "y": 1 - }, - "id": 39, - "options": { - "minVizHeight": 200, - "minVizWidth": 200, - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "mean" - ], - "fields": "", - "values": false - }, - "showThresholdLabels": false, - "showThresholdMarkers": true, - "sizing": "auto", - "text": {} - }, - "pluginVersion": "10.4.1", - "targets": [ - { - "expr": "sum(openvpn_client_status)", - "interval": "", - "legendFormat": "On", - "refId": "A" - } - ], - "title": "VPN Uptime", - "type": "gauge" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "never", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "Bps" - }, - "overrides": [] - }, - "gridPos": { - "h": 5, - "w": 8, - "x": 3, - "y": 1 - }, - "id": 37, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "pluginVersion": "8.0.6", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "exemplar": true, - "expr": "avg(rate(openvpn_client_tcp_udp_read_bytes_total[$__rate_interval]))", - "interval": "", - "legendFormat": "In", - "refId": "B" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "exemplar": true, - "expr": "-avg(rate(openvpn_client_tcp_udp_write_bytes_total[$__rate_interval]))", - "interval": "", - "legendFormat": "Out", - "refId": "A" - } - ], - "title": "Network usage", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "hidden", - "barAlignment": 0, - "drawStyle": "bars", - "fillOpacity": 100, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "never", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "Off" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "semi-dark-red", - "mode": "fixed" - } - } - ] - }, - { - "matcher": { - "id": "byType", - "options": "time" - }, - "properties": [ - { - "id": "custom.axisPlacement", - "value": "auto" - } - ] - } - ] - }, - "gridPos": { - "h": 5, - "w": 9, - "x": 11, - "y": 1 - }, - "id": 41, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": false - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "pluginVersion": "8.0.6", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "exemplar": true, - "expr": "avg(openvpn_client_status)", - "hide": false, - "interval": "", - "legendFormat": "On", - "refId": "A" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "exemplar": true, - "expr": "1-avg(openvpn_client_status)", - "hide": false, - "interval": "", - "legendFormat": "Off", - "refId": "B" - } - ], - "title": "VPN Status", - "type": "timeseries" - }, - { - "datasource": { - "type": "loki", - "uid": "JrYhCWHnk" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "bars", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 5, - "w": 4, - "x": 20, - "y": 1 - }, - "id": 63, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": false - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "pluginVersion": "10.2.3", - "targets": [ - { - "datasource": { - "type": "loki", - "uid": "JrYhCWHnk" - }, - "editorMode": "builder", - "expr": "sum(count_over_time({app=\"restarter\"} | json | level = `INFO` | msg = `pod deleted` | name =~ `^transmission.*` [$__auto]))", - "queryType": "range", - "refId": "A" - } - ], - "title": "Restarts", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 6 - }, - "id": 33, - "title": "Transmission", - "type": "row" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 5, - "w": 3, - "x": 0, - "y": 7 - }, - "id": 27, - "options": { - "colorMode": "value", - "graphMode": "none", - "justifyMode": "auto", - "orientation": "vertical", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "/^version$/", - "values": false - }, - "showPercentChange": false, - "text": {}, - "textMode": "auto", - "wideLayout": true - }, - "pluginVersion": "10.4.1", - "targets": [ - { - "exemplar": true, - "expr": "mediamon_transmission_version{version=~\"[0-9]+.[0-9]+.*\"}", - "format": "table", - "interval": "", - "legendFormat": "", - "refId": "A" - } - ], - "title": "Transmission version", - "type": "stat" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "never", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "Bps" - }, - "overrides": [] - }, - "gridPos": { - "h": 5, - "w": 9, - "x": 3, - "y": 7 - }, - "id": 12, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "pluginVersion": "8.0.6", - "targets": [ - { - "exemplar": true, - "expr": "sum(mediamon_transmission_download_speed)", - "interval": "", - "legendFormat": "Download", - "refId": "A" - }, - { - "exemplar": true, - "expr": "-sum(mediamon_transmission_upload_speed)", - "interval": "", - "legendFormat": "Upload", - "refId": "B" - } - ], - "title": "Network usage", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "never", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "normal" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "decimals": 0, - "mappings": [], - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "short" - }, - "overrides": [] - }, - "gridPos": { - "h": 5, - "w": 6, - "x": 12, - "y": 7 - }, - "id": 10, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "pluginVersion": "8.0.6", - "targets": [ - { - "exemplar": true, - "expr": "sum(mediamon_transmission_active_torrent_count)", - "interval": "", - "legendFormat": "Active", - "refId": "B" - }, - { - "exemplar": true, - "expr": "sum(mediamon_transmission_paused_torrent_count)", - "interval": "", - "legendFormat": "Paused", - "refId": "C" - } - ], - "title": "Torrents", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "max": 1, - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "#EAB839", - "value": 0.85 - }, - { - "color": "red", - "value": 0.95 - } - ] - }, - "unit": "percentunit" - }, - "overrides": [] - }, - "gridPos": { - "h": 5, - "w": 3, - "x": 18, - "y": 7 - }, - "id": 54, - "options": { - "minVizHeight": 200, - "minVizWidth": 200, - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showThresholdLabels": false, - "showThresholdMarkers": true, - "sizing": "auto" - }, - "pluginVersion": "10.4.1", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "1 - (node_filesystem_avail_bytes{node=\"nuc1\",mountpoint=\"/mnt/data\"} / node_filesystem_size_bytes)", - "legendFormat": "__auto", - "range": true, - "refId": "A" - } - ], - "title": "temp disk space", - "type": "gauge" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "max": 1, - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "#EAB839", - "value": 0.85 - }, - { - "color": "red", - "value": 0.95 - } - ] - }, - "unit": "percentunit" - }, - "overrides": [] - }, - "gridPos": { - "h": 5, - "w": 3, - "x": 21, - "y": 7 - }, - "id": 55, - "options": { - "minVizHeight": 200, - "minVizWidth": 200, - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showThresholdLabels": false, - "showThresholdMarkers": true, - "sizing": "auto" - }, - "pluginVersion": "10.4.1", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "1 - (node_filesystem_avail_bytes{node=\"nuc1\",mountpoint=\"/mnt/media\"} / node_filesystem_size_bytes)", - "legendFormat": "__auto", - "range": true, - "refId": "A" - } - ], - "title": "media disk space", - "type": "gauge" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 12 - }, - "id": 31, - "title": "Sonarr / Radarr", - "type": "row" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 2, - "w": 3, - "x": 0, - "y": 13 - }, - "id": 16, - "options": { - "colorMode": "value", - "graphMode": "none", - "justifyMode": "auto", - "orientation": "vertical", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "/^version$/", - "limit": 1, - "values": false - }, - "showPercentChange": false, - "text": {}, - "textMode": "auto", - "wideLayout": true - }, - "pluginVersion": "10.4.1", - "targets": [ - { - "exemplar": true, - "expr": "mediamon_xxxarr_version{application=\"sonarr\"}", - "format": "table", - "interval": "", - "legendFormat": "", - "refId": "A" - } - ], - "title": "Sonarr version", - "type": "stat" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "custom": { - "align": "auto", - "cellOptions": { - "type": "auto" - }, - "inspect": false - }, - "mappings": [], - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "short" - }, - "overrides": [] - }, - "gridPos": { - "h": 5, - "w": 12, - "x": 3, - "y": 13 - }, - "id": 6, - "options": { - "cellHeight": "sm", - "footer": { - "countRows": false, - "fields": "", - "reducer": [ - "sum" - ], - "show": false - }, - "showHeader": true - }, - "pluginVersion": "10.4.1", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "exemplar": false, - "expr": "mediamon_xxxarr_calendar", - "format": "table", - "instant": true, - "interval": "", - "legendFormat": "__auto", - "range": false, - "refId": "A" - } - ], - "title": "On Calendar", - "transformations": [ - { - "id": "organize", - "options": { - "excludeByName": { - "Time": true, - "Value": true, - "__name__": true, - "app": true, - "instance": true, - "job": true, - "namespace": true, - "node": true, - "pod": true, - "pod_template_hash": true, - "url": true - }, - "indexByName": { - "Time": 1, - "Value": 11, - "__name__": 2, - "app": 3, - "application": 4, - "instance": 5, - "job": 6, - "namespace": 7, - "pod": 8, - "pod_template_hash": 9, - "title": 0, - "url": 10 - }, - "renameByName": {} - } - } - ], - "type": "table" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - } - }, - "mappings": [], - "min": 0 - }, - "overrides": [] - }, - "gridPos": { - "h": 13, - "w": 9, - "x": 15, - "y": 13 - }, - "id": 56, - "options": { - "displayLabels": [ - "name" - ], - "legend": { - "displayMode": "table", - "placement": "right", - "showLegend": true, - "values": [ - "value" - ] - }, - "pieType": "donut", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "pluginVersion": "9.5.1", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "exemplar": true, - "expr": "sum by (application) (mediamon_xxxarr_unmonitored_count)", - "interval": "", - "legendFormat": "{{application}} - unmonitored", - "range": true, - "refId": "A" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "sum by (application) (mediamon_xxxarr_monitored_count)", - "hide": false, - "legendFormat": "{{application}} - monitored", - "range": true, - "refId": "B" - } - ], - "title": "Media", - "type": "piechart" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 2, - "w": 3, - "x": 0, - "y": 15 - }, - "id": 17, - "options": { - "colorMode": "value", - "graphMode": "none", - "justifyMode": "auto", - "orientation": "vertical", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "/^version$/", - "values": false - }, - "showPercentChange": false, - "text": {}, - "textMode": "auto", - "wideLayout": true - }, - "pluginVersion": "10.4.1", - "targets": [ - { - "exemplar": true, - "expr": "mediamon_xxxarr_version{application=\"radarr\"}", - "format": "table", - "interval": "", - "legendFormat": "", - "refId": "A" - } - ], - "title": "Radarr version", - "type": "stat" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "custom": { - "align": "auto", - "cellOptions": { - "type": "auto" - }, - "inspect": false - }, - "decimals": 0, - "mappings": [], - "max": 1, - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "yellow", - "value": null - }, - { - "color": "green", - "value": 0.01 - }, - { - "color": "blue", - "value": 1 - } - ] - }, - "unit": "percentunit" - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "Value" - }, - "properties": [ - { - "id": "custom.cellOptions", - "value": { - "mode": "lcd", - "type": "gauge" - } - } - ] - } - ] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 3, - "y": 18 - }, - "id": 49, - "options": { - "cellHeight": "sm", - "footer": { - "countRows": false, - "fields": "", - "reducer": [ - "sum" - ], - "show": false - }, - "showHeader": true, - "sortBy": [ - { - "desc": true, - "displayName": "Value" - } - ] - }, - "pluginVersion": "10.4.1", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "exemplar": false, - "expr": "mediamon_xxxarr_queued_downloaded_bytes / mediamon_xxxarr_queued_total_bytes", - "format": "table", - "instant": true, - "interval": "", - "legendFormat": "{{server}}", - "range": false, - "refId": "A" - } - ], - "title": "Downloading", - "transformations": [ - { - "id": "organize", - "options": { - "excludeByName": { - "Time": true, - "app": true, - "instance": true, - "job": true, - "namespace": true, - "node": true, - "pod": true, - "pod_template_hash": true, - "url": true - }, - "indexByName": { - "Time": 1, - "Value": 10, - "app": 2, - "application": 3, - "instance": 4, - "job": 5, - "namespace": 6, - "pod": 7, - "pod_template_hash": 8, - "title": 0, - "url": 9 - }, - "renameByName": {} - } - } - ], - "type": "table" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 26 - }, - "id": 29, - "title": "Plex", - "type": "row" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 5, - "w": 3, - "x": 0, - "y": 27 - }, - "id": 18, - "options": { - "colorMode": "value", - "graphMode": "none", - "justifyMode": "center", - "orientation": "vertical", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "/^version$/", - "values": false - }, - "showPercentChange": false, - "text": {}, - "textMode": "auto", - "wideLayout": true - }, - "pluginVersion": "10.4.1", - "targets": [ - { - "exemplar": true, - "expr": "mediamon_plex_version", - "format": "table", - "interval": "", - "legendFormat": "", - "refId": "A" - } - ], - "title": "Plex version", - "type": "stat" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "custom": { - "align": "auto", - "cellOptions": { - "type": "auto" - }, - "inspect": false - }, - "mappings": [], - "max": 1, - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "yellow", - "value": null - }, - { - "color": "green", - "value": 0.01 - }, - { - "color": "blue", - "value": 0.95 - } - ] - }, - "unit": "percentunit" - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "progress" - }, - "properties": [ - { - "id": "custom.cellOptions", - "value": { - "mode": "lcd", - "type": "gauge" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "title" - }, - "properties": [ - { - "id": "custom.width", - "value": 389 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "user" - }, - "properties": [ - { - "id": "custom.width", - "value": 116 - } - ] - } - ] - }, - "gridPos": { - "h": 5, - "w": 21, - "x": 3, - "y": 27 - }, - "id": 20, - "options": { - "cellHeight": "sm", - "footer": { - "countRows": false, - "fields": "", - "reducer": [ - "sum" - ], - "show": false - }, - "showHeader": true, - "sortBy": [] - }, - "pluginVersion": "10.4.1", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "exemplar": false, - "expr": "sum by (title, user, player, mode, videoCodec, location) (mediamon_plex_session_count{user=~\"^$user$\"})", - "format": "table", - "instant": true, - "interval": "", - "legendFormat": "__auto", - "range": false, - "refId": "A" - } - ], - "title": "Current sessions", - "transformations": [ - { - "id": "organize", - "options": { - "excludeByName": { - "Time": true, - "Value": false, - "__name__": true, - "address": true, - "app": true, - "id": true, - "instance": true, - "job": true, - "namespace": true, - "player": false, - "pod": true, - "pod_template_hash": true, - "url": true - }, - "indexByName": { - "Time": 2, - "Value": 7, - "location": 6, - "mode": 4, - "player": 3, - "title": 0, - "user": 1, - "videoCodec": 5 - }, - "renameByName": { - "Value": "progress" - } - } - } - ], - "type": "table" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "custom": { - "align": "auto", - "cellOptions": { - "type": "auto" - }, - "filterable": false, - "inspect": false - }, - "mappings": [], - "max": 1, - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "yellow", - "value": null - }, - { - "color": "green", - "value": 0.01 - }, - { - "color": "blue", - "value": 0.9 - } - ] - }, - "unit": "percentunit" - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "progress" - }, - "properties": [ - { - "id": "custom.cellOptions", - "value": { - "mode": "lcd", - "type": "gauge", - "valueDisplayMode": "text" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "title" - }, - "properties": [ - { - "id": "custom.width", - "value": 386 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "user" - }, - "properties": [ - { - "id": "custom.width", - "value": 102 - } - ] - } - ] - }, - "gridPos": { - "h": 8, - "w": 21, - "x": 3, - "y": 32 - }, - "id": 57, - "options": { - "cellHeight": "sm", - "footer": { - "countRows": false, - "fields": [], - "reducer": [ - "sum" - ], - "show": false - }, - "showHeader": true, - "sortBy": [ - { - "desc": false, - "displayName": "title" - } - ] - }, - "pluginVersion": "10.4.1", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "exemplar": false, - "expr": "max by (title, user, player, mode, videoCodec, location) (mediamon_plex_session_count{user=~\"^$user$\"})", - "format": "table", - "instant": false, - "interval": "", - "legendFormat": "__auto", - "range": true, - "refId": "A" - } - ], - "title": "All sessions w/in timeframe", - "transformations": [ - { - "id": "groupBy", - "options": { - "fields": { - "Value": { - "aggregations": [ - "lastNotNull" - ], - "operation": "aggregate" - }, - "location": { - "aggregations": [], - "operation": "groupby" - }, - "mode": { - "aggregations": [ - "last" - ], - "operation": "groupby" - }, - "player": { - "aggregations": [], - "operation": "groupby" - }, - "progress": { - "aggregations": [ - "lastNotNull" - ], - "operation": "aggregate" - }, - "title": { - "aggregations": [], - "operation": "groupby" - }, - "user": { - "aggregations": [], - "operation": "groupby" - }, - "videoCodec": { - "aggregations": [], - "operation": "groupby" - } - } - } - }, - { - "id": "organize", - "options": { - "excludeByName": { - "Time": true, - "Value": false, - "__name__": true, - "address": true, - "app": true, - "id": true, - "instance": true, - "job": true, - "namespace": true, - "player": false, - "pod": true, - "pod_template_hash": true, - "url": true - }, - "indexByName": { - "Value (lastNotNull)": 6, - "location": 5, - "mode": 3, - "player": 2, - "title": 0, - "user": 1, - "videoCodec": 4 - }, - "renameByName": { - "Value": "progress", - "Value (lastNotNull)": "progress", - "mode (lastNotNull)": "mode" - } - } - } - ], - "type": "table" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "bars", - "fillOpacity": 100, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "never", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "normal" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "short" - }, - "overrides": [] - }, - "gridPos": { - "h": 5, - "w": 12, - "x": 3, - "y": 40 - }, - "id": 46, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "pluginVersion": "8.0.6", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "exemplar": true, - "expr": "count by (user) (mediamon_plex_session_count{user=~\"^$user$\"})", - "interval": "", - "legendFormat": "{{location}}", - "range": true, - "refId": "A" - } - ], - "title": "Sessions by users", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "never", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "normal" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "none" - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "system" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "semi-dark-yellow", - "mode": "fixed" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "user" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "semi-dark-green", - "mode": "fixed" - } - } - ] - } - ] - }, - "gridPos": { - "h": 5, - "w": 9, - "x": 15, - "y": 40 - }, - "id": 26, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": false - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "pluginVersion": "8.0.6", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "exemplar": true, - "expr": "sum(rate(container_cpu_user_seconds_total{container=\"plex\"}[$__rate_interval]))", - "interval": "", - "legendFormat": "system", - "refId": "A" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "exemplar": true, - "expr": "sum(rate(container_cpu_system_seconds_total{container=\"plex\"}[$__rate_interval]))", - "hide": false, - "interval": "", - "legendFormat": "user", - "refId": "B" - } - ], - "title": "CPU usage", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "bars", - "fillOpacity": 100, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "never", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "normal" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "Kbits" - }, - "overrides": [] - }, - "gridPos": { - "h": 5, - "w": 12, - "x": 3, - "y": 45 - }, - "id": 60, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "pluginVersion": "8.0.6", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "exemplar": true, - "expr": "sum by (user) (mediamon_plex_session_bandwidth{user=~\"^$user$\"})", - "interval": "", - "legendFormat": "{{location}}", - "range": true, - "refId": "A" - } - ], - "title": "Bandwidth", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "never", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "Bps" - }, - "overrides": [] - }, - "gridPos": { - "h": 5, - "w": 9, - "x": 15, - "y": 45 - }, - "id": 22, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "pluginVersion": "8.0.6", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "exemplar": true, - "expr": "sum(rate(container_network_transmit_bytes_total{pod=~\"plex-.*\"}[$__rate_interval]))", - "interval": "", - "legendFormat": "Transmit", - "refId": "A" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "exemplar": true, - "expr": "-sum(rate(container_network_receive_bytes_total{pod=~\"plex-.*\"}[$__rate_interval]))", - "interval": "", - "legendFormat": "Receive", - "refId": "B" - } - ], - "title": "Network usage", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "bars", - "fillOpacity": 100, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "never", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "normal" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "short" - }, - "overrides": [ - { - "__systemRef": "hideSeriesFrom", - "matcher": { - "id": "byNames", - "options": { - "mode": "exclude", - "names": [ - "Value" - ], - "prefix": "All except:", - "readOnly": true - } - }, - "properties": [ - { - "id": "custom.hideFrom", - "value": { - "legend": false, - "tooltip": false, - "viz": true - } - } - ] - } - ] - }, - "gridPos": { - "h": 5, - "w": 12, - "x": 3, - "y": 50 - }, - "id": 50, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "pluginVersion": "8.0.6", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "exemplar": true, - "expr": "count by (location) (mediamon_plex_session_count)", - "interval": "", - "legendFormat": "{{location}}", - "range": true, - "refId": "A" - } - ], - "title": "Sessions by location", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "custom": { - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 17, - "w": 9, - "x": 15, - "y": 50 - }, - "id": 48, - "options": { - "basemap": { - "config": {}, - "name": "Layer 0", - "type": "default" - }, - "controls": { - "mouseWheelZoom": true, - "showAttribution": true, - "showDebug": false, - "showMeasure": false, - "showScale": false, - "showZoom": true - }, - "layers": [ - { - "config": { - "showLegend": true, - "style": { - "color": { - "fixed": "dark-green" - }, - "opacity": 0.1, - "rotation": { - "fixed": 0, - "max": 360, - "min": -360, - "mode": "mod" - }, - "size": { - "fixed": 1, - "max": 15, - "min": 4 - }, - "symbol": { - "fixed": "img/icons/marker/circle.svg", - "mode": "fixed" - }, - "text": { - "field": "user", - "fixed": "", - "mode": "field" - }, - "textConfig": { - "fontSize": 12, - "offsetX": 0, - "offsetY": 0, - "textAlign": "center", - "textBaseline": "middle" - } - } - }, - "location": { - "mode": "auto" - }, - "name": "Layer 1", - "tooltip": true, - "type": "markers" - } - ], - "tooltip": { - "mode": "details" - }, - "view": { - "allLayers": true, - "id": "coords", - "lat": 50.943578, - "lon": 3.570205, - "zoom": 8.83 - } - }, - "pluginVersion": "10.4.1", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "exemplar": false, - "expr": "sum by (user, lon, lat) (mediamon_plex_session_count{location!=\"lan\",user=~\"^$user$\"})", - "format": "table", - "instant": false, - "range": true, - "refId": "A" - } - ], - "title": "Remote Users", - "type": "geomap" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "bars", - "fillOpacity": 10, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "never", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "short" - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "Speed" - }, - "properties": [ - { - "id": "custom.axisPlacement", - "value": "right" - }, - { - "id": "custom.drawStyle", - "value": "line" - }, - { - "id": "custom.lineWidth", - "value": 2 - } - ] - } - ] - }, - "gridPos": { - "h": 4, - "w": 12, - "x": 3, - "y": 55 - }, - "id": 24, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "pluginVersion": "8.0.6", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "exemplar": true, - "expr": "sum by (state) (mediamon_plex_transcoder_count)", - "interval": "", - "legendFormat": "{{state}}", - "range": true, - "refId": "C" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "exemplar": true, - "expr": "sum(mediamon_plex_transcoder_speed)", - "interval": "", - "legendFormat": "Speed", - "refId": "A" - } - ], - "title": "Plex transcoders", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - } - }, - "mappings": [], - "unit": "bytes" - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 6, - "x": 3, - "y": 59 - }, - "id": 58, - "options": { - "legend": { - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "pieType": "pie", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "sum by (url, library) (mediamon_plex_library_bytes)", - "instant": false, - "legendFormat": "{{library}}", - "range": true, - "refId": "A" - } - ], - "title": "Library Sizes (bytes)", - "type": "piechart" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - } - }, - "mappings": [], - "unit": "short" - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 6, - "x": 9, - "y": 59 - }, - "id": 59, - "options": { - "legend": { - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "pieType": "pie", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "sum by (url, library) (mediamon_plex_library_count)", - "instant": false, - "legendFormat": "{{library}}", - "range": true, - "refId": "A" - } - ], - "title": "Library Sizes (count)", - "type": "piechart" - } - ], - "refresh": "30s", - "revision": 1, - "schemaVersion": 39, - "tags": [], - "templating": { - "list": [ - { - "current": { - "selected": false, - "text": "eva", - "value": "eva" - }, - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "definition": "label_values(mediamon_plex_session_count,user)", - "hide": 0, - "includeAll": true, - "multi": false, - "name": "user", - "options": [], - "query": { - "qryType": 1, - "query": "label_values(mediamon_plex_session_count,user)", - "refId": "PrometheusVariableQueryEditor-VariableQuery" - }, - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "sort": 0, - "type": "query" - } - ] - }, - "time": { - "from": "now-24h", - "to": "now" - }, - "timepicker": { - "refresh_intervals": [ - "5s", - "10s", - "30s", - "1m", - "5m", - "15m", - "30m", - "1h", - "2h", - "1d" - ] - }, - "timezone": "", - "title": "Media Server", - "uid": "8C0N81WRl", - "version": 2, - "weekStart": "" - } ---- -apiVersion: grafana.integreatly.org/v1beta1 -kind: GrafanaDashboard -metadata: - name: mediamon-internal - namespace: development -spec: - allowCrossNamespaceImport: true - folder: "Media Apps" - instanceSelector: - matchLabels: - dashboards: local-grafana - json: | - { - "annotations": { - "list": [ - { - "builtIn": 1, - "datasource": { - "type": "datasource", - "uid": "grafana" - }, - "enable": true, - "hide": true, - "iconColor": "rgba(0, 211, 255, 1)", - "name": "Annotations \u0026 Alerts", - "target": { - "limit": 100, - "matchAny": false, - "tags": [], - "type": "dashboard" - }, - "type": "dashboard" - } - ] - }, - "editable": true, - "fiscalYearStartMonth": 0, - "graphTooltip": 0, - "id": 5890, - "links": [], - "liveNow": false, - "panels": [ - { - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 0 - }, - "id": 9, - "panels": [], - "title": "overview", - "type": "row" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "reqps" - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "200" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "green", - "mode": "fixed" - } - } - ] - } - ] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 1 - }, - "id": 7, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "sum by (code) (rate(mediamon_http_requests_total[$__rate_interval]))", - "instant": false, - "legendFormat": "__auto", - "range": true, - "refId": "A" - } - ], - "title": "request rate", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "s" - }, - "overrides": [ - { - "__systemRef": "hideSeriesFrom", - "matcher": { - "id": "byNames", - "options": { - "mode": "exclude", - "names": [ - "plex", - "radarr", - "sonarr", - "transmission" - ], - "prefix": "All except:", - "readOnly": true - } - }, - "properties": [ - { - "id": "custom.hideFrom", - "value": { - "legend": false, - "tooltip": false, - "viz": true - } - } - ] - } - ] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 1 - }, - "id": 10, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "sum by (application) (mediamon_http_request_duration_seconds_sum / mediamon_http_request_duration_seconds_count)", - "instant": false, - "legendFormat": "__auto", - "range": true, - "refId": "A" - } - ], - "title": "latency", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "reqps" - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 9 - }, - "id": 11, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "sum by (application) (rate(mediamon_http_requests_total{code!=\"200\"}[$__rate_interval]))", - "instant": false, - "legendFormat": "__auto", - "range": true, - "refId": "A" - } - ], - "title": "errors by application", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "percentunit" - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 9 - }, - "id": 6, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "sum by (application, path) (mediamon_http_cache_hit_total / mediamon_http_cache_total)", - "legendFormat": "{{application}} - {{path}}", - "range": true, - "refId": "A" - } - ], - "title": "API cache hit rate", - "type": "timeseries" - }, - { - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 17 - }, - "id": 8, - "panels": [], - "repeat": "application", - "repeatDirection": "h", - "title": "$application", - "type": "row" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "reqps" - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": " - 200" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "green", - "mode": "fixed" - } - } - ] - } - ] - }, - "gridPos": { - "h": 8, - "w": 8, - "x": 0, - "y": 18 - }, - "id": 3, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "exemplar": true, - "expr": "avg by (code) (\n rate (mediamon_http_requests_total{application=~\"$application\"}[$__rate_interval])\n)", - "interval": "", - "legendFormat": " {{code}}", - "range": true, - "refId": "A" - } - ], - "title": "request rate", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 8, - "x": 8, - "y": 18 - }, - "id": 24, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "sum by (path) (rate(mediamon_http_requests_total{application=~\"$application\", code!=\"200\"}[$__rate_interval]))", - "instant": false, - "legendFormat": "__auto", - "range": true, - "refId": "A" - } - ], - "title": "errors by path", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "s" - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 8, - "x": 16, - "y": 18 - }, - "id": 2, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "exemplar": true, - "expr": "avg by (path) (\n mediamon_http_request_duration_seconds_sum{application=~\"$application\"} / mediamon_http_request_duration_seconds_count\n)", - "interval": "", - "legendFormat": "{{application}} - {{path}}", - "range": true, - "refId": "A" - } - ], - "title": "latency", - "type": "timeseries" - } - ], - "refresh": "30s", - "revision": 1, - "schemaVersion": 39, - "tags": [], - "templating": { - "list": [ - { - "current": { - "selected": false, - "text": "All", - "value": "$__all" - }, - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "definition": "label_values(mediamon_http_requests_total,application)", - "hide": 0, - "includeAll": true, - "multi": false, - "name": "application", - "options": [], - "query": { - "qryType": 1, - "query": "label_values(mediamon_http_requests_total,application)", - "refId": "PrometheusVariableQueryEditor-VariableQuery" - }, - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "sort": 0, - "type": "query" - } - ] - }, - "time": { - "from": "now-6h", - "to": "now" - }, - "timepicker": {}, - "timezone": "", - "title": "mediamon - internal", - "uid": "TFkbKcJ7z", - "version": 2, - "weekStart": "" - } ---- -apiVersion: grafana.integreatly.org/v1beta1 -kind: GrafanaDashboard -metadata: - name: prowlarr - namespace: development -spec: - allowCrossNamespaceImport: true - folder: "Media Apps" - instanceSelector: - matchLabels: - dashboards: local-grafana - json: | - { - "annotations": { - "list": [ - { - "builtIn": 1, - "datasource": { - "type": "grafana", - "uid": "-- Grafana --" - }, - "enable": true, - "hide": true, - "iconColor": "rgba(0, 211, 255, 1)", - "name": "Annotations \u0026 Alerts", - "type": "dashboard" - } - ] - }, - "editable": true, - "fiscalYearStartMonth": 0, - "graphTooltip": 0, - "id": 5887, - "links": [], - "panels": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "s" - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 11, - "x": 0, - "y": 0 - }, - "id": 1, - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showPercentChange": false, - "textMode": "auto", - "wideLayout": true - }, - "pluginVersion": "11.0.0", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "avg by (indexer) (mediamon_prowlarr_indexer_response_time)", - "hide": false, - "instant": false, - "legendFormat": "{{indexer}}", - "range": true, - "refId": "B" - } - ], - "title": "Indexer response times", - "type": "stat" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 8, - "x": 11, - "y": 0 - }, - "id": 4, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "maxHeight": 600, - "mode": "single", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": " sum by (indexer)(rate(mediamon_prowlarr_indexer_query_total[$__rate_interval]))", - "instant": false, - "legendFormat": "{{indexer}}", - "range": true, - "refId": "A" - } - ], - "title": "Queries by Indexer", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - } - }, - "mappings": [] - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 5, - "x": 19, - "y": 0 - }, - "id": 3, - "options": { - "legend": { - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "pieType": "pie", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "tooltip": { - "maxHeight": 600, - "mode": "single", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "sum by (indexer) (mediamon_prowlarr_indexer_grab_total)", - "instant": false, - "legendFormat": "{{indexer}}", - "range": true, - "refId": "A" - } - ], - "title": "Grabs by Indexer", - "type": "piechart" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "decimals": 2, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "percentunit" - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 5, - "x": 0, - "y": 8 - }, - "id": 6, - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showPercentChange": false, - "textMode": "auto", - "wideLayout": true - }, - "pluginVersion": "11.0.0", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "sum by (indexer) (mediamon_prowlarr_indexer_failed_query_total / mediamon_prowlarr_indexer_query_total)", - "legendFormat": "__auto", - "range": true, - "refId": "A" - } - ], - "title": "query errors by indexer", - "type": "stat" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "decimals": 2, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "percentunit" - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 6, - "x": 5, - "y": 8 - }, - "id": 7, - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showPercentChange": false, - "textMode": "auto", - "wideLayout": true - }, - "pluginVersion": "11.0.0", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "sum by (indexer) (mediamon_prowlarr_indexer_failed_grab_total / mediamon_prowlarr_indexer_grab_total)", - "legendFormat": "__auto", - "range": true, - "refId": "A" - } - ], - "title": "grab errors by indexer", - "type": "stat" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 8, - "x": 11, - "y": 8 - }, - "id": 2, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "maxHeight": 600, - "mode": "single", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "sum by (user_agent) (rate(mediamon_prowlarr_user_agent_query_total[$__rate_interval]))", - "instant": false, - "legendFormat": "{{user_agent}}", - "range": true, - "refId": "A" - } - ], - "title": "Queries by User Agent", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - } - }, - "mappings": [] - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 5, - "x": 19, - "y": 8 - }, - "id": 5, - "options": { - "legend": { - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "pieType": "pie", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "tooltip": { - "maxHeight": 600, - "mode": "single", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "sum by (user_agent) (mediamon_prowlarr_user_agent_grab_total)", - "instant": false, - "legendFormat": "{{user_agent}}", - "range": true, - "refId": "A" - } - ], - "title": "Grabs by User Agent", - "type": "piechart" - } - ], - "refresh": "30s", - "schemaVersion": 39, - "tags": [], - "templating": { - "list": [] - }, - "time": { - "from": "now-30m", - "to": "now" - }, - "timeRangeUpdatedDuringEditOrView": false, - "timepicker": {}, - "timezone": "browser", - "title": "Prowlarr", - "uid": "adn7c8ixvu6m8f", - "version": 2, - "weekStart": "" - }