diff --git a/Makefile b/Makefile index 512d7dbe..5f3a0837 100644 --- a/Makefile +++ b/Makefile @@ -62,3 +62,8 @@ down-all: down install_goreleaser: go install github.com/goreleaser/goreleaser@latest + + +.PHONY: schemas +schemas: + go run ./cmd/generate-jsonschema/*.go diff --git a/cmd/generate-jsonschema/main.go b/cmd/generate-jsonschema/main.go new file mode 100644 index 00000000..29f72d5b --- /dev/null +++ b/cmd/generate-jsonschema/main.go @@ -0,0 +1,50 @@ +package main + +import ( + "encoding/json" + "fmt" + "os" + "strings" + + "github.com/K-Phoen/grabana/decoder" + "github.com/invopop/jsonschema" +) + +func main() { + types := []struct { + name string + input any + }{ + { + name: "dashboard", + input: &decoder.DashboardModel{}, + }, + } + + for _, t := range types { + fmt.Printf("Generating schema for type '%s'\n", t.name) + + reflector := &jsonschema.Reflector{ + RequiredFromJSONSchemaTags: true, // we don't have good information as to what is required :/ + FieldNameTag: "yaml", + KeyNamer: func(key string) string { + if strings.ToUpper(string(key[0])) == string(key[0]) { + return strings.ToLower(key) + } + + return key + }, + } + schema := reflector.Reflect(t.input) + schema.ID = jsonschema.ID(fmt.Sprintf("https://raw.githubusercontent.com/K-Phoen/grabana/master/schemas/%s.json", t.name)) + + schemaJSON, err := json.MarshalIndent(schema, "", " ") + if err != nil { + panic(fmt.Errorf("could not marshal schema to JSON: %w", err)) + } + + if err := os.WriteFile(fmt.Sprintf("./schemas/%s.json", t.name), schemaJSON, 0644); err != nil { + panic(fmt.Errorf("could not write schema: %w", err)) + } + } +} diff --git a/examples/dashboard.yaml b/examples/dashboard.yaml index 51958051..dd885457 100644 --- a/examples/dashboard.yaml +++ b/examples/dashboard.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/K-Phoen/grabana/master/schemas/dashboard.json + title: Awesome dashboard editable: true diff --git a/examples/logs-panel.yaml b/examples/logs-panel.yaml index 8cd75ded..9d3d3034 100644 --- a/examples/logs-panel.yaml +++ b/examples/logs-panel.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/K-Phoen/grabana/master/schemas/dashboard.json + title: Loki logs editable: true shared_crosshair: true diff --git a/examples/stat-panel.yaml b/examples/stat-panel.yaml index 6ba579f7..e76abc3a 100644 --- a/examples/stat-panel.yaml +++ b/examples/stat-panel.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/K-Phoen/grabana/master/schemas/dashboard.json + title: Dashboard with stat panel editable: true diff --git a/go.mod b/go.mod index e51f0527..244f9928 100644 --- a/go.mod +++ b/go.mod @@ -15,6 +15,8 @@ require ( ) require ( + github.com/bahlo/generic-list-go v0.2.0 // indirect + github.com/buger/jsonparser v1.1.1 // indirect github.com/dave/jennifer v1.7.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/golang/protobuf v1.5.3 // indirect @@ -24,10 +26,13 @@ require ( github.com/gosimple/unidecode v1.0.1 // indirect github.com/inconshreveable/go-update v0.0.0-20160112193335-8152e7eb6ccf // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect + github.com/invopop/jsonschema v0.12.0 // indirect + github.com/mailru/easyjson v0.7.7 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/tcnksm/go-gitconfig v0.1.2 // indirect github.com/ulikunitz/xz v0.5.11 // indirect + github.com/wk8/go-ordered-map/v2 v2.1.8 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/crypto v0.17.0 // indirect golang.org/x/oauth2 v0.15.0 // indirect diff --git a/go.sum b/go.sum index efc89b18..9927f696 100644 --- a/go.sum +++ b/go.sum @@ -2,8 +2,12 @@ github.com/K-Phoen/jennifer v0.0.0-20230811102814-e6c78cf40086 h1:cvgm5R+2OIaCzM github.com/K-Phoen/jennifer v0.0.0-20230811102814-e6c78cf40086/go.mod h1:rm3gx5yYxh/Q3ynk+qaNoN6nQiII0Vn/uz46bIgj0P0= github.com/K-Phoen/sdk v0.12.4 h1:j2EYuBJm3zDTD0fGKACVFWxAXtkR0q5QzfVqxmHSeGQ= github.com/K-Phoen/sdk v0.12.4/go.mod h1:qmM0wO23CtoDux528MXPpYvS4XkRWkWX6rvX9Za8EVU= +github.com/bahlo/generic-list-go v0.2.0 h1:5sz/EEAK+ls5wF+NeqDpk5+iNdMDXrh3z3nPnH1Wvgk= +github.com/bahlo/generic-list-go v0.2.0/go.mod h1:2KvAjgMlE5NNynlg/5iLrrCCZ2+5xWbdbCW3pNTGyYg= github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ= github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= +github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMUs= +github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/dave/jennifer v1.7.0 h1:uRbSBH9UTS64yXbh4FrMHfgfY762RD+C7bUPKODpSJE= github.com/dave/jennifer v1.7.0/go.mod h1:nXbxhEmQfOZhWml3D1cDK5M1FLnMSozpbFN/m3RmGZc= @@ -33,11 +37,16 @@ github.com/inconshreveable/go-update v0.0.0-20160112193335-8152e7eb6ccf h1:WfD7V github.com/inconshreveable/go-update v0.0.0-20160112193335-8152e7eb6ccf/go.mod h1:hyb9oH7vZsitZCiBt0ZvifOrB+qc8PS5IiilCIb87rg= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= +github.com/invopop/jsonschema v0.12.0 h1:6ovsNSuvn9wEQVOyc72aycBMVQFKz7cPdMJn10CvzRI= +github.com/invopop/jsonschema v0.12.0/go.mod h1:ffZ5Km5SWWRAIN6wbDXItl95euhFz2uON45H2qjYt+0= +github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= +github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/gomega v1.4.2 h1:3mYCb7aPxS/RU7TI1y4rkEn1oKmPRjNJLNEXgw7MH2I= github.com/onsi/gomega v1.4.2/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= @@ -59,6 +68,8 @@ github.com/tcnksm/go-gitconfig v0.1.2/go.mod h1:/8EhP4H7oJZdIPyT+/UIsG87kTzrzM4U github.com/ulikunitz/xz v0.5.9/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/ulikunitz/xz v0.5.11 h1:kpFauv27b6ynzBNT/Xy+1k+fK4WswhN/6PN5WhFAGw8= github.com/ulikunitz/xz v0.5.11/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= +github.com/wk8/go-ordered-map/v2 v2.1.8 h1:5h/BUHu93oj4gIdvHHHGsScSTMijfx5PeYkE/fJgbpc= +github.com/wk8/go-ordered-map/v2 v2.1.8/go.mod h1:5nJHM5DyteebpVlHnWMV0rPz6Zp7+xBAnxjb1X5vnTw= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= go.uber.org/goleak v1.2.0 h1:xqgm/S+aQvhWFTtR0XK3Jvg7z8kGV8P4X14IzwN3Eqk= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= diff --git a/schemas/dashboard.json b/schemas/dashboard.json new file mode 100644 index 00000000..af7c5d6d --- /dev/null +++ b/schemas/dashboard.json @@ -0,0 +1,1691 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/K-Phoen/grabana/master/schemas/dashboard.json", + "$ref": "#/$defs/DashboardModel", + "$defs": { + "Aggregation": { + "properties": { + "label": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "Alert": { + "properties": { + "summary": { + "type": "string" + }, + "description": { + "type": "string" + }, + "runbook": { + "type": "string" + }, + "tags": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "evaluate_every": { + "type": "string" + }, + "for": { + "type": "string" + }, + "on_no_data": { + "type": "string" + }, + "on_execution_error": { + "type": "string" + }, + "if": { + "items": { + "$ref": "#/$defs/AlertCondition" + }, + "type": "array" + }, + "targets": { + "items": { + "$ref": "#/$defs/AlertTarget" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object" + }, + "AlertCondition": { + "properties": { + "operand": { + "type": "string" + }, + "avg": { + "type": "string" + }, + "sum": { + "type": "string" + }, + "count": { + "type": "string" + }, + "last": { + "type": "string" + }, + "min": { + "type": "string" + }, + "max": { + "type": "string" + }, + "median": { + "type": "string" + }, + "diff": { + "type": "string" + }, + "percent_diff": { + "type": "string" + }, + "has_no_value": { + "type": "boolean" + }, + "above": { + "type": "number" + }, + "below": { + "type": "number" + }, + "outside_range": { + "items": { + "type": "number" + }, + "type": "array", + "maxItems": 2, + "minItems": 2 + }, + "within_range": { + "items": { + "type": "number" + }, + "type": "array", + "maxItems": 2, + "minItems": 2 + } + }, + "additionalProperties": false, + "type": "object" + }, + "AlertGraphite": { + "properties": { + "ref": { + "type": "string" + }, + "query": { + "type": "string" + }, + "lookback": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "AlertLoki": { + "properties": { + "ref": { + "type": "string" + }, + "query": { + "type": "string" + }, + "legend": { + "type": "string" + }, + "lookback": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "AlertPrometheus": { + "properties": { + "ref": { + "type": "string" + }, + "query": { + "type": "string" + }, + "legend": { + "type": "string" + }, + "lookback": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "AlertStackdriver": { + "properties": { + "ref": { + "type": "string" + }, + "lookback": { + "type": "string" + }, + "project": { + "type": "string" + }, + "type": { + "type": "string" + }, + "metric": { + "type": "string" + }, + "filters": { + "$ref": "#/$defs/StackdriverAlertFilters" + }, + "aggregation": { + "type": "string" + }, + "alignment": { + "$ref": "#/$defs/StackdriverAlertAlignment" + }, + "legend": { + "type": "string" + }, + "preprocessor": { + "type": "string" + }, + "hidden": { + "type": "boolean" + }, + "group_by": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object" + }, + "AlertTarget": { + "properties": { + "prometheus": { + "$ref": "#/$defs/AlertPrometheus" + }, + "loki": { + "$ref": "#/$defs/AlertLoki" + }, + "graphite": { + "$ref": "#/$defs/AlertGraphite" + }, + "stackdriver": { + "$ref": "#/$defs/AlertStackdriver" + } + }, + "additionalProperties": false, + "type": "object" + }, + "DashboardExternalLink": { + "properties": { + "title": { + "type": "string" + }, + "url": { + "type": "string" + }, + "description": { + "type": "string" + }, + "icon": { + "type": "string" + }, + "include_time_range": { + "type": "boolean" + }, + "include_variable_values": { + "type": "boolean" + }, + "open_in_new_tab": { + "type": "boolean" + } + }, + "additionalProperties": false, + "type": "object" + }, + "DashboardGauge": { + "properties": { + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "span": { + "type": "number" + }, + "height": { + "type": "string" + }, + "transparent": { + "type": "boolean" + }, + "datasource": { + "type": "string" + }, + "repeat": { + "type": "string" + }, + "repeat_direction": { + "type": "string" + }, + "links": { + "$ref": "#/$defs/DashboardPanelLinks" + }, + "targets": { + "items": { + "$ref": "#/$defs/Target" + }, + "type": "array" + }, + "unit": { + "type": "string" + }, + "decimals": { + "type": "integer" + }, + "orientation": { + "type": "string" + }, + "value_type": { + "type": "string" + }, + "title_font_size": { + "type": "integer" + }, + "value_font_size": { + "type": "integer" + }, + "threshold_mode": { + "type": "string" + }, + "thresholds": { + "items": { + "$ref": "#/$defs/GaugeThresholdStep" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object" + }, + "DashboardGraph": { + "properties": { + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "span": { + "type": "number" + }, + "height": { + "type": "string" + }, + "transparent": { + "type": "boolean" + }, + "datasource": { + "type": "string" + }, + "repeat": { + "type": "string" + }, + "repeat_direction": { + "type": "string" + }, + "targets": { + "items": { + "$ref": "#/$defs/Target" + }, + "type": "array" + }, + "links": { + "$ref": "#/$defs/DashboardPanelLinks" + }, + "axes": { + "$ref": "#/$defs/GraphAxes" + }, + "legend": { + "items": { + "type": "string" + }, + "type": "array" + }, + "alert": { + "$ref": "#/$defs/Alert" + }, + "visualization": { + "$ref": "#/$defs/GraphVisualization" + } + }, + "additionalProperties": false, + "type": "object" + }, + "DashboardHeatmap": { + "properties": { + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "span": { + "type": "number" + }, + "height": { + "type": "string" + }, + "transparent": { + "type": "boolean" + }, + "datasource": { + "type": "string" + }, + "repeat": { + "type": "string" + }, + "repeat_direction": { + "type": "string" + }, + "data_format": { + "type": "string" + }, + "hide_zero_buckets": { + "type": "boolean" + }, + "highlight_cards": { + "type": "boolean" + }, + "links": { + "$ref": "#/$defs/DashboardPanelLinks" + }, + "targets": { + "items": { + "$ref": "#/$defs/Target" + }, + "type": "array" + }, + "reverse_y_buckets": { + "type": "boolean" + }, + "tooltip": { + "$ref": "#/$defs/HeatmapTooltip" + }, + "yaxis": { + "$ref": "#/$defs/HeatmapYAxis" + } + }, + "additionalProperties": false, + "type": "object" + }, + "DashboardInternalLink": { + "properties": { + "title": { + "type": "string" + }, + "tags": { + "items": { + "type": "string" + }, + "type": "array" + }, + "as_dropdown": { + "type": "boolean" + }, + "include_time_range": { + "type": "boolean" + }, + "include_variable_values": { + "type": "boolean" + }, + "open_in_new_tab": { + "type": "boolean" + } + }, + "additionalProperties": false, + "type": "object" + }, + "DashboardLogs": { + "properties": { + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "span": { + "type": "number" + }, + "height": { + "type": "string" + }, + "transparent": { + "type": "boolean" + }, + "datasource": { + "type": "string" + }, + "repeat": { + "type": "string" + }, + "repeat_direction": { + "type": "string" + }, + "links": { + "$ref": "#/$defs/DashboardPanelLinks" + }, + "targets": { + "items": { + "$ref": "#/$defs/LogsTarget" + }, + "type": "array" + }, + "visualization": { + "$ref": "#/$defs/LogsVisualization" + } + }, + "additionalProperties": false, + "type": "object" + }, + "DashboardModel": { + "properties": { + "title": { + "type": "string" + }, + "slug": { + "type": "string" + }, + "uid": { + "type": "string" + }, + "editable": { + "type": "boolean" + }, + "shared_crosshair": { + "type": "boolean" + }, + "tags": { + "items": { + "type": "string" + }, + "type": "array" + }, + "auto_refresh": { + "type": "string" + }, + "time": { + "items": { + "type": "string" + }, + "type": "array", + "maxItems": 2, + "minItems": 2 + }, + "timezone": { + "type": "string" + }, + "tags_annotations": { + "items": { + "$ref": "#/$defs/TagAnnotation" + }, + "type": "array" + }, + "variables": { + "items": { + "$ref": "#/$defs/DashboardVariable" + }, + "type": "array" + }, + "external_links": { + "items": { + "$ref": "#/$defs/DashboardExternalLink" + }, + "type": "array" + }, + "dashboard_links": { + "items": { + "$ref": "#/$defs/DashboardInternalLink" + }, + "type": "array" + }, + "rows": { + "items": { + "$ref": "#/$defs/DashboardRow" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object" + }, + "DashboardPanel": { + "properties": { + "graph": { + "$ref": "#/$defs/DashboardGraph" + }, + "table": { + "$ref": "#/$defs/DashboardTable" + }, + "single_stat": { + "$ref": "#/$defs/DashboardSingleStat" + }, + "stat": { + "$ref": "#/$defs/DashboardStat" + }, + "text": { + "$ref": "#/$defs/DashboardText" + }, + "heatmap": { + "$ref": "#/$defs/DashboardHeatmap" + }, + "timeseries": { + "$ref": "#/$defs/DashboardTimeSeries" + }, + "logs": { + "$ref": "#/$defs/DashboardLogs" + }, + "gauge": { + "$ref": "#/$defs/DashboardGauge" + } + }, + "additionalProperties": false, + "type": "object" + }, + "DashboardPanelLink": { + "properties": { + "title": { + "type": "string" + }, + "url": { + "type": "string" + }, + "open_in_new_tab": { + "type": "boolean" + } + }, + "additionalProperties": false, + "type": "object" + }, + "DashboardPanelLinks": { + "items": { + "$ref": "#/$defs/DashboardPanelLink" + }, + "type": "array" + }, + "DashboardRow": { + "properties": { + "name": { + "type": "string" + }, + "repeat_for": { + "type": "string" + }, + "collapse": { + "type": "boolean" + }, + "hide_title": { + "type": "boolean" + }, + "panels": { + "items": { + "$ref": "#/$defs/DashboardPanel" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object" + }, + "DashboardSingleStat": { + "properties": { + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "span": { + "type": "number" + }, + "height": { + "type": "string" + }, + "transparent": { + "type": "boolean" + }, + "datasource": { + "type": "string" + }, + "repeat": { + "type": "string" + }, + "repeat_direction": { + "type": "string" + }, + "links": { + "$ref": "#/$defs/DashboardPanelLinks" + }, + "unit": { + "type": "string" + }, + "decimals": { + "type": "integer" + }, + "value_type": { + "type": "string" + }, + "value_font_size": { + "type": "string" + }, + "prefix_font_size": { + "type": "string" + }, + "postfix_font_size": { + "type": "string" + }, + "sparkline": { + "type": "string" + }, + "targets": { + "items": { + "$ref": "#/$defs/Target" + }, + "type": "array" + }, + "thresholds": { + "items": { + "type": "string" + }, + "type": "array", + "maxItems": 2, + "minItems": 2 + }, + "colors": { + "items": { + "type": "string" + }, + "type": "array", + "maxItems": 3, + "minItems": 3 + }, + "color": { + "items": { + "type": "string" + }, + "type": "array" + }, + "ranges_to_text": { + "items": { + "$ref": "#/$defs/RangeMap" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object" + }, + "DashboardStat": { + "properties": { + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "span": { + "type": "number" + }, + "height": { + "type": "string" + }, + "transparent": { + "type": "boolean" + }, + "datasource": { + "type": "string" + }, + "repeat": { + "type": "string" + }, + "repeat_direction": { + "type": "string" + }, + "links": { + "$ref": "#/$defs/DashboardPanelLinks" + }, + "targets": { + "items": { + "$ref": "#/$defs/Target" + }, + "type": "array" + }, + "unit": { + "type": "string" + }, + "decimals": { + "type": "integer" + }, + "sparkline": { + "type": "boolean" + }, + "orientation": { + "type": "string" + }, + "text": { + "type": "string" + }, + "value_type": { + "type": "string" + }, + "color_mode": { + "type": "string" + }, + "title_font_size": { + "type": "integer" + }, + "value_font_size": { + "type": "integer" + }, + "threshold_mode": { + "type": "string" + }, + "thresholds": { + "items": { + "$ref": "#/$defs/StatThresholdStep" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object" + }, + "DashboardTable": { + "properties": { + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "span": { + "type": "number" + }, + "height": { + "type": "string" + }, + "transparent": { + "type": "boolean" + }, + "datasource": { + "type": "string" + }, + "links": { + "$ref": "#/$defs/DashboardPanelLinks" + }, + "targets": { + "items": { + "$ref": "#/$defs/Target" + }, + "type": "array" + }, + "hidden_columns": { + "items": { + "type": "string" + }, + "type": "array" + }, + "time_series_aggregations": { + "items": { + "$ref": "#/$defs/Aggregation" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object" + }, + "DashboardText": { + "properties": { + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "span": { + "type": "number" + }, + "height": { + "type": "string" + }, + "transparent": { + "type": "boolean" + }, + "links": { + "$ref": "#/$defs/DashboardPanelLinks" + }, + "html": { + "type": "string" + }, + "markdown": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "DashboardTimeSeries": { + "properties": { + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "span": { + "type": "number" + }, + "height": { + "type": "string" + }, + "transparent": { + "type": "boolean" + }, + "datasource": { + "type": "string" + }, + "repeat": { + "type": "string" + }, + "repeat_direction": { + "type": "string" + }, + "links": { + "$ref": "#/$defs/DashboardPanelLinks" + }, + "targets": { + "items": { + "$ref": "#/$defs/Target" + }, + "type": "array" + }, + "legend": { + "items": { + "type": "string" + }, + "type": "array" + }, + "alert": { + "$ref": "#/$defs/Alert" + }, + "visualization": { + "$ref": "#/$defs/TimeSeriesVisualization" + }, + "axis": { + "$ref": "#/$defs/TimeSeriesAxis" + }, + "overrides": { + "items": { + "$ref": "#/$defs/TimeSeriesOverride" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object" + }, + "DashboardVariable": { + "properties": { + "interval": { + "$ref": "#/$defs/VariableInterval" + }, + "custom": { + "$ref": "#/$defs/VariableCustom" + }, + "query": { + "$ref": "#/$defs/VariableQuery" + }, + "const": { + "$ref": "#/$defs/VariableConst" + }, + "datasource": { + "$ref": "#/$defs/VariableDatasource" + }, + "text": { + "$ref": "#/$defs/VariableText" + } + }, + "additionalProperties": false, + "type": "object" + }, + "GaugeThresholdStep": { + "properties": { + "color": { + "type": "string" + }, + "value": { + "type": "number" + } + }, + "additionalProperties": false, + "type": "object" + }, + "GraphAxes": { + "properties": { + "left": { + "$ref": "#/$defs/GraphAxis" + }, + "right": { + "$ref": "#/$defs/GraphAxis" + }, + "bottom": { + "$ref": "#/$defs/GraphAxis" + } + }, + "additionalProperties": false, + "type": "object" + }, + "GraphAxis": { + "properties": { + "hidden": { + "type": "boolean" + }, + "label": { + "type": "string" + }, + "unit": { + "type": "string" + }, + "min": { + "type": "number" + }, + "max": { + "type": "number" + }, + "log_base": { + "type": "integer" + } + }, + "additionalProperties": false, + "type": "object" + }, + "GraphSeriesOverride": { + "properties": { + "alias": { + "type": "string" + }, + "color": { + "type": "string" + }, + "dashes": { + "type": "boolean" + }, + "lines": { + "type": "boolean" + }, + "fill": { + "type": "integer" + }, + "line_width": { + "type": "integer" + } + }, + "additionalProperties": false, + "type": "object" + }, + "GraphVisualization": { + "properties": { + "nullvalue": { + "type": "string" + }, + "staircase": { + "type": "boolean" + }, + "overrides": { + "items": { + "$ref": "#/$defs/GraphSeriesOverride" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object" + }, + "GraphiteTarget": { + "properties": { + "query": { + "type": "string" + }, + "ref": { + "type": "string" + }, + "hidden": { + "type": "boolean" + } + }, + "additionalProperties": false, + "type": "object" + }, + "HeatmapTooltip": { + "properties": { + "show": { + "type": "boolean" + }, + "showhistogram": { + "type": "boolean" + }, + "decimals": { + "type": "integer" + } + }, + "additionalProperties": false, + "type": "object" + }, + "HeatmapYAxis": { + "properties": { + "decimals": { + "type": "integer" + }, + "unit": { + "type": "string" + }, + "max": { + "type": "number" + }, + "min": { + "type": "number" + } + }, + "additionalProperties": false, + "type": "object" + }, + "InfluxDBTarget": { + "properties": { + "query": { + "type": "string" + }, + "ref": { + "type": "string" + }, + "hidden": { + "type": "boolean" + } + }, + "additionalProperties": false, + "type": "object" + }, + "LogsTarget": { + "properties": { + "loki": { + "$ref": "#/$defs/LokiTarget" + } + }, + "additionalProperties": false, + "type": "object" + }, + "LogsVisualization": { + "properties": { + "time": { + "type": "boolean" + }, + "unique_labels": { + "type": "boolean" + }, + "common_labels": { + "type": "boolean" + }, + "wrap_lines": { + "type": "boolean" + }, + "prettify_json": { + "type": "boolean" + }, + "hide_log_details": { + "type": "boolean" + }, + "order": { + "type": "string" + }, + "deduplication": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "LokiTarget": { + "properties": { + "query": { + "type": "string" + }, + "legend": { + "type": "string" + }, + "ref": { + "type": "string" + }, + "hidden": { + "type": "boolean" + } + }, + "additionalProperties": false, + "type": "object" + }, + "PrometheusTarget": { + "properties": { + "query": { + "type": "string" + }, + "legend": { + "type": "string" + }, + "ref": { + "type": "string" + }, + "hidden": { + "type": "boolean" + }, + "format": { + "type": "string" + }, + "instant": { + "type": "boolean" + }, + "interval_factor": { + "type": "integer" + } + }, + "additionalProperties": false, + "type": "object" + }, + "RangeMap": { + "properties": { + "from": { + "type": "string" + }, + "to": { + "type": "string" + }, + "text": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "StackdriverAlertAlignment": { + "properties": { + "method": { + "type": "string" + }, + "period": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "StackdriverAlertFilters": { + "properties": { + "eq": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "neq": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "matches": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "not_matches": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + } + }, + "additionalProperties": false, + "type": "object" + }, + "StackdriverAlignment": { + "properties": { + "method": { + "type": "string" + }, + "period": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "StackdriverFilters": { + "properties": { + "eq": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "neq": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "matches": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "not_matches": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + } + }, + "additionalProperties": false, + "type": "object" + }, + "StackdriverTarget": { + "properties": { + "project": { + "type": "string" + }, + "type": { + "type": "string" + }, + "metric": { + "type": "string" + }, + "filters": { + "$ref": "#/$defs/StackdriverFilters" + }, + "aggregation": { + "type": "string" + }, + "alignment": { + "$ref": "#/$defs/StackdriverAlignment" + }, + "legend": { + "type": "string" + }, + "preprocessor": { + "type": "string" + }, + "ref": { + "type": "string" + }, + "hidden": { + "type": "boolean" + }, + "group_by": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object" + }, + "StatThresholdStep": { + "properties": { + "color": { + "type": "string" + }, + "value": { + "type": "number" + } + }, + "additionalProperties": false, + "type": "object" + }, + "TagAnnotation": { + "properties": { + "name": { + "type": "string" + }, + "datasource": { + "type": "string" + }, + "color": { + "type": "string" + }, + "tags": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object" + }, + "Target": { + "properties": { + "prometheus": { + "$ref": "#/$defs/PrometheusTarget" + }, + "graphite": { + "$ref": "#/$defs/GraphiteTarget" + }, + "influxdb": { + "$ref": "#/$defs/InfluxDBTarget" + }, + "stackdriver": { + "$ref": "#/$defs/StackdriverTarget" + }, + "loki": { + "$ref": "#/$defs/LokiTarget" + } + }, + "additionalProperties": false, + "type": "object" + }, + "TimeSeriesAxis": { + "properties": { + "soft_min": { + "type": "integer" + }, + "soft_max": { + "type": "integer" + }, + "min": { + "type": "number" + }, + "max": { + "type": "number" + }, + "decimals": { + "type": "integer" + }, + "display": { + "type": "string" + }, + "scale": { + "type": "string" + }, + "unit": { + "type": "string" + }, + "label": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "TimeSeriesOverride": { + "properties": { + "match": { + "$ref": "#/$defs/TimeSeriesOverrideMatcher" + }, + "properties": { + "$ref": "#/$defs/TimeSeriesOverrideProperties" + } + }, + "additionalProperties": false, + "type": "object" + }, + "TimeSeriesOverrideMatcher": { + "properties": { + "field_name": { + "type": "string" + }, + "query_ref": { + "type": "string" + }, + "regex": { + "type": "string" + }, + "field_type": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "TimeSeriesOverrideProperties": { + "properties": { + "unit": { + "type": "string" + }, + "color": { + "type": "string" + }, + "fill_opacity": { + "type": "integer" + }, + "negative_Y": { + "type": "boolean" + }, + "axis_display": { + "type": "string" + }, + "stack": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "TimeSeriesVisualization": { + "properties": { + "gradient_mode": { + "type": "string" + }, + "tooltip": { + "type": "string" + }, + "stack": { + "type": "string" + }, + "fill_opacity": { + "type": "integer" + }, + "point_size": { + "type": "integer" + }, + "line_interpolation": { + "type": "string" + }, + "line_width": { + "type": "integer" + } + }, + "additionalProperties": false, + "type": "object" + }, + "VariableConst": { + "properties": { + "name": { + "type": "string" + }, + "label": { + "type": "string" + }, + "default": { + "type": "string" + }, + "values_map": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "hide": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "VariableCustom": { + "properties": { + "name": { + "type": "string" + }, + "label": { + "type": "string" + }, + "default": { + "type": "string" + }, + "values_map": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "include_all": { + "type": "boolean" + }, + "all_value": { + "type": "string" + }, + "hide": { + "type": "string" + }, + "multiple": { + "type": "boolean" + } + }, + "additionalProperties": false, + "type": "object" + }, + "VariableDatasource": { + "properties": { + "name": { + "type": "string" + }, + "label": { + "type": "string" + }, + "type": { + "type": "string" + }, + "regex": { + "type": "string" + }, + "include_all": { + "type": "boolean" + }, + "hide": { + "type": "string" + }, + "multiple": { + "type": "boolean" + } + }, + "additionalProperties": false, + "type": "object" + }, + "VariableInterval": { + "properties": { + "name": { + "type": "string" + }, + "label": { + "type": "string" + }, + "default": { + "type": "string" + }, + "values": { + "items": { + "type": "string" + }, + "type": "array" + }, + "hide": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "VariableQuery": { + "properties": { + "name": { + "type": "string" + }, + "label": { + "type": "string" + }, + "datasource": { + "type": "string" + }, + "request": { + "type": "string" + }, + "regex": { + "type": "string" + }, + "include_all": { + "type": "boolean" + }, + "default_all": { + "type": "boolean" + }, + "all_value": { + "type": "string" + }, + "hide": { + "type": "string" + }, + "multiple": { + "type": "boolean" + } + }, + "additionalProperties": false, + "type": "object" + }, + "VariableText": { + "properties": { + "name": { + "type": "string" + }, + "label": { + "type": "string" + }, + "hide": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + } + } +} \ No newline at end of file