From f2ba2bfe5ea273ff29d4605494443d1a49dede3a Mon Sep 17 00:00:00 2001 From: Kiarah Pettaway <206043063+kpetta1@users.noreply.github.com> Date: Fri, 23 May 2025 14:20:20 -0400 Subject: [PATCH 1/3] update mssql candidate --- mssql-mixin-candidate/Makefile | 34 ++ mssql-mixin-candidate/README.md | 66 +++ mssql-mixin-candidate/alerts.libsonnet | 19 + mssql-mixin-candidate/config.libsonnet | 28 + mssql-mixin-candidate/dashboards.libsonnet | 115 ++++ mssql-mixin-candidate/dashboards_out/logs | 301 +++++++++++ .../dashboards_out/mssql_overview | 507 ++++++++++++++++++ .../dashboards_out/mssql_pages | 95 ++++ mssql-mixin-candidate/g.libsonnet | 1 + mssql-mixin-candidate/jsonnetfile.json | 33 ++ mssql-mixin-candidate/links.libsonnet | 36 ++ mssql-mixin-candidate/main.libsonnet | 34 ++ mssql-mixin-candidate/mixin.libsonnet | 18 + mssql-mixin-candidate/panels.libsonnet | 141 +++++ mssql-mixin-candidate/rows.libsonnet | 53 ++ mssql-mixin-candidate/targets.libsonnet | 16 + mssql-mixin-candidate/variables.libsonnet | 78 +++ 17 files changed, 1575 insertions(+) create mode 100644 mssql-mixin-candidate/Makefile create mode 100644 mssql-mixin-candidate/README.md create mode 100644 mssql-mixin-candidate/alerts.libsonnet create mode 100644 mssql-mixin-candidate/config.libsonnet create mode 100644 mssql-mixin-candidate/dashboards.libsonnet create mode 100644 mssql-mixin-candidate/dashboards_out/logs create mode 100644 mssql-mixin-candidate/dashboards_out/mssql_overview create mode 100644 mssql-mixin-candidate/dashboards_out/mssql_pages create mode 100644 mssql-mixin-candidate/g.libsonnet create mode 100644 mssql-mixin-candidate/jsonnetfile.json create mode 100644 mssql-mixin-candidate/links.libsonnet create mode 100644 mssql-mixin-candidate/main.libsonnet create mode 100644 mssql-mixin-candidate/mixin.libsonnet create mode 100644 mssql-mixin-candidate/panels.libsonnet create mode 100644 mssql-mixin-candidate/rows.libsonnet create mode 100644 mssql-mixin-candidate/targets.libsonnet create mode 100644 mssql-mixin-candidate/variables.libsonnet diff --git a/mssql-mixin-candidate/Makefile b/mssql-mixin-candidate/Makefile new file mode 100644 index 000000000..a8d7f24aa --- /dev/null +++ b/mssql-mixin-candidate/Makefile @@ -0,0 +1,34 @@ +JSONNET_FMT := jsonnetfmt -n 2 --max-blank-lines 1 --string-style s --comment-style s + +.PHONY: all +all: build dashboards_out prometheus_alerts.yaml + +vendor: jsonnetfile.json + jb install + +.PHONY: build +build: vendor + +.PHONY: fmt +fmt: + find . -name 'vendor' -prune -o -name '*.libsonnet' -print -o -name '*.jsonnet' -print | \ + xargs -n 1 -- $(JSONNET_FMT) -i + +.PHONY: lint +lint: build + find . -name 'vendor' -prune -o -name '*.libsonnet' -print -o -name '*.jsonnet' -print | \ + while read f; do \ + $(JSONNET_FMT) "$$f" | diff -u "$$f" -; \ + done + mixtool lint mixin.libsonnet + +dashboards_out: mixin.libsonnet config.libsonnet dashboards.libsonnet + @mkdir -p dashboards_out + mixtool generate dashboards mixin.libsonnet -d dashboards_out + +prometheus_alerts.yaml: mixin.libsonnet alerts.libsonnet + mixtool generate alerts mixin.libsonnet -a prometheus_alerts.yaml + +.PHONY: clean +clean: + rm -rf dashboards_out prometheus_alerts.yaml diff --git a/mssql-mixin-candidate/README.md b/mssql-mixin-candidate/README.md new file mode 100644 index 000000000..a3319ffaf --- /dev/null +++ b/mssql-mixin-candidate/README.md @@ -0,0 +1,66 @@ +# Clickhouse Mixin + +Clickhouse mixin is a set of configurable, reusable and extensible alerts and dashboards that uses the [Clickhouse Exporter](https://github.com/ClickHouse/clickhouse_exporter) for Prometheus and Loki for logs (optional). + +The Clickhouse mixin includes the following dashboards: +- Clickhouse overview +- Clickhouse latency +- Clickhouse replica + +## Clickhouse overview: + +The Clickhouse overview dashboard provides details on queries, memory usage, networking and error logs. To get Clickhouse error logs, [Promtail and Loki needs to be installed](https://grafana.com/docs/loki/latest/installation/) and provisioned for logs with your Grafana instance. The default Clickhouse error log path is `/var/log/clickhouse-server/clickhouse-server.err.log`. + +![First screenshot of Clickhouse overview dashboard](https://storage.googleapis.com/grafanalabs-integration-assets/clickhouse/screenshots/clickhouse-overview.01.png) +![Second screenshot of Clickhouse overview dashboard](https://storage.googleapis.com/grafanalabs-integration-assets/clickhouse/screenshots/clickhouse-overview.02.png) + + +Clickhouse error logs are enabled by default in the `config.libsonnet` and can be removed by setting `enableLokiLogs` to `false`. Then run `make` again to regenerate the dashboard: + +``` +{ + _config+:: { + enableLokiLogs: true, + }, +} +``` + +## Clickhouse latency: + +The Clickhouse latency dashboard provides details on latency metrics. +![Third screenshot of Clickhouse latency dashboard](https://storage.googleapis.com/grafanalabs-integration-assets/clickhouse/screenshots/clickhouse-latency.01.png) + +## Clickhouse replica: + +The Clickhouse replica dashboard provides details on replica metrics. +![Fourth screenshot of Clickhouse replica Dashboard](https://storage.googleapis.com/grafanalabs-integration-assets/clickhouse/screenshots/clickhouse-replica.01.png) + +## Install tools + +```bash +go install github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb@latest +go install github.com/monitoring-mixins/mixtool/cmd/mixtool@latest +``` + +For linting and formatting, you would also need and `jsonnetfmt` installed. If you +have a working Go development environment, it's easiest to run the following: + +```bash +go install github.com/google/go-jsonnet/cmd/jsonnetfmt@latest +``` + +The files in `dashboards_out` need to be imported +into your Grafana server. The exact details will be depending on your environment. + +`prometheus_alerts.yaml` needs to be imported into Prometheus. + +## Generate dashboards and alerts + +Edit `config.libsonnet` if required and then build JSON dashboard files for Grafana: + +```bash +make +``` + +For more advanced uses of mixins, see +https://github.com/monitoring-mixins/docs. diff --git a/mssql-mixin-candidate/alerts.libsonnet b/mssql-mixin-candidate/alerts.libsonnet new file mode 100644 index 000000000..881faee4f --- /dev/null +++ b/mssql-mixin-candidate/alerts.libsonnet @@ -0,0 +1,19 @@ +{ + new(this): { + // Add your alerts here + // Example: + // exampleAlert: + // { + // alert: 'ExampleAlert', + // expr: 'up == 0', + // 'for': '5m', + // labels: { + // severity: 'critical', + // }, + // annotations: { + // summary: 'Instance {{ $labels.instance }} down', + // description: '{{ $labels.instance }} of job {{ $labels.job }} has been down for more than 5 minutes.', + // }, + // }, + }, +} \ No newline at end of file diff --git a/mssql-mixin-candidate/config.libsonnet b/mssql-mixin-candidate/config.libsonnet new file mode 100644 index 000000000..e27a1582c --- /dev/null +++ b/mssql-mixin-candidate/config.libsonnet @@ -0,0 +1,28 @@ +{ + // any modular library should include as inputs: + // 'dashboardNamePrefix' - Use as prefix for all Dashboards and (optional) rule groups + // 'filteringSelector' - Static selector to apply to ALL dashboard variables of type query, panel queries, alerts and recording rules. + // 'groupLabels' - one or more labels that can be used to identify 'group' of instances. In simple cases, can be 'job' or 'cluster'. + // 'instanceLabels' - one or more labels that can be used to identify single entity of instances. In simple cases, can be 'instance' or 'pod'. + // 'uid' - UID to prefix all dashboards original uids + + enableMultiCluster: false, + filteringSelector: 'job=~"integrations/influxdb"', + groupLabels: if self.enableMultiCluster then ['job', 'cluster'] else ['job'], + instanceLabels: ['instance'], + dashboardTags: ['influxdb-mixin'], + uid: 'influxdb', + dashboardNamePrefix: '', + + // additional params + dashboardPeriod: 'now-30m', + dashboardTimezone: 'default', + dashboardRefresh: '1m', + + // logs lib related + enableLokiLogs: true, + logLabels: if self.enableMultiCluster then ['job', 'instance', 'cluster', 'level'] else ['job', 'instance', 'level'], + extraLogLabels: [], // Required by logs-lib + logsVolumeGroupBy: 'level', + showLogsVolume: true, +} \ No newline at end of file diff --git a/mssql-mixin-candidate/dashboards.libsonnet b/mssql-mixin-candidate/dashboards.libsonnet new file mode 100644 index 000000000..3445c45d4 --- /dev/null +++ b/mssql-mixin-candidate/dashboards.libsonnet @@ -0,0 +1,115 @@ +local g = import './g.libsonnet'; +local logslib = import 'logs-lib/logs/main.libsonnet'; +{ + local root = self, + new(this):: + local prefix = this.config.dashboardNamePrefix; + local links = this.grafana.links; + local tags = this.config.dashboardTags; + local uid = g.util.string.slugify(this.config.uid); + local vars = this.grafana.variables; + local annotations = this.grafana.annotations; + local refresh = this.config.dashboardRefresh; + local period = this.config.dashboardPeriod; + local timezone = this.config.dashboardTimezone; + local panels = this.grafana.panels; + + { + mssql_overview: + g.dashboard.new(prefix + ' MSSQL overview') + + g.dashboard.withPanels( + g.util.grid.wrapPanels( + [ + panels.connectionsPanel { gridPos+: { h: 8, w: 12, x: 0, y: 0 } }, + panels.batchRequestsPanel { gridPos+: { h: 8, w: 12, x: 12, y: 0 } }, + panels.severeErrorsPanel { gridPos+: { h: 8, w: 12, x: 0, y: 8 } }, + panels.deadlocksPanel { gridPos+: { h: 8, w: 12, x: 12, y: 8 } }, + panels.osMemoryUsagePanel { gridPos+: { h: 8, w: 24, x: 0, y: 16 } }, + panels.memoryManagerPanel { gridPos+: { h: 8, w: 16, x: 0, y: 24 } }, + panels.committedMemoryUtilizationPanel { gridPos+: { h: 8, w: 8, x: 16, y: 24 } }, + panels.errorLogsPanel { gridPos+: { h: 8, w: 24, x: 0, y: 32 } }, + panels.databaseWriteStallDurationPanel { gridPos+: { h: 8, w: 12, x: 0, y: 41 } }, + panels.databaseReadStallDurationPanel { gridPos+: { h: 8, w: 12, x: 12, y: 41 } }, + panels.transactionLogExpansionsPanel { gridPos+: { h: 8, w: 24, x: 0, y: 49 } }, + ] + ) + ) + + root.applyCommon( + vars.singleInstance, + uid + '_mssql_overview', + tags, + links { mssqlOverview+:: {} }, + annotations, + timezone, + refresh, + period + ), + + mssql_pages: + g.dashboard.new(prefix + ' MSSQL pages') + + g.dashboard.withPanels( + g.util.grid.wrapPanels( + [ + ] + ) + ) + + root.applyCommon( + vars.singleInstance, + uid + '_mssql_pages', + tags, + links { mssqlPages+:: {} }, + annotations, + timezone, + refresh, + period + ), + + } + + + if this.config.enableLokiLogs then + { + logs: + logslib.new( + prefix + ' logs', + datasourceName=this.grafana.variables.datasources.loki.name, + datasourceRegex=this.grafana.variables.datasources.loki.regex, + filterSelector=this.config.filteringSelector, + labels=this.config.groupLabels + this.config.extraLogLabels, + formatParser=null, + showLogsVolume=this.config.showLogsVolume, + ) + { + dashboards+: + { + logs+: + // reference to self, already generated variables, to keep them, but apply other common data in applyCommon + root.applyCommon(super.logs.templating.list, uid=uid + '-logs', tags=tags, links=links { logs+:: {} }, annotations=annotations, timezone=timezone, refresh=refresh, period=period), + }, + panels+: + { + // modify log panel + logs+: + g.panel.logs.options.withEnableLogDetails(true) + + g.panel.logs.options.withShowTime(false) + + g.panel.logs.options.withWrapLogMessage(false), + }, + variables+: { + // add prometheus datasource for annotations processing + toArray+: [ + this.grafana.variables.datasources.prometheus { hide: 2 }, + ], + }, + }.dashboards.logs, + } + else {}, + + applyCommon(vars, uid, tags, links, annotations, timezone, refresh, period): + g.dashboard.withTags(tags) + + g.dashboard.withUid(uid) + + g.dashboard.withLinks(std.objectValues(links)) + + g.dashboard.withTimezone(timezone) + + g.dashboard.withRefresh(refresh) + + g.dashboard.time.withFrom(period) + + g.dashboard.withVariables(vars) + + g.dashboard.withAnnotations(std.objectValues(annotations)), +} \ No newline at end of file diff --git a/mssql-mixin-candidate/dashboards_out/logs b/mssql-mixin-candidate/dashboards_out/logs new file mode 100644 index 000000000..af79bd41c --- /dev/null +++ b/mssql-mixin-candidate/dashboards_out/logs @@ -0,0 +1,301 @@ +{ + "annotations": { + "list": [ ] + }, + "links": [ + { + "keepTime": true, + "title": "Back to Mssql Overview", + "type": "link", + "url": "/d/mssql_mssql_overview" + }, + { + "keepTime": true, + "title": "Back to Mssql Pages", + "type": "link", + "url": "/d/mssql_mssql_pages" + }, + { + "keepTime": true, + "title": "Mssql Overview", + "type": "link", + "url": "/d/mssql_mssql_overview" + }, + { + "keepTime": true, + "title": "Mssql Pages", + "type": "link", + "url": "/d/mssql_mssql_pages" + }, + { + "asDropdown": true, + "includeVars": true, + "keepTime": true, + "tags": [ + "influxdb-mixin" + ], + "title": "All dashboards", + "type": "dashboards" + } + ], + "panels": [ + { + "datasource": { + "type": "loki", + "uid": "${loki_datasource}" + }, + "description": "Logs volume grouped by \"level\" label.", + "fieldConfig": { + "defaults": { + "custom": { + "drawStyle": "bars", + "fillOpacity": 50, + "stacking": { + "mode": "normal" + } + }, + "unit": "none" + }, + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": "(E|e)merg|(F|f)atal|(A|a)lert|(C|c)rit.*" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "purple", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "(E|e)(rr.*|RR.*)" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "red", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "(W|w)(arn.*|ARN.*|rn|RN)" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "orange", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "(N|n)(otice|ote)|(I|i)(nf.*|NF.*)" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "green", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "dbg.*|DBG.*|(D|d)(EBUG|ebug)" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "blue", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "(T|t)(race|RACE)" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "light-blue", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "logs" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "text", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 6, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 1, + "maxDataPoints": 100, + "options": { + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "v11.0.0", + "targets": [ + { + "datasource": { + "type": "loki", + "uid": "${loki_datasource}" + }, + "expr": "sum by (level) (count_over_time({job=~\"integrations/mssql\",job=~\"$job\"}\n|~ \"$regex_search\"\n\n[$__auto]))\n", + "legendFormat": "{{ level }}" + } + ], + "title": "Logs volume", + "transformations": [ + { + "id": "renameByRegex", + "options": { + "regex": "Value", + "renamePattern": "logs" + } + } + ], + "type": "timeseries" + }, + { + "datasource": { + "type": "datasource", + "uid": "-- Mixed --" + }, + "gridPos": { + "h": 18, + "w": 24, + "x": 0, + "y": 18 + }, + "id": 2, + "options": { + "dedupStrategy": "exact", + "enableLogDetails": true, + "prettifyLogMessage": true, + "showTime": false, + "wrapLogMessage": false + }, + "pluginVersion": "v11.0.0", + "targets": [ + { + "datasource": { + "type": "loki", + "uid": "${loki_datasource}" + }, + "expr": "{job=~\"integrations/mssql\",job=~\"$job\"} \n|~ \"$regex_search\"\n\n\n" + } + ], + "title": "Logs", + "type": "logs" + } + ], + "refresh": "1m", + "schemaVersion": 39, + "tags": [ + "influxdb-mixin" + ], + "templating": { + "list": [ + { + "label": "Loki data source", + "name": "loki_datasource", + "query": "loki", + "regex": "", + "type": "datasource" + }, + { + "allValue": ".*", + "datasource": { + "type": "loki", + "uid": "${loki_datasource}" + }, + "includeAll": true, + "label": "Job", + "multi": true, + "name": "job", + "query": "label_values({job=~\"integrations/mssql\"}, job)", + "refresh": 2, + "sort": 1, + "type": "query" + }, + { + "current": { + "selected": false, + "text": "", + "value": "" + }, + "label": "Regex search", + "name": "regex_search", + "options": [ + { + "selected": true, + "text": "", + "value": "" + } + ], + "query": "", + "type": "textbox" + }, + { + "hide": 2, + "label": "Prometheus data source", + "name": "prometheus_datasource", + "query": "prometheus", + "regex": "", + "type": "datasource" + } + ] + }, + "time": { + "from": "now-30m", + "to": "now" + }, + "timezone": "default", + "title": " logs", + "uid": "mssql-logs" + } \ No newline at end of file diff --git a/mssql-mixin-candidate/dashboards_out/mssql_overview b/mssql-mixin-candidate/dashboards_out/mssql_overview new file mode 100644 index 000000000..75fb82654 --- /dev/null +++ b/mssql-mixin-candidate/dashboards_out/mssql_overview @@ -0,0 +1,507 @@ +{ + "annotations": { + "list": [ ] + }, + "links": [ + { + "keepTime": true, + "title": "Back to Mssql Overview", + "type": "link", + "url": "/d/mssql_mssql_overview" + }, + { + "keepTime": true, + "title": "Back to Mssql Pages", + "type": "link", + "url": "/d/mssql_mssql_pages" + }, + { + "keepTime": true, + "title": "Logs", + "type": "link", + "url": "/d/mssql-logs" + }, + { + "keepTime": true, + "title": "Mssql Pages", + "type": "link", + "url": "/d/mssql_mssql_pages" + }, + { + "asDropdown": true, + "includeVars": true, + "keepTime": true, + "tags": [ + "influxdb-mixin" + ], + "title": "All dashboards", + "type": "dashboards" + } + ], + "panels": [ + { + "datasource": { + "type": "datasource", + "uid": "-- Mixed --" + }, + "description": "The number of network connections to each database.", + "fieldConfig": { + "defaults": { + "custom": { + "fillOpacity": 54, + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", + "spanNulls": false + }, + "unit": "connections" + } + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 0 + }, + "id": 1, + "options": { + "legend": { + "calcs": [ ], + "displayMode": "list" + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "v11.0.0", + "targets": [ ], + "title": "Connections", + "type": "timeseries" + }, + { + "datasource": { + "type": "datasource", + "uid": "-- Mixed --" + }, + "description": "Number of batch requests.", + "fieldConfig": { + "defaults": { + "custom": { + "fillOpacity": 0, + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", + "spanNulls": false + }, + "unit": "reqps" + } + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 0 + }, + "id": 2, + "options": { + "legend": { + "calcs": [ ], + "displayMode": "list" + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "v11.0.0", + "targets": [ ], + "title": "Batch requests", + "type": "timeseries" + }, + { + "datasource": { + "type": "datasource", + "uid": "-- Mixed --" + }, + "description": "Number of severe errors that caused connections to be killed.", + "fieldConfig": { + "defaults": { + "custom": { + "fillOpacity": 0, + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", + "spanNulls": false + }, + "unit": "errors" + } + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 8 + }, + "id": 3, + "options": { + "legend": { + "calcs": [ ], + "displayMode": "list" + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "v11.0.0", + "targets": [ ], + "title": "Severe errors", + "type": "timeseries" + }, + { + "datasource": { + "type": "datasource", + "uid": "-- Mixed --" + }, + "description": "Rate of deadlocks occurring over time.", + "fieldConfig": { + "defaults": { + "custom": { + "fillOpacity": 0, + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", + "spanNulls": false + }, + "unit": "deadlocks" + } + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 8 + }, + "id": 4, + "options": { + "legend": { + "calcs": [ ], + "displayMode": "list" + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "v11.0.0", + "targets": [ ], + "title": "Deadlocks", + "type": "timeseries" + }, + { + "datasource": { + "type": "datasource", + "uid": "-- Mixed --" + }, + "description": "The amount of physical memory available and used by SQL Server.", + "fieldConfig": { + "defaults": { + "custom": { + "fillOpacity": 51, + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", + "spanNulls": false + }, + "unit": "bytes" + } + }, + "gridPos": { + "h": 8, + "w": 24, + "x": 0, + "y": 16 + }, + "id": 5, + "options": { + "legend": { + "calcs": [ ], + "displayMode": "list" + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "v11.0.0", + "targets": [ ], + "title": "OS memory usage", + "type": "timeseries" + }, + { + "datasource": { + "type": "datasource", + "uid": "-- Mixed --" + }, + "description": "The committed memory and target committed memory for the SQL Server memory manager. See https://learn.microsoft.com/en-us/sql/relational-databases/performance-monitor/monitor-memory-usage?view=sql-server-ver16#isolating-memory-used-by-", + "fieldConfig": { + "defaults": { + "custom": { + "fillOpacity": 51, + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", + "spanNulls": false + }, + "unit": "bytes" + } + }, + "gridPos": { + "h": 8, + "w": 16, + "x": 0, + "y": 24 + }, + "id": 6, + "options": { + "legend": { + "calcs": [ ], + "displayMode": "list" + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "v11.0.0", + "targets": [ ], + "title": "Memory manager", + "type": "timeseries" + }, + { + "datasource": { + "type": "datasource", + "uid": "-- Mixed --" + }, + "description": "The committed memory utilization", + "gridPos": { + "h": 8, + "w": 8, + "x": 16, + "y": 24 + }, + "id": 7, + "options": { + "orientation": "auto" + }, + "pluginVersion": "v11.0.0", + "targets": [ ], + "title": "Committed memory utilization", + "type": "bargauge" + }, + { + "datasource": { + "type": "datasource", + "uid": "-- Mixed --" + }, + "gridPos": { + "h": 8, + "w": 24, + "x": 0, + "y": 32 + }, + "id": 8, + "options": { + "enableLogDetails": true, + "showTime": true, + "wrapLogMessage": false + }, + "pluginVersion": "v11.0.0", + "title": "Error Logs", + "type": "logs" + }, + { + "datasource": { + "type": "datasource", + "uid": "-- Mixed --" + }, + "description": "The current stall (latency) for database writes.", + "fieldConfig": { + "defaults": { + "custom": { + "fillOpacity": 0, + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", + "spanNulls": false + }, + "unit": "s" + } + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 40 + }, + "id": 9, + "options": { + "legend": { + "calcs": [ ], + "displayMode": "list" + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "v11.0.0", + "targets": [ ], + "title": "Database write stall duration", + "type": "timeseries" + }, + { + "datasource": { + "type": "datasource", + "uid": "-- Mixed --" + }, + "description": "The current stall (latency) for database reads.", + "fieldConfig": { + "defaults": { + "custom": { + "fillOpacity": 0, + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", + "spanNulls": false + }, + "unit": "s" + } + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 40 + }, + "id": 10, + "options": { + "legend": { + "calcs": [ ], + "displayMode": "list" + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "v11.0.0", + "targets": [ ], + "title": "Database read stall duration", + "type": "timeseries" + }, + { + "datasource": { + "type": "datasource", + "uid": "-- Mixed --" + }, + "description": "Number of times the transaction log has been expanded for a database.", + "fieldConfig": { + "defaults": { + "custom": { + "fillOpacity": 0, + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", + "spanNulls": false + }, + "unit": "expansions" + } + }, + "gridPos": { + "h": 8, + "w": 24, + "x": 0, + "y": 48 + }, + "id": 11, + "options": { + "legend": { + "calcs": [ ], + "displayMode": "list" + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "v11.0.0", + "targets": [ ], + "title": "Transaction log expansions", + "type": "timeseries" + } + ], + "refresh": "1m", + "schemaVersion": 39, + "tags": [ + "influxdb-mixin" + ], + "templating": { + "list": [ + { + "label": "Prometheus data source", + "name": "prometheus_datasource", + "query": "prometheus", + "regex": "", + "type": "datasource" + }, + { + "allValue": ".+", + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "includeAll": true, + "label": "Job", + "multi": true, + "name": "job", + "query": "label_values(up{job=~\"integrations/mssql\"}, job)", + "refresh": 2, + "sort": 1, + "type": "query" + }, + { + "allValue": ".+", + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "includeAll": true, + "label": "Instance", + "multi": true, + "name": "instance", + "query": "label_values(up{job=~\"integrations/mssql\",job=~\"$job\"}, instance)", + "refresh": 2, + "sort": 1, + "type": "query" + } + ] + }, + "time": { + "from": "now-30m", + "to": "now" + }, + "timezone": "default", + "title": " MSSQL overview", + "uid": "mssql_mssql_overview" + } \ No newline at end of file diff --git a/mssql-mixin-candidate/dashboards_out/mssql_pages b/mssql-mixin-candidate/dashboards_out/mssql_pages new file mode 100644 index 000000000..9d795bd5b --- /dev/null +++ b/mssql-mixin-candidate/dashboards_out/mssql_pages @@ -0,0 +1,95 @@ +{ + "annotations": { + "list": [ ] + }, + "links": [ + { + "keepTime": true, + "title": "Back to Mssql Overview", + "type": "link", + "url": "/d/mssql_mssql_overview" + }, + { + "keepTime": true, + "title": "Back to Mssql Pages", + "type": "link", + "url": "/d/mssql_mssql_pages" + }, + { + "keepTime": true, + "title": "Logs", + "type": "link", + "url": "/d/mssql-logs" + }, + { + "keepTime": true, + "title": "Mssql Overview", + "type": "link", + "url": "/d/mssql_mssql_overview" + }, + { + "asDropdown": true, + "includeVars": true, + "keepTime": true, + "tags": [ + "influxdb-mixin" + ], + "title": "All dashboards", + "type": "dashboards" + } + ], + "panels": [ ], + "refresh": "1m", + "schemaVersion": 39, + "tags": [ + "influxdb-mixin" + ], + "templating": { + "list": [ + { + "label": "Prometheus data source", + "name": "prometheus_datasource", + "query": "prometheus", + "regex": "", + "type": "datasource" + }, + { + "allValue": ".+", + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "includeAll": true, + "label": "Job", + "multi": true, + "name": "job", + "query": "label_values(up{job=~\"integrations/mssql\"}, job)", + "refresh": 2, + "sort": 1, + "type": "query" + }, + { + "allValue": ".+", + "datasource": { + "type": "prometheus", + "uid": "${prometheus_datasource}" + }, + "includeAll": true, + "label": "Instance", + "multi": true, + "name": "instance", + "query": "label_values(up{job=~\"integrations/mssql\",job=~\"$job\"}, instance)", + "refresh": 2, + "sort": 1, + "type": "query" + } + ] + }, + "time": { + "from": "now-30m", + "to": "now" + }, + "timezone": "default", + "title": " MSSQL pages", + "uid": "mssql_mssql_pages" + } \ No newline at end of file diff --git a/mssql-mixin-candidate/g.libsonnet b/mssql-mixin-candidate/g.libsonnet new file mode 100644 index 000000000..987f6c54b --- /dev/null +++ b/mssql-mixin-candidate/g.libsonnet @@ -0,0 +1 @@ +import 'github.com/grafana/grafonnet/gen/grafonnet-v11.0.0/main.libsonnet' \ No newline at end of file diff --git a/mssql-mixin-candidate/jsonnetfile.json b/mssql-mixin-candidate/jsonnetfile.json new file mode 100644 index 000000000..69b58cc74 --- /dev/null +++ b/mssql-mixin-candidate/jsonnetfile.json @@ -0,0 +1,33 @@ +{ + "version": 1, + "dependencies": [ + { + "source": { + "git": { + "remote": "https://github.com/grafana/jsonnet-libs.git", + "subdir": "common-lib" + } + }, + "version": "master" + }, + { + "source": { + "git": { + "remote": "https://github.com/grafana/grafonnet.git", + "subdir": "gen/grafonnet-v10.0.0" + } + }, + "version": "main" + }, + { + "source": { + "git": { + "remote": "https://github.com/grafana/jsonnet-libs.git", + "subdir": "logs-lib" + } + }, + "version": "master" + } + ], + "legacyImports": true +} \ No newline at end of file diff --git a/mssql-mixin-candidate/links.libsonnet b/mssql-mixin-candidate/links.libsonnet new file mode 100644 index 000000000..a4af259c4 --- /dev/null +++ b/mssql-mixin-candidate/links.libsonnet @@ -0,0 +1,36 @@ +local g = import './g.libsonnet'; +{ + local link = g.dashboard.link, + new(this): + { + mssqlOverview: + link.link.new('Mssql Overview', '/d/' + this.grafana.dashboards.mssql_overview.uid) + + link.link.options.withKeepTime(true), + + backToMssqlOverview: + link.link.new('Back to Mssql Overview', '/d/' + this.grafana.dashboards.mssql_overview.uid) + + link.link.options.withKeepTime(true), + + mssqlPages: + link.link.new('Mssql Pages', '/d/' + this.grafana.dashboards.mssql_pages.uid) + + link.link.options.withKeepTime(true), + + backToMssqlPages: + link.link.new('Back to Mssql Pages', '/d/' + this.grafana.dashboards.mssql_pages.uid) + + link.link.options.withKeepTime(true), + + otherDashboards: + link.dashboards.new('All dashboards', this.config.dashboardTags) + + link.dashboards.options.withIncludeVars(true) + + link.dashboards.options.withKeepTime(true) + + link.dashboards.options.withAsDropdown(true), + } + + + if this.config.enableLokiLogs then + { + logs: + link.link.new('Logs', '/d/' + this.grafana.dashboards.logs.uid) + + link.link.options.withKeepTime(true), + } + else {}, +} \ No newline at end of file diff --git a/mssql-mixin-candidate/main.libsonnet b/mssql-mixin-candidate/main.libsonnet new file mode 100644 index 000000000..bea4dc0ef --- /dev/null +++ b/mssql-mixin-candidate/main.libsonnet @@ -0,0 +1,34 @@ +local alerts = import './alerts.libsonnet'; +local config = import './config.libsonnet'; +local dashboards = import './dashboards.libsonnet'; +local g = import './g.libsonnet'; +local links = import './links.libsonnet'; +local panels = import './panels.libsonnet'; +local targets = import './targets.libsonnet'; +local variables = import './variables.libsonnet'; + +{ + withConfigMixin(config): { + config+: config, + }, + + new(): { + + local this = self, + config: config, + + grafana: { + variables: variables.new(this, varMetric='up'), + targets: targets.new(this), + annotations: {}, + links: links.new(this), + panels: panels.new(this), + dashboards: dashboards.new(this), + }, + + prometheus: { + alerts: alerts.new(this), + recordingRules: {}, + }, + }, +} \ No newline at end of file diff --git a/mssql-mixin-candidate/mixin.libsonnet b/mssql-mixin-candidate/mixin.libsonnet new file mode 100644 index 000000000..9f44a31f5 --- /dev/null +++ b/mssql-mixin-candidate/mixin.libsonnet @@ -0,0 +1,18 @@ +local mssqllib = import './main.libsonnet'; + +local mssql = + mssqllib.new() + + mssqllib.withConfigMixin( + { + filteringSelector: 'job=~"integrations/mssql"', + uid: 'mssql', + enableLokiLogs: true, + } + ); + +// populate monitoring-mixin: +{ + grafanaDashboards+:: mssql.grafana.dashboards, + prometheusAlerts+:: mssql.prometheus.alerts, + prometheusRules+:: mssql.prometheus.recordingRules, +} \ No newline at end of file diff --git a/mssql-mixin-candidate/panels.libsonnet b/mssql-mixin-candidate/panels.libsonnet new file mode 100644 index 000000000..0c1718205 --- /dev/null +++ b/mssql-mixin-candidate/panels.libsonnet @@ -0,0 +1,141 @@ +local g = import './g.libsonnet'; +local commonlib = import 'common-lib/common/main.libsonnet'; +local utils = commonlib.utils; +{ + new(this):: + { + local t = this.grafana.targets, + local stat = g.panel.stat, + local fieldOverride = g.panel.table.fieldOverride, + local alertList = g.panel.alertList, + local pieChart = g.panel.pieChart, + local barGauge = g.panel.barGauge, + connectionsPanel: + commonlib.panels.generic.timeSeries.base.new( + 'Connections', + targets=[], + description='The number of network connections to each database.' + ) + + g.panel.timeSeries.standardOptions.withUnit('connections') + + g.panel.timeSeries.fieldConfig.defaults.custom.withFillOpacity(54) + + g.panel.timeSeries.fieldConfig.defaults.custom.withSpanNulls(false), + batchRequestsPanel: + commonlib.panels.generic.timeSeries.base.new( + 'Batch requests', + targets=[], + description='Number of batch requests.' + ) + + g.panel.timeSeries.standardOptions.withUnit('reqps') + + g.panel.timeSeries.fieldConfig.defaults.custom.withFillOpacity(0) + + g.panel.timeSeries.fieldConfig.defaults.custom.withSpanNulls(false), + severeErrorsPanel: + commonlib.panels.generic.timeSeries.base.new( + 'Severe errors', + targets=[], + description='Number of severe errors that caused connections to be killed.' + ) + + g.panel.timeSeries.standardOptions.withUnit('errors') + + g.panel.timeSeries.fieldConfig.defaults.custom.withFillOpacity(0) + + g.panel.timeSeries.fieldConfig.defaults.custom.withSpanNulls(false), + deadlocksPanel: + commonlib.panels.generic.timeSeries.base.new( + 'Deadlocks', + targets=[], + description='Rate of deadlocks occurring over time.' + ) + + g.panel.timeSeries.standardOptions.withUnit('deadlocks') + + g.panel.timeSeries.fieldConfig.defaults.custom.withFillOpacity(0) + + g.panel.timeSeries.fieldConfig.defaults.custom.withSpanNulls(false), + osMemoryUsagePanel: + commonlib.panels.generic.timeSeries.base.new( + 'OS memory usage', + targets=[], + description='The amount of physical memory available and used by SQL Server.' + ) + + g.panel.timeSeries.standardOptions.withUnit('bytes') + + g.panel.timeSeries.fieldConfig.defaults.custom.withFillOpacity(51) + + g.panel.timeSeries.fieldConfig.defaults.custom.withSpanNulls(false), + memoryManagerPanel: + commonlib.panels.generic.timeSeries.base.new( + 'Memory manager', + targets=[], + description='The committed memory and target committed memory for the SQL Server memory manager. See https://learn.microsoft.com/en-us/sql/relational-databases/performance-monitor/monitor-memory-usage?view=sql-server-ver16#isolating-memory-used-by-' + ) + + g.panel.timeSeries.standardOptions.withUnit('bytes') + + g.panel.timeSeries.fieldConfig.defaults.custom.withFillOpacity(51) + + g.panel.timeSeries.fieldConfig.defaults.custom.withSpanNulls(false), + committedMemoryUtilizationPanel: + barGauge.new(title='Committed memory utilization') + + barGauge.queryOptions.withTargets([]) + + barGauge.panelOptions.withDescription('The committed memory utilization') + + barGauge.options.withOrientation('auto'), + errorLogsPanel: + g.panel.logs.new('Error Logs') + + g.panel.logs.options.withEnableLogDetails(true) + + g.panel.logs.options.withShowTime(true) + + g.panel.logs.options.withWrapLogMessage(false), + databaseWriteStallDurationPanel: + commonlib.panels.generic.timeSeries.base.new( + 'Database write stall duration', + targets=[], + description='The current stall (latency) for database writes.' + ) + + g.panel.timeSeries.standardOptions.withUnit('s') + + g.panel.timeSeries.fieldConfig.defaults.custom.withFillOpacity(0) + + g.panel.timeSeries.fieldConfig.defaults.custom.withSpanNulls(false), + databaseReadStallDurationPanel: + commonlib.panels.generic.timeSeries.base.new( + 'Database read stall duration', + targets=[], + description='The current stall (latency) for database reads.' + ) + + g.panel.timeSeries.standardOptions.withUnit('s') + + g.panel.timeSeries.fieldConfig.defaults.custom.withFillOpacity(0) + + g.panel.timeSeries.fieldConfig.defaults.custom.withSpanNulls(false), + transactionLogExpansionsPanel: + commonlib.panels.generic.timeSeries.base.new( + 'Transaction log expansions', + targets=[], + description='Number of times the transaction log has been expanded for a database.' + ) + + g.panel.timeSeries.standardOptions.withUnit('expansions') + + g.panel.timeSeries.fieldConfig.defaults.custom.withFillOpacity(0) + + g.panel.timeSeries.fieldConfig.defaults.custom.withSpanNulls(false), + pageFileMemoryPanel: + commonlib.panels.generic.timeSeries.base.new( + 'Page file memory', + targets=[], + description='Memory used for the OS page file.' + ) + + g.panel.timeSeries.standardOptions.withUnit('bytes') + + g.panel.timeSeries.fieldConfig.defaults.custom.withFillOpacity(50) + + g.panel.timeSeries.fieldConfig.defaults.custom.withSpanNulls(false), + bufferCacheHitPercentagePanel: + commonlib.panels.generic.timeSeries.base.new( + 'Buffer cache hit percentage', + targets=[], + description='Percentage of page found and read from the SQL Server buffer cache.' + ) + + g.panel.timeSeries.standardOptions.withUnit('percent') + + g.panel.timeSeries.fieldConfig.defaults.custom.withFillOpacity(0) + + g.panel.timeSeries.fieldConfig.defaults.custom.withSpanNulls(false), + pageCheckpointsPanel: + commonlib.panels.generic.timeSeries.base.new( + 'Page checkpoints', + targets=[], + description='Rate of page checkpoints per second.' + ) + + g.panel.timeSeries.standardOptions.withUnit('checkpoints/s') + + g.panel.timeSeries.fieldConfig.defaults.custom.withFillOpacity(0) + + g.panel.timeSeries.fieldConfig.defaults.custom.withSpanNulls(false), + pageFaultsPanel: + commonlib.panels.generic.timeSeries.base.new( + 'Page faults', + targets=[], + description='The number of page faults that were incurred by the SQL Server process.' + ) + + g.panel.timeSeries.standardOptions.withUnit('faults') + + g.panel.timeSeries.fieldConfig.defaults.custom.withFillOpacity(0) + + g.panel.timeSeries.fieldConfig.defaults.custom.withSpanNulls(false) + } +} \ No newline at end of file diff --git a/mssql-mixin-candidate/rows.libsonnet b/mssql-mixin-candidate/rows.libsonnet new file mode 100644 index 000000000..ed7a97c93 --- /dev/null +++ b/mssql-mixin-candidate/rows.libsonnet @@ -0,0 +1,53 @@ +local g = import './g.libsonnet'; + +// Use g.util.grid.wrapPanels() to import into custom dashboard +{ + new(panels): { + row_1: + [ + g.panel.row.new('Row 1'), + panels.connectionsPanel { gridPos+: { h: 8, w: 12, x: 0, y: 0 } }, + panels.batchRequestsPanel { gridPos+: { h: 8, w: 12, x: 12, y: 0 } }, + ], + + row_2: + [ + g.panel.row.new('Row 2'), + panels.severeErrorsPanel { gridPos+: { h: 8, w: 12, x: 0, y: 8 } }, + panels.deadlocksPanel { gridPos+: { h: 8, w: 12, x: 12, y: 8 } }, + ], + + row_3: + [ + g.panel.row.new('Row 3'), + panels.osMemoryUsagePanel { gridPos+: { h: 8, w: 24, x: 0, y: 16 } }, + ], + + row_4: + [ + g.panel.row.new('Row 4'), + panels.memoryManagerPanel { gridPos+: { h: 8, w: 16, x: 0, y: 24 } }, + panels.committedMemoryUtilizationPanel { gridPos+: { h: 8, w: 8, x: 16, y: 24 } }, + ], + + row_5: + [ + g.panel.row.new('Row 5'), + panels.errorLogsPanel { gridPos+: { h: 8, w: 24, x: 0, y: 32 } }, + ], + + row_6: + [ + g.panel.row.new('Row 6'), + panels.databaseWriteStallDurationPanel { gridPos+: { h: 8, w: 12, x: 0, y: 41 } }, + panels.databaseReadStallDurationPanel { gridPos+: { h: 8, w: 12, x: 12, y: 41 } }, + ], + + row_7: + [ + g.panel.row.new('Row 7'), + panels.transactionLogExpansionsPanel { gridPos+: { h: 8, w: 24, x: 0, y: 49 } }, + ], + + }, +} \ No newline at end of file diff --git a/mssql-mixin-candidate/targets.libsonnet b/mssql-mixin-candidate/targets.libsonnet new file mode 100644 index 000000000..a6f0d5340 --- /dev/null +++ b/mssql-mixin-candidate/targets.libsonnet @@ -0,0 +1,16 @@ +local g = import './g.libsonnet'; +local prometheusQuery = g.query.prometheus; +local commonlib = import 'common-lib/common/main.libsonnet'; +local utils = commonlib.utils { + labelsToPanelLegend(labels): std.join(' - ', ['{{%s}}' % [label] for label in labels]), +}; + +{ + new(this): { + local vars = this.grafana.variables, + local config = this.config, + // Main selector from old config: multiclusterSelector + local selectorVar = vars.multiclusterSelector, + + }, +} \ No newline at end of file diff --git a/mssql-mixin-candidate/variables.libsonnet b/mssql-mixin-candidate/variables.libsonnet new file mode 100644 index 000000000..0c262c061 --- /dev/null +++ b/mssql-mixin-candidate/variables.libsonnet @@ -0,0 +1,78 @@ +local g = import './g.libsonnet'; +local var = g.dashboard.variable; +local commonlib = import 'common-lib/common/main.libsonnet'; +local utils = commonlib.utils; + +// Generates chained variables to use on all dashboards +{ + new(this, varMetric): + { + local filteringSelector = this.config.filteringSelector, + local groupLabels = this.config.groupLabels, + local instanceLabels = this.config.instanceLabels, + local nodeNameLabel = if std.objectHas(this.config, 'nodeNameLabel') then this.config.nodeNameLabel else ['node'], + local testNameLabel = if std.objectHas(this.config, 'testNameLabel') then this.config.testNameLabel else ['test'], + + local root = self, + local variablesFromLabels(groupLabels, instanceLabels, filteringSelector, multiInstance=true) = + local chainVarProto(index, chainVar) = + var.query.new(chainVar.label) + + var.query.withDatasourceFromVariable(root.datasources.prometheus) + + var.query.queryTypes.withLabelValues( + chainVar.label, + '%s{%s}' % [varMetric, chainVar.chainSelector], + ) + + var.query.generalOptions.withLabel(utils.toSentenceCase(chainVar.label)) + + var.query.selectionOptions.withIncludeAll( + value=true, + customAllValue='.+' + ) + + var.query.selectionOptions.withMulti(true) + + var.query.refresh.onTime() + + var.query.withSort( + i=1, + type='alphabetical', + asc=true, + caseInsensitive=false + ); + std.mapWithIndex(chainVarProto, utils.chainLabels(groupLabels + instanceLabels, [filteringSelector])), + datasources: { + prometheus: + var.datasource.new('prometheus_datasource', 'prometheus') + + var.datasource.generalOptions.withLabel('Prometheus data source') + + var.datasource.withRegex(''), + loki: + var.datasource.new('loki_datasource', 'loki') + + var.datasource.generalOptions.withLabel('Loki data source') + + var.datasource.withRegex(''), + }, + + multiInstance: + [root.datasources.prometheus] + + variablesFromLabels(groupLabels, instanceLabels, filteringSelector), + + singleInstance: + [root.datasources.prometheus] + + variablesFromLabels(groupLabels, instanceLabels, filteringSelector, multiInstance=false), + + overviewVariables: + [root.datasources.prometheus] + + variablesFromLabels(groupLabels, instanceLabels + testNameLabel, filteringSelector, multiInstance=true), + + queriesSelector: + '%s' % [ + utils.labelsToPromQLSelector(groupLabels), + ], + + testNameSelector: + '%s' % [ + utils.labelsToPromQLSelector(groupLabels + instanceLabels + testNameLabel), + ], + + nodeNameSelector: + '%s' % [ + utils.labelsToPromQLSelector(groupLabels + instanceLabels + nodeNameLabel), + ], + + }, +} \ No newline at end of file From c35de19f52b836e7b358e81fcc2742a8150da285 Mon Sep 17 00:00:00 2001 From: Kiarah Pettaway <206043063+kpetta1@users.noreply.github.com> Date: Fri, 23 May 2025 14:40:16 -0400 Subject: [PATCH 2/3] fixed spaces --- mssql-mixin-candidate/alerts.libsonnet | 2 +- mssql-mixin-candidate/config.libsonnet | 2 +- mssql-mixin-candidate/dashboards.libsonnet | 2 +- mssql-mixin-candidate/g.libsonnet | 2 +- mssql-mixin-candidate/links.libsonnet | 2 +- mssql-mixin-candidate/main.libsonnet | 2 +- mssql-mixin-candidate/mixin.libsonnet | 2 +- mssql-mixin-candidate/panels.libsonnet | 2 +- mssql-mixin-candidate/rows.libsonnet | 2 +- mssql-mixin-candidate/targets.libsonnet | 2 +- mssql-mixin-candidate/variables.libsonnet | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/mssql-mixin-candidate/alerts.libsonnet b/mssql-mixin-candidate/alerts.libsonnet index 881faee4f..e753ab759 100644 --- a/mssql-mixin-candidate/alerts.libsonnet +++ b/mssql-mixin-candidate/alerts.libsonnet @@ -16,4 +16,4 @@ // }, // }, }, -} \ No newline at end of file +} diff --git a/mssql-mixin-candidate/config.libsonnet b/mssql-mixin-candidate/config.libsonnet index e27a1582c..3db0d9c57 100644 --- a/mssql-mixin-candidate/config.libsonnet +++ b/mssql-mixin-candidate/config.libsonnet @@ -25,4 +25,4 @@ extraLogLabels: [], // Required by logs-lib logsVolumeGroupBy: 'level', showLogsVolume: true, -} \ No newline at end of file +} diff --git a/mssql-mixin-candidate/dashboards.libsonnet b/mssql-mixin-candidate/dashboards.libsonnet index 3445c45d4..2d406dcd9 100644 --- a/mssql-mixin-candidate/dashboards.libsonnet +++ b/mssql-mixin-candidate/dashboards.libsonnet @@ -112,4 +112,4 @@ local logslib = import 'logs-lib/logs/main.libsonnet'; + g.dashboard.time.withFrom(period) + g.dashboard.withVariables(vars) + g.dashboard.withAnnotations(std.objectValues(annotations)), -} \ No newline at end of file +} diff --git a/mssql-mixin-candidate/g.libsonnet b/mssql-mixin-candidate/g.libsonnet index 987f6c54b..f89dcc064 100644 --- a/mssql-mixin-candidate/g.libsonnet +++ b/mssql-mixin-candidate/g.libsonnet @@ -1 +1 @@ -import 'github.com/grafana/grafonnet/gen/grafonnet-v11.0.0/main.libsonnet' \ No newline at end of file +import 'github.com/grafana/grafonnet/gen/grafonnet-v11.0.0/main.libsonnet' diff --git a/mssql-mixin-candidate/links.libsonnet b/mssql-mixin-candidate/links.libsonnet index a4af259c4..e15919d10 100644 --- a/mssql-mixin-candidate/links.libsonnet +++ b/mssql-mixin-candidate/links.libsonnet @@ -33,4 +33,4 @@ local g = import './g.libsonnet'; + link.link.options.withKeepTime(true), } else {}, -} \ No newline at end of file +} diff --git a/mssql-mixin-candidate/main.libsonnet b/mssql-mixin-candidate/main.libsonnet index bea4dc0ef..0d20fd491 100644 --- a/mssql-mixin-candidate/main.libsonnet +++ b/mssql-mixin-candidate/main.libsonnet @@ -31,4 +31,4 @@ local variables = import './variables.libsonnet'; recordingRules: {}, }, }, -} \ No newline at end of file +} diff --git a/mssql-mixin-candidate/mixin.libsonnet b/mssql-mixin-candidate/mixin.libsonnet index 9f44a31f5..2dee094d1 100644 --- a/mssql-mixin-candidate/mixin.libsonnet +++ b/mssql-mixin-candidate/mixin.libsonnet @@ -15,4 +15,4 @@ local mssql = grafanaDashboards+:: mssql.grafana.dashboards, prometheusAlerts+:: mssql.prometheus.alerts, prometheusRules+:: mssql.prometheus.recordingRules, -} \ No newline at end of file +} diff --git a/mssql-mixin-candidate/panels.libsonnet b/mssql-mixin-candidate/panels.libsonnet index 0c1718205..919a34e40 100644 --- a/mssql-mixin-candidate/panels.libsonnet +++ b/mssql-mixin-candidate/panels.libsonnet @@ -138,4 +138,4 @@ local utils = commonlib.utils; + g.panel.timeSeries.fieldConfig.defaults.custom.withFillOpacity(0) + g.panel.timeSeries.fieldConfig.defaults.custom.withSpanNulls(false) } -} \ No newline at end of file +} diff --git a/mssql-mixin-candidate/rows.libsonnet b/mssql-mixin-candidate/rows.libsonnet index ed7a97c93..c889f2ec2 100644 --- a/mssql-mixin-candidate/rows.libsonnet +++ b/mssql-mixin-candidate/rows.libsonnet @@ -50,4 +50,4 @@ local g = import './g.libsonnet'; ], }, -} \ No newline at end of file +} diff --git a/mssql-mixin-candidate/targets.libsonnet b/mssql-mixin-candidate/targets.libsonnet index a6f0d5340..302df3867 100644 --- a/mssql-mixin-candidate/targets.libsonnet +++ b/mssql-mixin-candidate/targets.libsonnet @@ -13,4 +13,4 @@ local utils = commonlib.utils { local selectorVar = vars.multiclusterSelector, }, -} \ No newline at end of file +} diff --git a/mssql-mixin-candidate/variables.libsonnet b/mssql-mixin-candidate/variables.libsonnet index 0c262c061..cf6a091c5 100644 --- a/mssql-mixin-candidate/variables.libsonnet +++ b/mssql-mixin-candidate/variables.libsonnet @@ -75,4 +75,4 @@ local utils = commonlib.utils; ], }, -} \ No newline at end of file +} From 92dfccaebfbabe865969f44f87dd3a65b339e15e Mon Sep 17 00:00:00 2001 From: Kiarah Pettaway <206043063+kpetta1@users.noreply.github.com> Date: Fri, 23 May 2025 14:49:07 -0400 Subject: [PATCH 3/3] fix lint p2 --- mssql-mixin-candidate/panels.libsonnet | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mssql-mixin-candidate/panels.libsonnet b/mssql-mixin-candidate/panels.libsonnet index 919a34e40..e1bf31b29 100644 --- a/mssql-mixin-candidate/panels.libsonnet +++ b/mssql-mixin-candidate/panels.libsonnet @@ -136,6 +136,6 @@ local utils = commonlib.utils; ) + g.panel.timeSeries.standardOptions.withUnit('faults') + g.panel.timeSeries.fieldConfig.defaults.custom.withFillOpacity(0) - + g.panel.timeSeries.fieldConfig.defaults.custom.withSpanNulls(false) - } + + g.panel.timeSeries.fieldConfig.defaults.custom.withSpanNulls(false), + }, }