diff --git a/jsonnetfile.json b/jsonnetfile.json index 3914849de..2d56d9124 100644 --- a/jsonnetfile.json +++ b/jsonnetfile.json @@ -1,15 +1,6 @@ { "version": 1, "dependencies": [ - { - "source": { - "git": { - "remote": "https://github.com/grafana/grafonnet-lib.git", - "subdir": "grafonnet" - } - }, - "version": "master" - }, { "source": { "git": { @@ -18,15 +9,6 @@ } }, "version": "main" - }, - { - "source": { - "git": { - "remote": "https://github.com/grafana/jsonnet-libs.git", - "subdir": "grafana-builder" - } - }, - "version": "02db06f540086fa3f67d487bd01e1b314853fb8f" } ], "legacyImports": false diff --git a/lib/promgrafonnet/gauge.libsonnet b/lib/promgrafonnet/gauge.libsonnet deleted file mode 100644 index ee76985cf..000000000 --- a/lib/promgrafonnet/gauge.libsonnet +++ /dev/null @@ -1,60 +0,0 @@ -local grafana = import 'github.com/grafana/grafonnet-lib/grafonnet/grafana.libsonnet'; -local singlestat = grafana.singlestat; -local prometheus = grafana.prometheus; - -{ - new(title, query):: - singlestat.new( - title, - datasource='$datasource', - span=3, - format='percent', - valueName='current', - colors=[ - 'rgba(245, 54, 54, 0.9)', - 'rgba(237, 129, 40, 0.89)', - 'rgba(50, 172, 45, 0.97)', - ], - thresholds='50, 80', - valueMaps=[ - { - op: '=', - text: 'N/A', - value: 'null', - }, - ], - ) - .addTarget( - prometheus.target( - query - ) - ) + { - gauge: { - maxValue: 100, - minValue: 0, - show: true, - thresholdLabels: false, - thresholdMarkers: true, - }, - withTextNullValue(text):: self { - valueMaps: [ - { - op: '=', - text: text, - value: 'null', - }, - ], - }, - withSpanSize(size):: self { - span: size, - }, - withLowerBeingBetter():: self { - colors: [ - 'rgba(50, 172, 45, 0.97)', - 'rgba(237, 129, 40, 0.89)', - 'rgba(245, 54, 54, 0.9)', - ], - thresholds: '80, 90', - }, - }, -} diff --git a/lib/promgrafonnet/numbersinglestat.libsonnet b/lib/promgrafonnet/numbersinglestat.libsonnet deleted file mode 100644 index 71a2525aa..000000000 --- a/lib/promgrafonnet/numbersinglestat.libsonnet +++ /dev/null @@ -1,48 +0,0 @@ -local grafana = import 'github.com/grafana/grafonnet-lib/grafonnet/grafana.libsonnet'; -local singlestat = grafana.singlestat; -local prometheus = grafana.prometheus; - -{ - new(title, query):: - singlestat.new( - title, - datasource='$datasource', - span=3, - valueName='current', - valueMaps=[ - { - op: '=', - text: '0', - value: 'null', - }, - ], - ) - .addTarget( - prometheus.target( - query - ) - ) + { - withTextNullValue(text):: self { - valueMaps: [ - { - op: '=', - text: text, - value: 'null', - }, - ], - }, - withSpanSize(size):: self { - span: size, - }, - withPostfix(postfix):: self { - postfix: postfix, - }, - withSparkline():: self { - sparkline: { - show: true, - lineColor: 'rgb(31, 120, 193)', - fillColor: 'rgba(31, 118, 189, 0.18)', - }, - }, - }, -} diff --git a/lib/promgrafonnet/promgrafonnet.libsonnet b/lib/promgrafonnet/promgrafonnet.libsonnet deleted file mode 100644 index 8b74e36e6..000000000 --- a/lib/promgrafonnet/promgrafonnet.libsonnet +++ /dev/null @@ -1,4 +0,0 @@ -{ - numbersinglestat:: import 'numbersinglestat.libsonnet', - gauge:: import 'gauge.libsonnet', -}