@intentius/chant-lexicon-grafana 0.96.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +50 -0
- package/dist/build.d.ts +116 -0
- package/dist/build.d.ts.map +1 -0
- package/dist/catalog.d.ts +26 -0
- package/dist/catalog.d.ts.map +1 -0
- package/dist/codegen/docs-cli.d.ts +3 -0
- package/dist/codegen/docs-cli.d.ts.map +1 -0
- package/dist/codegen/docs.d.ts +8 -0
- package/dist/codegen/docs.d.ts.map +1 -0
- package/dist/codegen/generate-cli.d.ts +3 -0
- package/dist/codegen/generate-cli.d.ts.map +1 -0
- package/dist/codegen/generate.d.ts +21 -0
- package/dist/codegen/generate.d.ts.map +1 -0
- package/dist/codegen/package.d.ts +7 -0
- package/dist/codegen/package.d.ts.map +1 -0
- package/dist/codegen/schema-types.d.ts +41 -0
- package/dist/codegen/schema-types.d.ts.map +1 -0
- package/dist/composites/agent-dashboard.d.ts +70 -0
- package/dist/composites/agent-dashboard.d.ts.map +1 -0
- package/dist/composites/catalog.d.ts +3 -0
- package/dist/composites/catalog.d.ts.map +1 -0
- package/dist/composites/index.d.ts +12 -0
- package/dist/composites/index.d.ts.map +1 -0
- package/dist/composites/red-dashboard.d.ts +58 -0
- package/dist/composites/red-dashboard.d.ts.map +1 -0
- package/dist/composites/shared.d.ts +68 -0
- package/dist/composites/shared.d.ts.map +1 -0
- package/dist/composites/slo-dashboard.d.ts +62 -0
- package/dist/composites/slo-dashboard.d.ts.map +1 -0
- package/dist/dashboard.d.ts +84 -0
- package/dist/dashboard.d.ts.map +1 -0
- package/dist/datasource.d.ts +67 -0
- package/dist/datasource.d.ts.map +1 -0
- package/dist/detect.d.ts +20 -0
- package/dist/detect.d.ts.map +1 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/integrity.json +22 -0
- package/dist/lint/audit-catalog.d.ts +13 -0
- package/dist/lint/audit-catalog.d.ts.map +1 -0
- package/dist/lint/post-synth/graf101.d.ts +8 -0
- package/dist/lint/post-synth/graf101.d.ts.map +1 -0
- package/dist/lint/post-synth/graf102.d.ts +8 -0
- package/dist/lint/post-synth/graf102.d.ts.map +1 -0
- package/dist/lint/post-synth/graf103.d.ts +8 -0
- package/dist/lint/post-synth/graf103.d.ts.map +1 -0
- package/dist/lint/post-synth/graf104.d.ts +8 -0
- package/dist/lint/post-synth/graf104.d.ts.map +1 -0
- package/dist/lint/post-synth/graf105.d.ts +8 -0
- package/dist/lint/post-synth/graf105.d.ts.map +1 -0
- package/dist/lint/post-synth/graf106.d.ts +8 -0
- package/dist/lint/post-synth/graf106.d.ts.map +1 -0
- package/dist/lint/post-synth/graf107.d.ts +8 -0
- package/dist/lint/post-synth/graf107.d.ts.map +1 -0
- package/dist/lint/post-synth/grafana-helpers.d.ts +16 -0
- package/dist/lint/post-synth/grafana-helpers.d.ts.map +1 -0
- package/dist/lint/post-synth/index.d.ts +3 -0
- package/dist/lint/post-synth/index.d.ts.map +1 -0
- package/dist/lint/rules/grafana-ast.d.ts +21 -0
- package/dist/lint/rules/grafana-ast.d.ts.map +1 -0
- package/dist/lint/rules/index.d.ts +6 -0
- package/dist/lint/rules/index.d.ts.map +1 -0
- package/dist/lint/rules/literal-secret.d.ts +12 -0
- package/dist/lint/rules/literal-secret.d.ts.map +1 -0
- package/dist/lint/rules/uid-syntax.d.ts +12 -0
- package/dist/lint/rules/uid-syntax.d.ts.map +1 -0
- package/dist/lsp/completions.d.ts +4 -0
- package/dist/lsp/completions.d.ts.map +1 -0
- package/dist/lsp/hover.d.ts +4 -0
- package/dist/lsp/hover.d.ts.map +1 -0
- package/dist/manifest.json +8 -0
- package/dist/meta.json +107 -0
- package/dist/okf/index.md +39 -0
- package/dist/okf/rules/GRAF001.md +16 -0
- package/dist/okf/rules/GRAF002.md +15 -0
- package/dist/okf/rules/GRAF101.md +15 -0
- package/dist/okf/rules/GRAF102.md +15 -0
- package/dist/okf/rules/GRAF103.md +11 -0
- package/dist/okf/rules/GRAF104.md +15 -0
- package/dist/okf/rules/GRAF105.md +11 -0
- package/dist/okf/rules/GRAF106.md +11 -0
- package/dist/okf/rules/GRAF107.md +11 -0
- package/dist/okf/types/ConstantVariable.md +9 -0
- package/dist/okf/types/CustomVariable.md +9 -0
- package/dist/okf/types/Dashboard.md +14 -0
- package/dist/okf/types/DashboardProvider.md +9 -0
- package/dist/okf/types/Datasource.md +16 -0
- package/dist/okf/types/DatasourceVariable.md +9 -0
- package/dist/okf/types/GaugePanel.md +9 -0
- package/dist/okf/types/HeatmapPanel.md +9 -0
- package/dist/okf/types/IntervalVariable.md +9 -0
- package/dist/okf/types/LogsPanel.md +9 -0
- package/dist/okf/types/LokiQuery.md +9 -0
- package/dist/okf/types/PromQuery.md +9 -0
- package/dist/okf/types/QueryVariable.md +9 -0
- package/dist/okf/types/Row.md +9 -0
- package/dist/okf/types/StatPanel.md +9 -0
- package/dist/okf/types/TablePanel.md +9 -0
- package/dist/okf/types/TempoQuery.md +9 -0
- package/dist/okf/types/TextPanel.md +9 -0
- package/dist/okf/types/TextboxVariable.md +9 -0
- package/dist/okf/types/TimeSeriesPanel.md +9 -0
- package/dist/okf/types/TracesPanel.md +9 -0
- package/dist/package-cli.d.ts +3 -0
- package/dist/package-cli.d.ts.map +1 -0
- package/dist/panels.d.ts +138 -0
- package/dist/panels.d.ts.map +1 -0
- package/dist/pin.d.ts +32 -0
- package/dist/pin.d.ts.map +1 -0
- package/dist/plugin.d.ts +12 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/query.d.ts +81 -0
- package/dist/query.d.ts.map +1 -0
- package/dist/rules/graf101.ts +17 -0
- package/dist/rules/graf102.ts +17 -0
- package/dist/rules/graf103.ts +17 -0
- package/dist/rules/graf104.ts +17 -0
- package/dist/rules/graf105.ts +17 -0
- package/dist/rules/graf106.ts +17 -0
- package/dist/rules/graf107.ts +17 -0
- package/dist/rules/grafana-ast.ts +70 -0
- package/dist/rules/grafana-helpers.ts +68 -0
- package/dist/rules/literal-secret.ts +48 -0
- package/dist/rules/uid-syntax.ts +56 -0
- package/dist/schema/dashboard.gen.d.ts +1231 -0
- package/dist/schema/dashboard.gen.d.ts.map +1 -0
- package/dist/schema/gauge.gen.d.ts +57 -0
- package/dist/schema/gauge.gen.d.ts.map +1 -0
- package/dist/schema/heatmap.gen.d.ts +295 -0
- package/dist/schema/heatmap.gen.d.ts.map +1 -0
- package/dist/schema/index.d.ts +18 -0
- package/dist/schema/index.d.ts.map +1 -0
- package/dist/schema/logs.gen.d.ts +29 -0
- package/dist/schema/logs.gen.d.ts.map +1 -0
- package/dist/schema/loki.gen.d.ts +69 -0
- package/dist/schema/loki.gen.d.ts.map +1 -0
- package/dist/schema/prometheus.gen.d.ts +169 -0
- package/dist/schema/prometheus.gen.d.ts.map +1 -0
- package/dist/schema/stat.gen.d.ts +75 -0
- package/dist/schema/stat.gen.d.ts.map +1 -0
- package/dist/schema/table.gen.d.ts +295 -0
- package/dist/schema/table.gen.d.ts.map +1 -0
- package/dist/schema/tempo.gen.d.ts +136 -0
- package/dist/schema/tempo.gen.d.ts.map +1 -0
- package/dist/schema/text.gen.d.ts +16 -0
- package/dist/schema/text.gen.d.ts.map +1 -0
- package/dist/schema/timeseries.gen.d.ts +179 -0
- package/dist/schema/timeseries.gen.d.ts.map +1 -0
- package/dist/schema-validate.d.ts +20 -0
- package/dist/schema-validate.d.ts.map +1 -0
- package/dist/serializer.d.ts +22 -0
- package/dist/serializer.d.ts.map +1 -0
- package/dist/skill-defs.d.ts +3 -0
- package/dist/skill-defs.d.ts.map +1 -0
- package/dist/skills/chant-grafana-provisioning.md +42 -0
- package/dist/skills/chant-grafana.md +93 -0
- package/dist/spec/fetch-cli.d.ts +3 -0
- package/dist/spec/fetch-cli.d.ts.map +1 -0
- package/dist/spec/schemas.d.ts +25 -0
- package/dist/spec/schemas.d.ts.map +1 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/util.d.ts +17 -0
- package/dist/util.d.ts.map +1 -0
- package/dist/validate-cli.d.ts +3 -0
- package/dist/validate-cli.d.ts.map +1 -0
- package/dist/validate-output.d.ts +42 -0
- package/dist/validate-output.d.ts.map +1 -0
- package/dist/validate.d.ts +12 -0
- package/dist/validate.d.ts.map +1 -0
- package/dist/variables.d.ts +100 -0
- package/dist/variables.d.ts.map +1 -0
- package/package.json +79 -0
- package/src/build.test.ts +210 -0
- package/src/build.ts +573 -0
- package/src/catalog.ts +116 -0
- package/src/codegen/docs-cli.ts +4 -0
- package/src/codegen/docs.ts +97 -0
- package/src/codegen/generate-cli.ts +8 -0
- package/src/codegen/generate.ts +83 -0
- package/src/codegen/package.ts +41 -0
- package/src/codegen/schema-types.ts +173 -0
- package/src/composites/agent-dashboard.ts +235 -0
- package/src/composites/catalog.test.ts +37 -0
- package/src/composites/catalog.ts +223 -0
- package/src/composites/composites.test.ts +314 -0
- package/src/composites/index.ts +12 -0
- package/src/composites/red-dashboard.ts +159 -0
- package/src/composites/shared.ts +94 -0
- package/src/composites/slo-dashboard.ts +177 -0
- package/src/dashboard.ts +123 -0
- package/src/datasource.ts +93 -0
- package/src/detect.ts +30 -0
- package/src/generated/lexicon-grafana.json +107 -0
- package/src/import.e2e.test.ts +147 -0
- package/src/import.test.ts +45 -0
- package/src/index.ts +178 -0
- package/src/lint/audit-catalog.ts +87 -0
- package/src/lint/post-synth/graf101.ts +17 -0
- package/src/lint/post-synth/graf102.ts +17 -0
- package/src/lint/post-synth/graf103.ts +17 -0
- package/src/lint/post-synth/graf104.ts +17 -0
- package/src/lint/post-synth/graf105.ts +17 -0
- package/src/lint/post-synth/graf106.ts +17 -0
- package/src/lint/post-synth/graf107.ts +17 -0
- package/src/lint/post-synth/grafana-helpers.ts +68 -0
- package/src/lint/post-synth/index.ts +19 -0
- package/src/lint/post-synth/post-synth.test.ts +231 -0
- package/src/lint/rules/grafana-ast.ts +70 -0
- package/src/lint/rules/index.ts +9 -0
- package/src/lint/rules/literal-secret.ts +48 -0
- package/src/lint/rules/rules.test.ts +70 -0
- package/src/lint/rules/uid-syntax.ts +56 -0
- package/src/lsp/completions.test.ts +31 -0
- package/src/lsp/completions.ts +15 -0
- package/src/lsp/hover.test.ts +25 -0
- package/src/lsp/hover.ts +28 -0
- package/src/package-cli.ts +17 -0
- package/src/panels.ts +275 -0
- package/src/pin.ts +68 -0
- package/src/plugin.test.ts +50 -0
- package/src/plugin.ts +116 -0
- package/src/query.ts +160 -0
- package/src/schema/dashboard.gen.ts +1289 -0
- package/src/schema/gauge.gen.ts +64 -0
- package/src/schema/heatmap.gen.ts +321 -0
- package/src/schema/index.ts +17 -0
- package/src/schema/logs.gen.ts +34 -0
- package/src/schema/loki.gen.ts +77 -0
- package/src/schema/prometheus.gen.ts +181 -0
- package/src/schema/stat.gen.ts +86 -0
- package/src/schema/table.gen.ts +334 -0
- package/src/schema/tempo.gen.ts +146 -0
- package/src/schema/text.gen.ts +22 -0
- package/src/schema/timeseries.gen.ts +208 -0
- package/src/schema-validate.ts +143 -0
- package/src/schema.test.ts +76 -0
- package/src/serializer.test.ts +170 -0
- package/src/serializer.ts +37 -0
- package/src/skill-defs.ts +31 -0
- package/src/skills/chant-grafana-provisioning.md +42 -0
- package/src/skills/chant-grafana.md +93 -0
- package/src/spec/fetch-cli.ts +27 -0
- package/src/spec/schemas/dashboard.jsonschema.json +1901 -0
- package/src/spec/schemas/gauge.jsonschema.json +114 -0
- package/src/spec/schemas/heatmap.jsonschema.json +480 -0
- package/src/spec/schemas/logs.jsonschema.json +94 -0
- package/src/spec/schemas/loki.jsonschema.json +118 -0
- package/src/spec/schemas/prometheus.jsonschema.json +276 -0
- package/src/spec/schemas/stat.jsonschema.json +163 -0
- package/src/spec/schemas/table.jsonschema.json +751 -0
- package/src/spec/schemas/tempo.jsonschema.json +225 -0
- package/src/spec/schemas/text.jsonschema.json +72 -0
- package/src/spec/schemas/timeseries.jsonschema.json +471 -0
- package/src/spec/schemas.ts +56 -0
- package/src/util.ts +43 -0
- package/src/validate-cli.ts +7 -0
- package/src/validate-output.ts +380 -0
- package/src/validate.ts +108 -0
- package/src/variables.ts +161 -0
|
@@ -0,0 +1,1231 @@
|
|
|
1
|
+
export interface AnnotationActions {
|
|
2
|
+
canAdd?: boolean;
|
|
3
|
+
canDelete?: boolean;
|
|
4
|
+
canEdit?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export interface AnnotationPermission {
|
|
7
|
+
dashboard?: AnnotationActions;
|
|
8
|
+
organization?: AnnotationActions;
|
|
9
|
+
}
|
|
10
|
+
export interface DashboardMeta {
|
|
11
|
+
annotationsPermissions?: AnnotationPermission;
|
|
12
|
+
apiVersion?: string;
|
|
13
|
+
canAdmin?: boolean;
|
|
14
|
+
canDelete?: boolean;
|
|
15
|
+
canEdit?: boolean;
|
|
16
|
+
canSave?: boolean;
|
|
17
|
+
canStar?: boolean;
|
|
18
|
+
created?: string;
|
|
19
|
+
createdBy?: string;
|
|
20
|
+
expires?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Deprecated: use FolderUID instead
|
|
23
|
+
*/
|
|
24
|
+
folderId?: number;
|
|
25
|
+
folderTitle?: string;
|
|
26
|
+
folderUid?: string;
|
|
27
|
+
folderUrl?: string;
|
|
28
|
+
hasAcl?: boolean;
|
|
29
|
+
isFolder?: boolean;
|
|
30
|
+
isSnapshot?: boolean;
|
|
31
|
+
isStarred?: boolean;
|
|
32
|
+
provisioned?: boolean;
|
|
33
|
+
provisionedExternalId?: string;
|
|
34
|
+
publicDashboardEnabled?: boolean;
|
|
35
|
+
slug?: string;
|
|
36
|
+
type?: string;
|
|
37
|
+
updated?: string;
|
|
38
|
+
updatedBy?: string;
|
|
39
|
+
url?: string;
|
|
40
|
+
version?: number;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* @deprecated Prefer using dashboardv2.Dashboard instead.
|
|
44
|
+
*/
|
|
45
|
+
export interface Dashboard {
|
|
46
|
+
/**
|
|
47
|
+
* Unique numeric identifier for the dashboard.
|
|
48
|
+
* `id` is internal to a specific Grafana instance. `uid` should be used to identify a dashboard across Grafana instances.
|
|
49
|
+
* TODO eliminate this null option
|
|
50
|
+
*/
|
|
51
|
+
id?: number | null;
|
|
52
|
+
/**
|
|
53
|
+
* Unique dashboard identifier that can be generated by anyone. string (8-40)
|
|
54
|
+
*/
|
|
55
|
+
uid?: string;
|
|
56
|
+
/**
|
|
57
|
+
* Title of dashboard.
|
|
58
|
+
*/
|
|
59
|
+
title?: string;
|
|
60
|
+
/**
|
|
61
|
+
* Description of dashboard.
|
|
62
|
+
*/
|
|
63
|
+
description?: string;
|
|
64
|
+
/**
|
|
65
|
+
* This property should only be used in dashboards defined by plugins. It is a quick check
|
|
66
|
+
* to see if the version has changed since the last time.
|
|
67
|
+
*/
|
|
68
|
+
revision?: number;
|
|
69
|
+
/**
|
|
70
|
+
* ID of a dashboard imported from the https://grafana.com/grafana/dashboards/ portal
|
|
71
|
+
*/
|
|
72
|
+
gnetId?: string;
|
|
73
|
+
/**
|
|
74
|
+
* Tags associated with dashboard.
|
|
75
|
+
*/
|
|
76
|
+
tags?: string[];
|
|
77
|
+
/**
|
|
78
|
+
* Timezone of dashboard. Accepted values are IANA TZDB zone ID or "browser" or "utc".
|
|
79
|
+
*/
|
|
80
|
+
timezone?: string;
|
|
81
|
+
/**
|
|
82
|
+
* Whether a dashboard is editable or not.
|
|
83
|
+
*/
|
|
84
|
+
editable?: boolean;
|
|
85
|
+
/**
|
|
86
|
+
* Configuration of dashboard cursor sync behavior.
|
|
87
|
+
* Accepted values are 0 (sync turned off), 1 (shared crosshair), 2 (shared crosshair and tooltip).
|
|
88
|
+
*/
|
|
89
|
+
graphTooltip?: DashboardCursorSync;
|
|
90
|
+
/**
|
|
91
|
+
* Time range for dashboard.
|
|
92
|
+
* Accepted values are relative time strings like {from: 'now-6h', to: 'now'} or absolute time strings like {from: '2020-07-10T08:00:00.000Z', to: '2020-07-10T14:00:00.000Z'}.
|
|
93
|
+
*/
|
|
94
|
+
time?: {
|
|
95
|
+
from: string;
|
|
96
|
+
to: string;
|
|
97
|
+
};
|
|
98
|
+
/**
|
|
99
|
+
* Configuration of the time picker shown at the top of a dashboard.
|
|
100
|
+
*/
|
|
101
|
+
timepicker?: TimePickerConfig;
|
|
102
|
+
/**
|
|
103
|
+
* The month that the fiscal year starts on. 0 = January, 11 = December
|
|
104
|
+
*/
|
|
105
|
+
fiscalYearStartMonth?: number;
|
|
106
|
+
/**
|
|
107
|
+
* When set to true, the dashboard will redraw panels at an interval matching the pixel width.
|
|
108
|
+
* This will keep data "moving left" regardless of the query refresh rate. This setting helps
|
|
109
|
+
* avoid dashboards presenting stale live data
|
|
110
|
+
*/
|
|
111
|
+
liveNow?: boolean;
|
|
112
|
+
/**
|
|
113
|
+
* Day when the week starts. Expressed by the name of the day in lowercase, e.g. "monday".
|
|
114
|
+
*/
|
|
115
|
+
weekStart?: string;
|
|
116
|
+
/**
|
|
117
|
+
* Refresh rate of dashboard. Represented via interval string, e.g. "5s", "1m", "1h", "1d".
|
|
118
|
+
*/
|
|
119
|
+
refresh?: string;
|
|
120
|
+
/**
|
|
121
|
+
* Version of the JSON schema, incremented each time a Grafana update brings
|
|
122
|
+
* changes to said schema.
|
|
123
|
+
*/
|
|
124
|
+
schemaVersion: number;
|
|
125
|
+
/**
|
|
126
|
+
* Version of the dashboard, incremented each time the dashboard is updated.
|
|
127
|
+
*/
|
|
128
|
+
version?: number;
|
|
129
|
+
/**
|
|
130
|
+
* List of dashboard panels
|
|
131
|
+
*/
|
|
132
|
+
panels?: (Panel | RowPanel)[];
|
|
133
|
+
/**
|
|
134
|
+
* Configured template variables
|
|
135
|
+
*/
|
|
136
|
+
templating: {
|
|
137
|
+
/**
|
|
138
|
+
* List of configured template variables with their saved values along with some other metadata
|
|
139
|
+
*/
|
|
140
|
+
list?: VariableModel[];
|
|
141
|
+
};
|
|
142
|
+
/**
|
|
143
|
+
* Contains the list of annotations that are associated with the dashboard.
|
|
144
|
+
* Annotations are used to overlay event markers and overlay event tags on graphs.
|
|
145
|
+
* Grafana comes with a native annotation store and the ability to add annotation events directly from the graph panel or via the HTTP API.
|
|
146
|
+
* See https://grafana.com/docs/grafana/latest/dashboards/build-dashboards/annotate-visualizations/
|
|
147
|
+
*/
|
|
148
|
+
annotations: AnnotationContainer;
|
|
149
|
+
/**
|
|
150
|
+
* Links with references to other dashboards or external websites.
|
|
151
|
+
*/
|
|
152
|
+
links?: DashboardLink[];
|
|
153
|
+
/**
|
|
154
|
+
* Snapshot options. They are present only if the dashboard is a snapshot.
|
|
155
|
+
*/
|
|
156
|
+
snapshot?: Snapshot;
|
|
157
|
+
/**
|
|
158
|
+
* When set to true, the dashboard will load all panels in the dashboard when it's loaded.
|
|
159
|
+
*/
|
|
160
|
+
preload?: boolean;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* 0 for no shared crosshair or tooltip (default).
|
|
164
|
+
* 1 for shared crosshair.
|
|
165
|
+
* 2 for shared crosshair AND shared tooltip.
|
|
166
|
+
*/
|
|
167
|
+
export type DashboardCursorSync = 0 | 1 | 2;
|
|
168
|
+
/**
|
|
169
|
+
* Time picker configuration
|
|
170
|
+
* It defines the default config for the time picker and the refresh picker for the specific dashboard.
|
|
171
|
+
*/
|
|
172
|
+
export interface TimePickerConfig {
|
|
173
|
+
/**
|
|
174
|
+
* Whether timepicker is visible or not.
|
|
175
|
+
*/
|
|
176
|
+
hidden?: boolean;
|
|
177
|
+
/**
|
|
178
|
+
* Interval options available in the refresh picker dropdown.
|
|
179
|
+
*/
|
|
180
|
+
refresh_intervals?: string[];
|
|
181
|
+
/**
|
|
182
|
+
* Quick ranges for time picker.
|
|
183
|
+
*/
|
|
184
|
+
quick_ranges?: TimeOption[];
|
|
185
|
+
/**
|
|
186
|
+
* Override the now time by entering a time delay. Use this option to accommodate known delays in data aggregation to avoid null values.
|
|
187
|
+
*/
|
|
188
|
+
nowDelay?: string;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Counterpart for TypeScript's TimeOption type.
|
|
192
|
+
*/
|
|
193
|
+
export interface TimeOption {
|
|
194
|
+
display: string;
|
|
195
|
+
from: string;
|
|
196
|
+
to: string;
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Dashboard panels are the basic visualization building blocks.
|
|
200
|
+
*/
|
|
201
|
+
export interface Panel {
|
|
202
|
+
/**
|
|
203
|
+
* The panel plugin type id. This is used to find the plugin to display the panel.
|
|
204
|
+
*/
|
|
205
|
+
type: string;
|
|
206
|
+
/**
|
|
207
|
+
* Unique identifier of the panel. Generated by Grafana when creating a new panel. It must be unique within a dashboard, but not globally.
|
|
208
|
+
*/
|
|
209
|
+
id?: number;
|
|
210
|
+
/**
|
|
211
|
+
* The version of the plugin that is used for this panel. This is used to find the plugin to display the panel and to migrate old panel configs.
|
|
212
|
+
*/
|
|
213
|
+
pluginVersion?: string;
|
|
214
|
+
/**
|
|
215
|
+
* Depends on the panel plugin. See the plugin documentation for details.
|
|
216
|
+
*/
|
|
217
|
+
targets?: Record<string, unknown>[];
|
|
218
|
+
/**
|
|
219
|
+
* Panel title.
|
|
220
|
+
*/
|
|
221
|
+
title?: string;
|
|
222
|
+
/**
|
|
223
|
+
* Panel description.
|
|
224
|
+
*/
|
|
225
|
+
description?: string;
|
|
226
|
+
/**
|
|
227
|
+
* Whether to display the panel without a background.
|
|
228
|
+
*/
|
|
229
|
+
transparent?: boolean;
|
|
230
|
+
/**
|
|
231
|
+
* The datasource used in all targets.
|
|
232
|
+
*/
|
|
233
|
+
datasource?: DataSourceRef;
|
|
234
|
+
/**
|
|
235
|
+
* Grid position.
|
|
236
|
+
*/
|
|
237
|
+
gridPos?: GridPos;
|
|
238
|
+
/**
|
|
239
|
+
* Panel links.
|
|
240
|
+
*/
|
|
241
|
+
links?: DashboardLink[];
|
|
242
|
+
/**
|
|
243
|
+
* Name of template variable to repeat for.
|
|
244
|
+
*/
|
|
245
|
+
repeat?: string;
|
|
246
|
+
/**
|
|
247
|
+
* Direction to repeat in if 'repeat' is set.
|
|
248
|
+
* `h` for horizontal, `v` for vertical.
|
|
249
|
+
*/
|
|
250
|
+
repeatDirection?: "h" | "v";
|
|
251
|
+
/**
|
|
252
|
+
* Option for repeated panels that controls max items per row
|
|
253
|
+
* Only relevant for horizontally repeated panels
|
|
254
|
+
*/
|
|
255
|
+
maxPerRow?: number;
|
|
256
|
+
/**
|
|
257
|
+
* The maximum number of data points that the panel queries are retrieving.
|
|
258
|
+
*/
|
|
259
|
+
maxDataPoints?: number;
|
|
260
|
+
/**
|
|
261
|
+
* List of transformations that are applied to the panel data before rendering.
|
|
262
|
+
* When there are multiple transformations, Grafana applies them in the order they are listed.
|
|
263
|
+
* Each transformation creates a result set that then passes on to the next transformation in the processing pipeline.
|
|
264
|
+
*/
|
|
265
|
+
transformations?: DataTransformerConfig[];
|
|
266
|
+
/**
|
|
267
|
+
* The min time interval setting defines a lower limit for the $__interval and $__interval_ms variables.
|
|
268
|
+
* This value must be formatted as a number followed by a valid time
|
|
269
|
+
* identifier like: "40s", "3d", etc.
|
|
270
|
+
* See: https://grafana.com/docs/grafana/latest/panels-visualizations/query-transform-data/#query-options
|
|
271
|
+
*/
|
|
272
|
+
interval?: string;
|
|
273
|
+
/**
|
|
274
|
+
* Overrides the relative time range for individual panels,
|
|
275
|
+
* which causes them to be different than what is selected in
|
|
276
|
+
* the dashboard time picker in the top-right corner of the dashboard. You can use this to show metrics from different
|
|
277
|
+
* time periods or days on the same dashboard.
|
|
278
|
+
* The value is formatted as time operation like: `now-5m` (Last 5 minutes), `now/d` (the day so far),
|
|
279
|
+
* `now-5d/d`(Last 5 days), `now/w` (This week so far), `now-2y/y` (Last 2 years).
|
|
280
|
+
* Note: Panel time overrides have no effect when the dashboard’s time range is absolute.
|
|
281
|
+
* See: https://grafana.com/docs/grafana/latest/panels-visualizations/query-transform-data/#query-options
|
|
282
|
+
*/
|
|
283
|
+
timeFrom?: string;
|
|
284
|
+
/**
|
|
285
|
+
* Overrides the time range for individual panels by shifting its start and end relative to the time picker.
|
|
286
|
+
* For example, you can shift the time range for the panel to be two hours earlier than the dashboard time picker setting `2h`.
|
|
287
|
+
* Note: Panel time overrides have no effect when the dashboard’s time range is absolute.
|
|
288
|
+
* See: https://grafana.com/docs/grafana/latest/panels-visualizations/query-transform-data/#query-options
|
|
289
|
+
*/
|
|
290
|
+
timeShift?: string;
|
|
291
|
+
/**
|
|
292
|
+
* Controls if the timeFrom or timeShift overrides are shown in the panel header
|
|
293
|
+
*/
|
|
294
|
+
hideTimeOverride?: boolean;
|
|
295
|
+
/**
|
|
296
|
+
* Compare the current time range with a previous period
|
|
297
|
+
* For example "1d" to compare current period but shifted back 1 day
|
|
298
|
+
*/
|
|
299
|
+
timeCompare?: string;
|
|
300
|
+
/**
|
|
301
|
+
* Dynamically load the panel
|
|
302
|
+
*/
|
|
303
|
+
libraryPanel?: LibraryPanelRef;
|
|
304
|
+
/**
|
|
305
|
+
* Sets panel queries cache timeout.
|
|
306
|
+
*/
|
|
307
|
+
cacheTimeout?: string;
|
|
308
|
+
/**
|
|
309
|
+
* Overrides the data source configured time-to-live for a query cache item in milliseconds
|
|
310
|
+
*/
|
|
311
|
+
queryCachingTTL?: number;
|
|
312
|
+
/**
|
|
313
|
+
* It depends on the panel plugin. They are specified by the Options field in panel plugin schemas.
|
|
314
|
+
*/
|
|
315
|
+
options?: Record<string, unknown>;
|
|
316
|
+
/**
|
|
317
|
+
* Field options allow you to change how the data is displayed in your visualizations.
|
|
318
|
+
*/
|
|
319
|
+
fieldConfig?: FieldConfigSource;
|
|
320
|
+
}
|
|
321
|
+
export interface DataSourceRef {
|
|
322
|
+
/**
|
|
323
|
+
* The plugin type-id
|
|
324
|
+
*/
|
|
325
|
+
type?: string;
|
|
326
|
+
/**
|
|
327
|
+
* Specific datasource instance
|
|
328
|
+
*/
|
|
329
|
+
uid?: string;
|
|
330
|
+
}
|
|
331
|
+
/**
|
|
332
|
+
* Position and dimensions of a panel in the grid
|
|
333
|
+
*/
|
|
334
|
+
export interface GridPos {
|
|
335
|
+
/**
|
|
336
|
+
* Panel height. The height is the number of rows from the top edge of the panel.
|
|
337
|
+
*/
|
|
338
|
+
h: number;
|
|
339
|
+
/**
|
|
340
|
+
* Panel width. The width is the number of columns from the left edge of the panel.
|
|
341
|
+
*/
|
|
342
|
+
w: number;
|
|
343
|
+
/**
|
|
344
|
+
* Panel x. The x coordinate is the number of columns from the left edge of the grid
|
|
345
|
+
*/
|
|
346
|
+
x: number;
|
|
347
|
+
/**
|
|
348
|
+
* Panel y. The y coordinate is the number of rows from the top edge of the grid
|
|
349
|
+
*/
|
|
350
|
+
y: number;
|
|
351
|
+
/**
|
|
352
|
+
* Whether the panel is fixed within the grid. If true, the panel will not be affected by other panels' interactions
|
|
353
|
+
*/
|
|
354
|
+
static?: boolean;
|
|
355
|
+
}
|
|
356
|
+
/**
|
|
357
|
+
* Links with references to other dashboards or external resources
|
|
358
|
+
*/
|
|
359
|
+
export interface DashboardLink {
|
|
360
|
+
/**
|
|
361
|
+
* Title to display with the link
|
|
362
|
+
*/
|
|
363
|
+
title: string;
|
|
364
|
+
/**
|
|
365
|
+
* Link type. Accepted values are dashboards (to refer to another dashboard) and link (to refer to an external resource)
|
|
366
|
+
*/
|
|
367
|
+
type: DashboardLinkType;
|
|
368
|
+
/**
|
|
369
|
+
* Icon name to be displayed with the link
|
|
370
|
+
*/
|
|
371
|
+
icon: string;
|
|
372
|
+
/**
|
|
373
|
+
* Tooltip to display when the user hovers their mouse over it
|
|
374
|
+
*/
|
|
375
|
+
tooltip: string;
|
|
376
|
+
/**
|
|
377
|
+
* Link URL. Only required/valid if the type is link
|
|
378
|
+
*/
|
|
379
|
+
url?: string;
|
|
380
|
+
/**
|
|
381
|
+
* List of tags to limit the linked dashboards. If empty, all dashboards will be displayed. Only valid if the type is dashboards
|
|
382
|
+
*/
|
|
383
|
+
tags: string[];
|
|
384
|
+
/**
|
|
385
|
+
* If true, all dashboards links will be displayed in a dropdown. If false, all dashboards links will be displayed side by side. Only valid if the type is dashboards
|
|
386
|
+
*/
|
|
387
|
+
asDropdown: boolean;
|
|
388
|
+
/**
|
|
389
|
+
* Placement can be used to display the link somewhere else on the dashboard other than above the visualisations.
|
|
390
|
+
*/
|
|
391
|
+
placement?: DashboardLinkPlacement;
|
|
392
|
+
/**
|
|
393
|
+
* If true, the link will be opened in a new tab
|
|
394
|
+
*/
|
|
395
|
+
targetBlank: boolean;
|
|
396
|
+
/**
|
|
397
|
+
* If true, includes current template variables values in the link as query params
|
|
398
|
+
*/
|
|
399
|
+
includeVars: boolean;
|
|
400
|
+
/**
|
|
401
|
+
* If true, includes current time range in the link as query params
|
|
402
|
+
*/
|
|
403
|
+
keepTime: boolean;
|
|
404
|
+
}
|
|
405
|
+
/**
|
|
406
|
+
* Dashboard Link type. Accepted values are dashboards (to refer to another dashboard) and link (to refer to an external resource)
|
|
407
|
+
*/
|
|
408
|
+
export type DashboardLinkType = "link" | "dashboards";
|
|
409
|
+
/**
|
|
410
|
+
* Dashboard Link placement. Defines where the link should be displayed.
|
|
411
|
+
* - "inControlsMenu" renders the link in bottom part of the dashboard controls dropdown menu
|
|
412
|
+
*/
|
|
413
|
+
export type DashboardLinkPlacement = "inControlsMenu";
|
|
414
|
+
/**
|
|
415
|
+
* Transformations allow to manipulate data returned by a query before the system applies a visualization.
|
|
416
|
+
* Using transformations you can: rename fields, join time series data, perform mathematical operations across queries,
|
|
417
|
+
* use the output of one transformation as the input to another transformation, etc.
|
|
418
|
+
*/
|
|
419
|
+
export interface DataTransformerConfig {
|
|
420
|
+
/**
|
|
421
|
+
* Unique identifier of transformer
|
|
422
|
+
*/
|
|
423
|
+
id: string;
|
|
424
|
+
/**
|
|
425
|
+
* Disabled transformations are skipped
|
|
426
|
+
*/
|
|
427
|
+
disabled?: boolean;
|
|
428
|
+
/**
|
|
429
|
+
* Optional frame matcher. When missing it will be applied to all results
|
|
430
|
+
*/
|
|
431
|
+
filter?: MatcherConfig;
|
|
432
|
+
/**
|
|
433
|
+
* Where to pull DataFrames from as input to transformation
|
|
434
|
+
* replaced with common.DataTopic
|
|
435
|
+
*/
|
|
436
|
+
topic?: "series" | "annotations" | "alertStates";
|
|
437
|
+
/**
|
|
438
|
+
* Options to be passed to the transformer
|
|
439
|
+
* Valid options depend on the transformer id
|
|
440
|
+
*/
|
|
441
|
+
options: Record<string, unknown>;
|
|
442
|
+
}
|
|
443
|
+
/**
|
|
444
|
+
* Matcher is a predicate configuration. Based on the config a set of field(s) or values is filtered in order to apply override / transformation.
|
|
445
|
+
* It comes with in id ( to resolve implementation from registry) and a configuration that’s specific to a particular matcher type.
|
|
446
|
+
*/
|
|
447
|
+
export interface MatcherConfig {
|
|
448
|
+
/**
|
|
449
|
+
* The matcher id. This is used to find the matcher implementation from registry.
|
|
450
|
+
*/
|
|
451
|
+
id: string;
|
|
452
|
+
/**
|
|
453
|
+
* The matcher options. This is specific to the matcher implementation.
|
|
454
|
+
*/
|
|
455
|
+
options?: Record<string, unknown>;
|
|
456
|
+
}
|
|
457
|
+
/**
|
|
458
|
+
* A library panel is a reusable panel that you can use in any dashboard.
|
|
459
|
+
* When you make a change to a library panel, that change propagates to all instances of where the panel is used.
|
|
460
|
+
* Library panels streamline reuse of panels across multiple dashboards.
|
|
461
|
+
*/
|
|
462
|
+
export interface LibraryPanelRef {
|
|
463
|
+
/**
|
|
464
|
+
* Library panel name
|
|
465
|
+
*/
|
|
466
|
+
name: string;
|
|
467
|
+
/**
|
|
468
|
+
* Library panel uid
|
|
469
|
+
*/
|
|
470
|
+
uid: string;
|
|
471
|
+
}
|
|
472
|
+
/**
|
|
473
|
+
* The data model used in Grafana, namely the data frame, is a columnar-oriented table structure that unifies both time series and table query results.
|
|
474
|
+
* Each column within this structure is called a field. A field can represent a single time series or table column.
|
|
475
|
+
* Field options allow you to change how the data is displayed in your visualizations.
|
|
476
|
+
*/
|
|
477
|
+
export interface FieldConfigSource {
|
|
478
|
+
/**
|
|
479
|
+
* Defaults are the options applied to all fields.
|
|
480
|
+
*/
|
|
481
|
+
defaults: FieldConfig;
|
|
482
|
+
/**
|
|
483
|
+
* Overrides are the options applied to specific fields overriding the defaults.
|
|
484
|
+
*/
|
|
485
|
+
overrides: {
|
|
486
|
+
__systemRef?: string;
|
|
487
|
+
matcher: MatcherConfig;
|
|
488
|
+
properties: DynamicConfigValue[];
|
|
489
|
+
}[];
|
|
490
|
+
}
|
|
491
|
+
/**
|
|
492
|
+
* The data model used in Grafana, namely the data frame, is a columnar-oriented table structure that unifies both time series and table query results.
|
|
493
|
+
* Each column within this structure is called a field. A field can represent a single time series or table column.
|
|
494
|
+
* Field options allow you to change how the data is displayed in your visualizations.
|
|
495
|
+
*/
|
|
496
|
+
export interface FieldConfig {
|
|
497
|
+
/**
|
|
498
|
+
* The display value for this field. This supports template variables blank is auto
|
|
499
|
+
*/
|
|
500
|
+
displayName?: string;
|
|
501
|
+
/**
|
|
502
|
+
* This can be used by data sources that return and explicit naming structure for values and labels
|
|
503
|
+
* When this property is configured, this value is used rather than the default naming strategy.
|
|
504
|
+
*/
|
|
505
|
+
displayNameFromDS?: string;
|
|
506
|
+
/**
|
|
507
|
+
* Human readable field metadata
|
|
508
|
+
*/
|
|
509
|
+
description?: string;
|
|
510
|
+
/**
|
|
511
|
+
* An explicit path to the field in the datasource. When the frame meta includes a path,
|
|
512
|
+
* This will default to `${frame.meta.path}/${field.name}
|
|
513
|
+
*
|
|
514
|
+
* When defined, this value can be used as an identifier within the datasource scope, and
|
|
515
|
+
* may be used to update the results
|
|
516
|
+
*/
|
|
517
|
+
path?: string;
|
|
518
|
+
/**
|
|
519
|
+
* True if data source can write a value to the path. Auth/authz are supported separately
|
|
520
|
+
*/
|
|
521
|
+
writeable?: boolean;
|
|
522
|
+
/**
|
|
523
|
+
* True if data source field supports ad-hoc filters
|
|
524
|
+
*/
|
|
525
|
+
filterable?: boolean;
|
|
526
|
+
/**
|
|
527
|
+
* Unit a field should use. The unit you select is applied to all fields except time.
|
|
528
|
+
* You can use the units ID availables in Grafana or a custom unit.
|
|
529
|
+
* Available units in Grafana: https://github.com/grafana/grafana/blob/main/packages/grafana-data/src/valueFormats/categories.ts
|
|
530
|
+
* As custom unit, you can use the following formats:
|
|
531
|
+
* `suffix:<suffix>` for custom unit that should go after value.
|
|
532
|
+
* `prefix:<prefix>` for custom unit that should go before value.
|
|
533
|
+
* `time:<format>` For custom date time formats type for example `time:YYYY-MM-DD`.
|
|
534
|
+
* `si:<base scale><unit characters>` for custom SI units. For example: `si: mF`. This one is a bit more advanced as you can specify both a unit and the source data scale. So if your source data is represented as milli (thousands of) something prefix the unit with that SI scale character.
|
|
535
|
+
* `count:<unit>` for a custom count unit.
|
|
536
|
+
* `currency:<unit>` for custom a currency unit.
|
|
537
|
+
*/
|
|
538
|
+
unit?: string;
|
|
539
|
+
/**
|
|
540
|
+
* Specify the number of decimals Grafana includes in the rendered value.
|
|
541
|
+
* If you leave this field blank, Grafana automatically truncates the number of decimals based on the value.
|
|
542
|
+
* For example 1.1234 will display as 1.12 and 100.456 will display as 100.
|
|
543
|
+
* To display all decimals, set the unit to `String`.
|
|
544
|
+
*/
|
|
545
|
+
decimals?: number;
|
|
546
|
+
/**
|
|
547
|
+
* The minimum value used in percentage threshold calculations. Leave blank for auto calculation based on all series and fields.
|
|
548
|
+
*/
|
|
549
|
+
min?: number;
|
|
550
|
+
/**
|
|
551
|
+
* The maximum value used in percentage threshold calculations. Leave blank for auto calculation based on all series and fields.
|
|
552
|
+
*/
|
|
553
|
+
max?: number;
|
|
554
|
+
/**
|
|
555
|
+
* Convert input values into a display string
|
|
556
|
+
*/
|
|
557
|
+
mappings?: ValueMapping[];
|
|
558
|
+
/**
|
|
559
|
+
* Map numeric values to states
|
|
560
|
+
*/
|
|
561
|
+
thresholds?: ThresholdsConfig;
|
|
562
|
+
/**
|
|
563
|
+
* Panel color configuration
|
|
564
|
+
*/
|
|
565
|
+
color?: FieldColor;
|
|
566
|
+
/**
|
|
567
|
+
* The behavior when clicking on a result
|
|
568
|
+
*/
|
|
569
|
+
links?: DashboardLink[];
|
|
570
|
+
/**
|
|
571
|
+
* Define interactive HTTP requests that can be triggered from data visualizations.
|
|
572
|
+
*/
|
|
573
|
+
actions?: Action[];
|
|
574
|
+
/**
|
|
575
|
+
* Alternative to empty string
|
|
576
|
+
*/
|
|
577
|
+
noValue?: string;
|
|
578
|
+
/**
|
|
579
|
+
* custom is specified by the FieldConfig field
|
|
580
|
+
* in panel plugin schemas.
|
|
581
|
+
*/
|
|
582
|
+
custom?: Record<string, unknown>;
|
|
583
|
+
fieldMinMax?: boolean;
|
|
584
|
+
}
|
|
585
|
+
/**
|
|
586
|
+
* Allow to transform the visual representation of specific data values in a visualization, irrespective of their original units
|
|
587
|
+
*/
|
|
588
|
+
export type ValueMapping = ValueMap | RangeMap | RegexMap | SpecialValueMap;
|
|
589
|
+
/**
|
|
590
|
+
* Maps text values to a color or different display text and color.
|
|
591
|
+
* For example, you can configure a value mapping so that all instances of the value 10 appear as Perfection! rather than the number.
|
|
592
|
+
*/
|
|
593
|
+
export interface ValueMap {
|
|
594
|
+
type: MappingType;
|
|
595
|
+
/**
|
|
596
|
+
* Map with <value_to_match>: ValueMappingResult. For example: { "10": { text: "Perfection!", color: "green" } }
|
|
597
|
+
*/
|
|
598
|
+
options: Record<string, ValueMappingResult>;
|
|
599
|
+
}
|
|
600
|
+
/**
|
|
601
|
+
* Supported value mapping types
|
|
602
|
+
* `value`: Maps text values to a color or different display text and color. For example, you can configure a value mapping so that all instances of the value 10 appear as Perfection! rather than the number.
|
|
603
|
+
* `range`: Maps numerical ranges to a display text and color. For example, if a value is within a certain range, you can configure a range value mapping to display Low or High rather than the number.
|
|
604
|
+
* `regex`: Maps regular expressions to replacement text and a color. For example, if a value is www.example.com, you can configure a regex value mapping so that Grafana displays www and truncates the domain.
|
|
605
|
+
* `special`: Maps special values like Null, NaN (not a number), and boolean values like true and false to a display text and color. See SpecialValueMatch to see the list of special values. For example, you can configure a special value mapping so that null values appear as N/A.
|
|
606
|
+
*/
|
|
607
|
+
export type MappingType = "value" | "range" | "regex" | "special";
|
|
608
|
+
/**
|
|
609
|
+
* Result used as replacement with text and color when the value matches
|
|
610
|
+
*/
|
|
611
|
+
export interface ValueMappingResult {
|
|
612
|
+
/**
|
|
613
|
+
* Text to display when the value matches
|
|
614
|
+
*/
|
|
615
|
+
text?: string;
|
|
616
|
+
/**
|
|
617
|
+
* Text to use when the value matches
|
|
618
|
+
*/
|
|
619
|
+
color?: string;
|
|
620
|
+
/**
|
|
621
|
+
* Icon to display when the value matches. Only specific visualizations.
|
|
622
|
+
*/
|
|
623
|
+
icon?: string;
|
|
624
|
+
/**
|
|
625
|
+
* Position in the mapping array. Only used internally.
|
|
626
|
+
*/
|
|
627
|
+
index?: number;
|
|
628
|
+
}
|
|
629
|
+
/**
|
|
630
|
+
* Maps numerical ranges to a display text and color.
|
|
631
|
+
* For example, if a value is within a certain range, you can configure a range value mapping to display Low or High rather than the number.
|
|
632
|
+
*/
|
|
633
|
+
export interface RangeMap {
|
|
634
|
+
type: MappingType;
|
|
635
|
+
/**
|
|
636
|
+
* Range to match against and the result to apply when the value is within the range
|
|
637
|
+
*/
|
|
638
|
+
options: {
|
|
639
|
+
/**
|
|
640
|
+
* Min value of the range. It can be null which means -Infinity
|
|
641
|
+
*/
|
|
642
|
+
from: number | null;
|
|
643
|
+
/**
|
|
644
|
+
* Max value of the range. It can be null which means +Infinity
|
|
645
|
+
*/
|
|
646
|
+
to: number | null;
|
|
647
|
+
/**
|
|
648
|
+
* Config to apply when the value is within the range
|
|
649
|
+
*/
|
|
650
|
+
result: ValueMappingResult;
|
|
651
|
+
};
|
|
652
|
+
}
|
|
653
|
+
/**
|
|
654
|
+
* Maps regular expressions to replacement text and a color.
|
|
655
|
+
* For example, if a value is www.example.com, you can configure a regex value mapping so that Grafana displays www and truncates the domain.
|
|
656
|
+
*/
|
|
657
|
+
export interface RegexMap {
|
|
658
|
+
type: MappingType;
|
|
659
|
+
/**
|
|
660
|
+
* Regular expression to match against and the result to apply when the value matches the regex
|
|
661
|
+
*/
|
|
662
|
+
options: {
|
|
663
|
+
/**
|
|
664
|
+
* Regular expression to match against
|
|
665
|
+
*/
|
|
666
|
+
pattern: string;
|
|
667
|
+
/**
|
|
668
|
+
* Config to apply when the value matches the regex
|
|
669
|
+
*/
|
|
670
|
+
result: ValueMappingResult;
|
|
671
|
+
};
|
|
672
|
+
}
|
|
673
|
+
/**
|
|
674
|
+
* Maps special values like Null, NaN (not a number), and boolean values like true and false to a display text and color.
|
|
675
|
+
* See SpecialValueMatch to see the list of special values.
|
|
676
|
+
* For example, you can configure a special value mapping so that null values appear as N/A.
|
|
677
|
+
*/
|
|
678
|
+
export interface SpecialValueMap {
|
|
679
|
+
type: MappingType;
|
|
680
|
+
options: {
|
|
681
|
+
/**
|
|
682
|
+
* Special value to match against
|
|
683
|
+
*/
|
|
684
|
+
match: SpecialValueMatch;
|
|
685
|
+
/**
|
|
686
|
+
* Config to apply when the value matches the special value
|
|
687
|
+
*/
|
|
688
|
+
result: ValueMappingResult;
|
|
689
|
+
};
|
|
690
|
+
}
|
|
691
|
+
/**
|
|
692
|
+
* Special value types supported by the `SpecialValueMap`
|
|
693
|
+
*/
|
|
694
|
+
export type SpecialValueMatch = "true" | "false" | "null" | "nan" | "null+nan" | "empty";
|
|
695
|
+
/**
|
|
696
|
+
* Thresholds configuration for the panel
|
|
697
|
+
*/
|
|
698
|
+
export interface ThresholdsConfig {
|
|
699
|
+
/**
|
|
700
|
+
* Thresholds mode.
|
|
701
|
+
*/
|
|
702
|
+
mode: ThresholdsMode;
|
|
703
|
+
/**
|
|
704
|
+
* Must be sorted by 'value', first value is always -Infinity
|
|
705
|
+
*/
|
|
706
|
+
steps: Threshold[];
|
|
707
|
+
}
|
|
708
|
+
/**
|
|
709
|
+
* Thresholds can either be `absolute` (specific number) or `percentage` (relative to min or max, it will be values between 0 and 1).
|
|
710
|
+
*/
|
|
711
|
+
export type ThresholdsMode = "absolute" | "percentage";
|
|
712
|
+
/**
|
|
713
|
+
* User-defined value for a metric that triggers visual changes in a panel when this value is met or exceeded
|
|
714
|
+
* They are used to conditionally style and color visualizations based on query results , and can be applied to most visualizations.
|
|
715
|
+
*/
|
|
716
|
+
export interface Threshold {
|
|
717
|
+
/**
|
|
718
|
+
* Value represents a specified metric for the threshold, which triggers a visual change in the dashboard when this value is met or exceeded.
|
|
719
|
+
* Nulls currently appear here when serializing -Infinity to JSON.
|
|
720
|
+
*/
|
|
721
|
+
value: number | null;
|
|
722
|
+
/**
|
|
723
|
+
* Color represents the color of the visual change that will occur in the dashboard when the threshold value is met or exceeded.
|
|
724
|
+
*/
|
|
725
|
+
color: string;
|
|
726
|
+
}
|
|
727
|
+
/**
|
|
728
|
+
* Map a field to a color.
|
|
729
|
+
*/
|
|
730
|
+
export interface FieldColor {
|
|
731
|
+
/**
|
|
732
|
+
* The main color scheme mode.
|
|
733
|
+
*/
|
|
734
|
+
mode: FieldColorModeId;
|
|
735
|
+
/**
|
|
736
|
+
* The fixed color value for fixed or shades color modes.
|
|
737
|
+
*/
|
|
738
|
+
fixedColor?: string;
|
|
739
|
+
/**
|
|
740
|
+
* Some visualizations need to know how to assign a series color from by value color schemes.
|
|
741
|
+
*/
|
|
742
|
+
seriesBy?: FieldColorSeriesByMode;
|
|
743
|
+
}
|
|
744
|
+
/**
|
|
745
|
+
* Color mode for a field. You can specify a single color, or select a continuous (gradient) color schemes, based on a value.
|
|
746
|
+
* Continuous color interpolates a color using the percentage of a value relative to min and max.
|
|
747
|
+
* Accepted values are:
|
|
748
|
+
* `thresholds`: From thresholds. Informs Grafana to take the color from the matching threshold
|
|
749
|
+
* `palette-classic`: Classic palette. Grafana will assign color by looking up a color in a palette by series index. Useful for Graphs and pie charts and other categorical data visualizations
|
|
750
|
+
* `palette-classic-by-name`: Classic palette (by name). Grafana will assign color by looking up a color in a palette by series name. Useful for Graphs and pie charts and other categorical data visualizations
|
|
751
|
+
* `continuous-GrYlRd`: ontinuous Green-Yellow-Red palette mode
|
|
752
|
+
* `continuous-RdYlGr`: Continuous Red-Yellow-Green palette mode
|
|
753
|
+
* `continuous-BlYlRd`: Continuous Blue-Yellow-Red palette mode
|
|
754
|
+
* `continuous-YlRd`: Continuous Yellow-Red palette mode
|
|
755
|
+
* `continuous-BlPu`: Continuous Blue-Purple palette mode
|
|
756
|
+
* `continuous-YlBl`: Continuous Yellow-Blue palette mode
|
|
757
|
+
* `continuous-blues`: Continuous Blue palette mode
|
|
758
|
+
* `continuous-reds`: Continuous Red palette mode
|
|
759
|
+
* `continuous-greens`: Continuous Green palette mode
|
|
760
|
+
* `continuous-purples`: Continuous Purple palette mode
|
|
761
|
+
* `shades`: Shades of a single color. Specify a single color, useful in an override rule.
|
|
762
|
+
* `fixed`: Fixed color mode. Specify a single color, useful in an override rule.
|
|
763
|
+
*/
|
|
764
|
+
export type FieldColorModeId = "thresholds" | "palette-classic" | "palette-classic-by-name" | "continuous-GrYlRd" | "continuous-RdYlGr" | "continuous-BlYlRd" | "continuous-YlRd" | "continuous-BlPu" | "continuous-YlBl" | "continuous-blues" | "continuous-reds" | "continuous-greens" | "continuous-purples" | "fixed" | "shades";
|
|
765
|
+
/**
|
|
766
|
+
* Defines how to assign a series color from "by value" color schemes. For example for an aggregated data points like a timeseries, the color can be assigned by the min, max or last value.
|
|
767
|
+
*/
|
|
768
|
+
export type FieldColorSeriesByMode = "min" | "max" | "last";
|
|
769
|
+
/**
|
|
770
|
+
* Dashboard action
|
|
771
|
+
*/
|
|
772
|
+
export interface Action {
|
|
773
|
+
type: ActionType;
|
|
774
|
+
title: string;
|
|
775
|
+
"fetch"?: FetchOptions;
|
|
776
|
+
infinity?: InfinityOptions;
|
|
777
|
+
confirmation?: string;
|
|
778
|
+
oneClick?: boolean;
|
|
779
|
+
variables?: ActionVariable[];
|
|
780
|
+
style?: {
|
|
781
|
+
backgroundColor?: string;
|
|
782
|
+
};
|
|
783
|
+
}
|
|
784
|
+
/**
|
|
785
|
+
* Dashboard action type
|
|
786
|
+
*/
|
|
787
|
+
export type ActionType = "fetch" | "infinity";
|
|
788
|
+
/**
|
|
789
|
+
* Fetch options
|
|
790
|
+
*/
|
|
791
|
+
export interface FetchOptions {
|
|
792
|
+
method: HttpRequestMethod;
|
|
793
|
+
url: string;
|
|
794
|
+
body?: string;
|
|
795
|
+
/**
|
|
796
|
+
* These are 2D arrays of strings, each representing a key-value pair
|
|
797
|
+
* We are defining this way because we can't generate a go struct that
|
|
798
|
+
* that would have exactly two strings in each sub-array
|
|
799
|
+
*/
|
|
800
|
+
queryParams?: string[][];
|
|
801
|
+
headers?: string[][];
|
|
802
|
+
}
|
|
803
|
+
export type HttpRequestMethod = "GET" | "PUT" | "POST" | "DELETE" | "PATCH";
|
|
804
|
+
/**
|
|
805
|
+
* Infinity options
|
|
806
|
+
*/
|
|
807
|
+
export interface InfinityOptions {
|
|
808
|
+
method: HttpRequestMethod;
|
|
809
|
+
url: string;
|
|
810
|
+
body?: string;
|
|
811
|
+
/**
|
|
812
|
+
* These are 2D arrays of strings, each representing a key-value pair
|
|
813
|
+
* We are defining them this way because we can't generate a go struct that
|
|
814
|
+
* that would have exactly two strings in each sub-array
|
|
815
|
+
*/
|
|
816
|
+
queryParams?: string[][];
|
|
817
|
+
headers?: string[][];
|
|
818
|
+
datasourceUid: string;
|
|
819
|
+
}
|
|
820
|
+
export interface ActionVariable {
|
|
821
|
+
key: string;
|
|
822
|
+
name: string;
|
|
823
|
+
type: ActionVariableType;
|
|
824
|
+
}
|
|
825
|
+
/**
|
|
826
|
+
* Action variable type
|
|
827
|
+
*/
|
|
828
|
+
export type ActionVariableType = "string";
|
|
829
|
+
export interface DynamicConfigValue {
|
|
830
|
+
id: string;
|
|
831
|
+
value?: Record<string, unknown>;
|
|
832
|
+
}
|
|
833
|
+
/**
|
|
834
|
+
* Row panel
|
|
835
|
+
*/
|
|
836
|
+
export interface RowPanel {
|
|
837
|
+
/**
|
|
838
|
+
* The panel type
|
|
839
|
+
*/
|
|
840
|
+
type: "row";
|
|
841
|
+
/**
|
|
842
|
+
* Whether this row should be collapsed or not.
|
|
843
|
+
*/
|
|
844
|
+
collapsed: boolean;
|
|
845
|
+
/**
|
|
846
|
+
* Row title
|
|
847
|
+
*/
|
|
848
|
+
title?: string;
|
|
849
|
+
/**
|
|
850
|
+
* Name of default datasource for the row
|
|
851
|
+
*/
|
|
852
|
+
datasource?: DataSourceRef;
|
|
853
|
+
/**
|
|
854
|
+
* Row grid position
|
|
855
|
+
*/
|
|
856
|
+
gridPos?: GridPos;
|
|
857
|
+
/**
|
|
858
|
+
* Unique identifier of the panel. Generated by Grafana when creating a new panel. It must be unique within a dashboard, but not globally.
|
|
859
|
+
*/
|
|
860
|
+
id: number;
|
|
861
|
+
/**
|
|
862
|
+
* List of panels in the row
|
|
863
|
+
*/
|
|
864
|
+
panels: Panel[];
|
|
865
|
+
/**
|
|
866
|
+
* Name of template variable to repeat for.
|
|
867
|
+
*/
|
|
868
|
+
repeat?: string;
|
|
869
|
+
}
|
|
870
|
+
/**
|
|
871
|
+
* A variable is a placeholder for a value. You can use variables in metric queries and in panel titles.
|
|
872
|
+
*/
|
|
873
|
+
export interface VariableModel {
|
|
874
|
+
/**
|
|
875
|
+
* Type of variable
|
|
876
|
+
*/
|
|
877
|
+
type: VariableType;
|
|
878
|
+
/**
|
|
879
|
+
* Name of variable
|
|
880
|
+
*/
|
|
881
|
+
name: string;
|
|
882
|
+
/**
|
|
883
|
+
* Optional display name
|
|
884
|
+
*/
|
|
885
|
+
label?: string;
|
|
886
|
+
/**
|
|
887
|
+
* Visibility configuration for the variable
|
|
888
|
+
*/
|
|
889
|
+
hide?: VariableHide;
|
|
890
|
+
/**
|
|
891
|
+
* Whether the variable value should be managed by URL query params or not
|
|
892
|
+
*/
|
|
893
|
+
skipUrlSync?: boolean;
|
|
894
|
+
/**
|
|
895
|
+
* Description of variable. It can be defined but `null`.
|
|
896
|
+
*/
|
|
897
|
+
description?: string;
|
|
898
|
+
/**
|
|
899
|
+
* Query used to fetch values for a variable
|
|
900
|
+
*/
|
|
901
|
+
query?: string | Record<string, Record<string, unknown>>;
|
|
902
|
+
/**
|
|
903
|
+
* Data source used to fetch values for a variable. It can be defined but `null`.
|
|
904
|
+
*/
|
|
905
|
+
datasource?: DataSourceRef;
|
|
906
|
+
/**
|
|
907
|
+
* Shows current selected variable text/value on the dashboard
|
|
908
|
+
*/
|
|
909
|
+
current?: VariableOption;
|
|
910
|
+
/**
|
|
911
|
+
* Whether multiple values can be selected or not from variable value list
|
|
912
|
+
*/
|
|
913
|
+
multi?: boolean;
|
|
914
|
+
/**
|
|
915
|
+
* Allow custom values to be entered in the variable
|
|
916
|
+
*/
|
|
917
|
+
allowCustomValue?: boolean;
|
|
918
|
+
/**
|
|
919
|
+
* Options that can be selected for a variable.
|
|
920
|
+
*/
|
|
921
|
+
options?: VariableOption[];
|
|
922
|
+
/**
|
|
923
|
+
* Options to config when to refresh a variable
|
|
924
|
+
*/
|
|
925
|
+
refresh?: VariableRefresh;
|
|
926
|
+
/**
|
|
927
|
+
* Options sort order
|
|
928
|
+
*/
|
|
929
|
+
sort?: VariableSort;
|
|
930
|
+
/**
|
|
931
|
+
* Whether all value option is available or not
|
|
932
|
+
*/
|
|
933
|
+
includeAll?: boolean;
|
|
934
|
+
/**
|
|
935
|
+
* Custom all value
|
|
936
|
+
*/
|
|
937
|
+
allValue?: string;
|
|
938
|
+
/**
|
|
939
|
+
* Optional field, if you want to extract part of a series name or metric node segment.
|
|
940
|
+
* Named capture groups can be used to separate the display text and value.
|
|
941
|
+
*/
|
|
942
|
+
regex?: string;
|
|
943
|
+
/**
|
|
944
|
+
* Additional static options for query variable
|
|
945
|
+
*/
|
|
946
|
+
staticOptions?: VariableOption[];
|
|
947
|
+
/**
|
|
948
|
+
* Ordering of static options in relation to options returned from data source for query variable
|
|
949
|
+
*/
|
|
950
|
+
staticOptionsOrder?: "before" | "after" | "sorted";
|
|
951
|
+
/**
|
|
952
|
+
* Dynamically calculates interval by dividing time range by the count specified.
|
|
953
|
+
*/
|
|
954
|
+
auto?: boolean;
|
|
955
|
+
/**
|
|
956
|
+
* The minimum threshold below which the step count intervals will not divide the time.
|
|
957
|
+
*/
|
|
958
|
+
auto_min?: string;
|
|
959
|
+
/**
|
|
960
|
+
* How many times the current time range should be divided to calculate the value, similar to the Max data points query option.
|
|
961
|
+
* For example, if the current visible time range is 30 minutes, then the auto interval groups the data into 30 one-minute increments.
|
|
962
|
+
*/
|
|
963
|
+
auto_count?: number;
|
|
964
|
+
definition?: string;
|
|
965
|
+
}
|
|
966
|
+
/**
|
|
967
|
+
* Dashboard variable type
|
|
968
|
+
* `query`: Query-generated list of values such as metric names, server names, sensor IDs, data centers, and so on.
|
|
969
|
+
* `adhoc`: Key/value filters that are automatically added to all metric queries for a data source (Prometheus, Loki, InfluxDB, and Elasticsearch only).
|
|
970
|
+
* `constant`: Define a hidden constant.
|
|
971
|
+
* `datasource`: Quickly change the data source for an entire dashboard.
|
|
972
|
+
* `interval`: Interval variables represent time spans.
|
|
973
|
+
* `textbox`: Display a free text input field with an optional default value.
|
|
974
|
+
* `custom`: Define the variable options manually using a comma-separated list.
|
|
975
|
+
* `system`: Variables defined by Grafana. See: https://grafana.com/docs/grafana/latest/dashboards/variables/add-template-variables/#global-variables
|
|
976
|
+
* `switch`: Boolean variables rendered as a switch
|
|
977
|
+
*/
|
|
978
|
+
export type VariableType = "query" | "adhoc" | "groupby" | "constant" | "datasource" | "interval" | "textbox" | "custom" | "system" | "snapshot" | "switch";
|
|
979
|
+
/**
|
|
980
|
+
* Determine if the variable shows on dashboard
|
|
981
|
+
* Accepted values are 0 (show label and value), 1 (show value only), 2 (show nothing), 3 (show under the controls dropdown menu).
|
|
982
|
+
*/
|
|
983
|
+
export type VariableHide = 0 | 1 | 2 | 3;
|
|
984
|
+
/**
|
|
985
|
+
* Option to be selected in a variable.
|
|
986
|
+
*/
|
|
987
|
+
export interface VariableOption {
|
|
988
|
+
/**
|
|
989
|
+
* Whether the option is selected or not
|
|
990
|
+
*/
|
|
991
|
+
selected?: boolean;
|
|
992
|
+
/**
|
|
993
|
+
* Text to be displayed for the option
|
|
994
|
+
*/
|
|
995
|
+
text: string | string[];
|
|
996
|
+
/**
|
|
997
|
+
* Value of the option
|
|
998
|
+
*/
|
|
999
|
+
value: string | string[];
|
|
1000
|
+
}
|
|
1001
|
+
/**
|
|
1002
|
+
* Options to config when to refresh a variable
|
|
1003
|
+
* `0`: Never refresh the variable
|
|
1004
|
+
* `1`: Queries the data source every time the dashboard loads.
|
|
1005
|
+
* `2`: Queries the data source when the dashboard time range changes.
|
|
1006
|
+
*/
|
|
1007
|
+
export type VariableRefresh = 0 | 1 | 2;
|
|
1008
|
+
/**
|
|
1009
|
+
* Sort variable options
|
|
1010
|
+
* Accepted values are:
|
|
1011
|
+
* `0`: No sorting
|
|
1012
|
+
* `1`: Alphabetical ASC
|
|
1013
|
+
* `2`: Alphabetical DESC
|
|
1014
|
+
* `3`: Numerical ASC
|
|
1015
|
+
* `4`: Numerical DESC
|
|
1016
|
+
* `5`: Alphabetical Case Insensitive ASC
|
|
1017
|
+
* `6`: Alphabetical Case Insensitive DESC
|
|
1018
|
+
* `7`: Natural ASC
|
|
1019
|
+
* `8`: Natural DESC
|
|
1020
|
+
*/
|
|
1021
|
+
export type VariableSort = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8;
|
|
1022
|
+
/**
|
|
1023
|
+
* Contains the list of annotations that are associated with the dashboard.
|
|
1024
|
+
* Annotations are used to overlay event markers and overlay event tags on graphs.
|
|
1025
|
+
* Grafana comes with a native annotation store and the ability to add annotation events directly from the graph panel or via the HTTP API.
|
|
1026
|
+
* See https://grafana.com/docs/grafana/latest/dashboards/build-dashboards/annotate-visualizations/
|
|
1027
|
+
*/
|
|
1028
|
+
export interface AnnotationContainer {
|
|
1029
|
+
/**
|
|
1030
|
+
* List of annotations
|
|
1031
|
+
*/
|
|
1032
|
+
list?: AnnotationQuery[];
|
|
1033
|
+
}
|
|
1034
|
+
/**
|
|
1035
|
+
* TODO docs
|
|
1036
|
+
* FROM: AnnotationQuery in grafana-data/src/types/annotations.ts
|
|
1037
|
+
*/
|
|
1038
|
+
export interface AnnotationQuery {
|
|
1039
|
+
/**
|
|
1040
|
+
* Name of annotation.
|
|
1041
|
+
*/
|
|
1042
|
+
name: string;
|
|
1043
|
+
/**
|
|
1044
|
+
* Datasource where the annotations data is
|
|
1045
|
+
*/
|
|
1046
|
+
datasource?: DataSourceRef;
|
|
1047
|
+
/**
|
|
1048
|
+
* When enabled the annotation query is issued with every dashboard refresh
|
|
1049
|
+
*/
|
|
1050
|
+
enable: boolean;
|
|
1051
|
+
/**
|
|
1052
|
+
* Annotation queries can be toggled on or off at the top of the dashboard.
|
|
1053
|
+
* When hide is true, the toggle is not shown in the dashboard.
|
|
1054
|
+
*/
|
|
1055
|
+
hide?: boolean;
|
|
1056
|
+
/**
|
|
1057
|
+
* Color to use for the annotation event markers
|
|
1058
|
+
*/
|
|
1059
|
+
iconColor: string;
|
|
1060
|
+
/**
|
|
1061
|
+
* Filters to apply when fetching annotations
|
|
1062
|
+
*/
|
|
1063
|
+
filter?: AnnotationPanelFilter;
|
|
1064
|
+
/**
|
|
1065
|
+
* TODO.. this should just be a normal query target
|
|
1066
|
+
*/
|
|
1067
|
+
target?: Record<string, unknown>;
|
|
1068
|
+
/**
|
|
1069
|
+
* TODO -- this should not exist here, it is based on the --grafana-- datasource
|
|
1070
|
+
*/
|
|
1071
|
+
type?: string;
|
|
1072
|
+
/**
|
|
1073
|
+
* Set to 1 for the standard annotation query all dashboards have by default.
|
|
1074
|
+
*/
|
|
1075
|
+
builtIn?: number;
|
|
1076
|
+
/**
|
|
1077
|
+
* Placement can be used to display the annotation query somewhere else on the dashboard other than the default location.
|
|
1078
|
+
*/
|
|
1079
|
+
placement?: AnnotationQueryPlacement;
|
|
1080
|
+
expr?: string;
|
|
1081
|
+
/**
|
|
1082
|
+
* Format for Prometheus annotation text. Label values can be interpolated with templates like {{instance}}.
|
|
1083
|
+
*/
|
|
1084
|
+
textFormat?: string;
|
|
1085
|
+
/**
|
|
1086
|
+
* Format for Prometheus and Loki annotation titles. Label values can be interpolated with templates like {{instance}}.
|
|
1087
|
+
*/
|
|
1088
|
+
titleFormat?: string;
|
|
1089
|
+
/**
|
|
1090
|
+
* Comma-separated label keys used as annotation tags.
|
|
1091
|
+
*/
|
|
1092
|
+
tagKeys?: string;
|
|
1093
|
+
/**
|
|
1094
|
+
* Legacy Prometheus annotation query step interval.
|
|
1095
|
+
*/
|
|
1096
|
+
step?: string;
|
|
1097
|
+
/**
|
|
1098
|
+
* Use the Prometheus series value as the annotation timestamp.
|
|
1099
|
+
*/
|
|
1100
|
+
useValueForTime?: boolean;
|
|
1101
|
+
/**
|
|
1102
|
+
* Mappings define how to convert data frame fields to annotation event fields.
|
|
1103
|
+
*/
|
|
1104
|
+
mappings?: Record<string, AnnotationEventFieldMapping>;
|
|
1105
|
+
}
|
|
1106
|
+
export interface AnnotationPanelFilter {
|
|
1107
|
+
/**
|
|
1108
|
+
* Should the specified panels be included or excluded
|
|
1109
|
+
*/
|
|
1110
|
+
exclude?: boolean;
|
|
1111
|
+
/**
|
|
1112
|
+
* Panel IDs that should be included or excluded
|
|
1113
|
+
*/
|
|
1114
|
+
ids: number[];
|
|
1115
|
+
}
|
|
1116
|
+
/**
|
|
1117
|
+
* TODO: this should be a regular DataQuery that depends on the selected dashboard
|
|
1118
|
+
* these match the properties of the "grafana" datasouce that is default in most dashboards
|
|
1119
|
+
*/
|
|
1120
|
+
export interface AnnotationTarget {
|
|
1121
|
+
/**
|
|
1122
|
+
* Only required/valid for the grafana datasource...
|
|
1123
|
+
* but code+tests is already depending on it so hard to change
|
|
1124
|
+
*/
|
|
1125
|
+
limit: number;
|
|
1126
|
+
/**
|
|
1127
|
+
* Only required/valid for the grafana datasource...
|
|
1128
|
+
* but code+tests is already depending on it so hard to change
|
|
1129
|
+
*/
|
|
1130
|
+
matchAny: boolean;
|
|
1131
|
+
/**
|
|
1132
|
+
* Only required/valid for the grafana datasource...
|
|
1133
|
+
* but code+tests is already depending on it so hard to change
|
|
1134
|
+
*/
|
|
1135
|
+
tags: string[];
|
|
1136
|
+
/**
|
|
1137
|
+
* Only required/valid for the grafana datasource...
|
|
1138
|
+
* but code+tests is already depending on it so hard to change
|
|
1139
|
+
*/
|
|
1140
|
+
type: string;
|
|
1141
|
+
}
|
|
1142
|
+
/**
|
|
1143
|
+
* Annotation Query placement. Defines where the annotation query should be displayed.
|
|
1144
|
+
* - "inControlsMenu" renders the annotation query in the dashboard controls dropdown menu
|
|
1145
|
+
*/
|
|
1146
|
+
export type AnnotationQueryPlacement = "inControlsMenu";
|
|
1147
|
+
/**
|
|
1148
|
+
* A dashboard snapshot shares an interactive dashboard publicly.
|
|
1149
|
+
* It is a read-only version of a dashboard, and is not editable.
|
|
1150
|
+
* It is possible to create a snapshot of a snapshot.
|
|
1151
|
+
* Grafana strips away all sensitive information from the dashboard.
|
|
1152
|
+
* Sensitive information stripped: queries (metric, template,annotation) and panel links.
|
|
1153
|
+
*/
|
|
1154
|
+
export interface Snapshot {
|
|
1155
|
+
/**
|
|
1156
|
+
* Time when the snapshot was created
|
|
1157
|
+
*/
|
|
1158
|
+
created: string;
|
|
1159
|
+
/**
|
|
1160
|
+
* Time when the snapshot expires, default is never to expire
|
|
1161
|
+
*/
|
|
1162
|
+
expires: string;
|
|
1163
|
+
/**
|
|
1164
|
+
* Is the snapshot saved in an external grafana instance
|
|
1165
|
+
*/
|
|
1166
|
+
external: boolean;
|
|
1167
|
+
/**
|
|
1168
|
+
* external url, if snapshot was shared in external grafana instance
|
|
1169
|
+
*/
|
|
1170
|
+
externalUrl: string;
|
|
1171
|
+
/**
|
|
1172
|
+
* original url, url of the dashboard that was snapshotted
|
|
1173
|
+
*/
|
|
1174
|
+
originalUrl: string;
|
|
1175
|
+
/**
|
|
1176
|
+
* Unique identifier of the snapshot
|
|
1177
|
+
*/
|
|
1178
|
+
id: number;
|
|
1179
|
+
/**
|
|
1180
|
+
* Optional, defined the unique key of the snapshot, required if external is true
|
|
1181
|
+
*/
|
|
1182
|
+
key: string;
|
|
1183
|
+
/**
|
|
1184
|
+
* Optional, name of the snapshot
|
|
1185
|
+
*/
|
|
1186
|
+
name: string;
|
|
1187
|
+
/**
|
|
1188
|
+
* org id of the snapshot
|
|
1189
|
+
*/
|
|
1190
|
+
orgId: number;
|
|
1191
|
+
/**
|
|
1192
|
+
* last time when the snapshot was updated
|
|
1193
|
+
*/
|
|
1194
|
+
updated: string;
|
|
1195
|
+
/**
|
|
1196
|
+
* url of the snapshot, if snapshot was shared internally
|
|
1197
|
+
*/
|
|
1198
|
+
url?: string;
|
|
1199
|
+
/**
|
|
1200
|
+
* user id of the snapshot creator
|
|
1201
|
+
*/
|
|
1202
|
+
userId: number;
|
|
1203
|
+
dashboard?: Dashboard;
|
|
1204
|
+
}
|
|
1205
|
+
/**
|
|
1206
|
+
* Annotation event field source. Defines how to obtain the value for an annotation event field.
|
|
1207
|
+
* - "field": Find the value with a matching key (default)
|
|
1208
|
+
* - "text": Write a constant string into the value
|
|
1209
|
+
* - "skip": Do not include the field
|
|
1210
|
+
*/
|
|
1211
|
+
export type AnnotationEventFieldSource = "field" | "text" | "skip";
|
|
1212
|
+
/**
|
|
1213
|
+
* Annotation event field mapping. Defines how to map a data frame field to an annotation event field.
|
|
1214
|
+
*/
|
|
1215
|
+
export interface AnnotationEventFieldMapping {
|
|
1216
|
+
/**
|
|
1217
|
+
* Source type for the field value.
|
|
1218
|
+
*/
|
|
1219
|
+
source?: AnnotationEventFieldSource;
|
|
1220
|
+
/**
|
|
1221
|
+
* Constant value to use when source is "text".
|
|
1222
|
+
*/
|
|
1223
|
+
value?: string;
|
|
1224
|
+
/**
|
|
1225
|
+
* Regular expression to apply to the field value.
|
|
1226
|
+
*/
|
|
1227
|
+
regex?: string;
|
|
1228
|
+
}
|
|
1229
|
+
/** The dashboard `schemaVersion` the pinned schema defaults to, and the one chant emits. */
|
|
1230
|
+
export declare const DASHBOARD_SCHEMA_VERSION = 42;
|
|
1231
|
+
//# sourceMappingURL=dashboard.gen.d.ts.map
|