@intentius/chant-lexicon-grafana 0.99.0 → 0.100.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.
Files changed (224) hide show
  1. package/README.md +12 -6
  2. package/dist/annotations.d.ts +61 -0
  3. package/dist/annotations.d.ts.map +1 -0
  4. package/dist/api/apply.d.ts +8 -4
  5. package/dist/api/apply.d.ts.map +1 -1
  6. package/dist/api/fake-grafana.d.ts +2 -0
  7. package/dist/api/fake-grafana.d.ts.map +1 -1
  8. package/dist/api/folders.d.ts +53 -17
  9. package/dist/api/folders.d.ts.map +1 -1
  10. package/dist/build.d.ts +26 -5
  11. package/dist/build.d.ts.map +1 -1
  12. package/dist/catalog.d.ts +1 -1
  13. package/dist/catalog.d.ts.map +1 -1
  14. package/dist/codegen/docs.d.ts.map +1 -1
  15. package/dist/codegen/generate.d.ts +7 -1
  16. package/dist/codegen/generate.d.ts.map +1 -1
  17. package/dist/composites/shared.d.ts +4 -3
  18. package/dist/composites/shared.d.ts.map +1 -1
  19. package/dist/dashboard.d.ts +42 -14
  20. package/dist/dashboard.d.ts.map +1 -1
  21. package/dist/datasource-refs.d.ts +9 -5
  22. package/dist/datasource-refs.d.ts.map +1 -1
  23. package/dist/datasource-settings.d.ts +834 -0
  24. package/dist/datasource-settings.d.ts.map +1 -0
  25. package/dist/datasource.d.ts +53 -11
  26. package/dist/datasource.d.ts.map +1 -1
  27. package/dist/deep-observe-hooks.d.ts +1 -1
  28. package/dist/deep-observe-hooks.d.ts.map +1 -1
  29. package/dist/deep-observe.d.ts +9 -4
  30. package/dist/deep-observe.d.ts.map +1 -1
  31. package/dist/describe-resources.d.ts +1 -0
  32. package/dist/describe-resources.d.ts.map +1 -1
  33. package/dist/detect.d.ts +4 -2
  34. package/dist/detect.d.ts.map +1 -1
  35. package/dist/folder.d.ts +68 -0
  36. package/dist/folder.d.ts.map +1 -0
  37. package/dist/import/generator.d.ts.map +1 -1
  38. package/dist/import/mappings.d.ts +12 -6
  39. package/dist/import/mappings.d.ts.map +1 -1
  40. package/dist/import/model.d.ts +7 -0
  41. package/dist/import/model.d.ts.map +1 -1
  42. package/dist/import/normalize.d.ts.map +1 -1
  43. package/dist/import/parser.d.ts +16 -1
  44. package/dist/import/parser.d.ts.map +1 -1
  45. package/dist/import/testdata/fixtures.d.ts +6 -0
  46. package/dist/import/testdata/fixtures.d.ts.map +1 -1
  47. package/dist/import/v2.d.ts +4 -3
  48. package/dist/import/v2.d.ts.map +1 -1
  49. package/dist/index.d.ts +11 -9
  50. package/dist/index.d.ts.map +1 -1
  51. package/dist/init-templates.d.ts +27 -0
  52. package/dist/init-templates.d.ts.map +1 -0
  53. package/dist/integrity.json +11 -9
  54. package/dist/lint/audit-catalog.d.ts +1 -1
  55. package/dist/lint/audit-catalog.d.ts.map +1 -1
  56. package/dist/lint/post-synth/graf101.d.ts +1 -1
  57. package/dist/lint/post-synth/graf104.d.ts +2 -2
  58. package/dist/lint/post-synth/graf106.d.ts +2 -2
  59. package/dist/lint/post-synth/graf110.d.ts +8 -0
  60. package/dist/lint/post-synth/graf110.d.ts.map +1 -0
  61. package/dist/lint/post-synth/grafana-helpers.d.ts.map +1 -1
  62. package/dist/lint/post-synth/index.d.ts.map +1 -1
  63. package/dist/manifest.json +1 -1
  64. package/dist/meta.json +70 -0
  65. package/dist/okf/index.md +18 -3
  66. package/dist/okf/rules/GRAF101.md +2 -2
  67. package/dist/okf/rules/GRAF104.md +2 -2
  68. package/dist/okf/rules/GRAF106.md +2 -2
  69. package/dist/okf/rules/GRAF110.md +11 -0
  70. package/dist/okf/types/AdhocVariable.md +9 -0
  71. package/dist/okf/types/AzureMonitorQuery.md +9 -0
  72. package/dist/okf/types/BigQueryQuery.md +9 -0
  73. package/dist/okf/types/CloudMonitoringQuery.md +9 -0
  74. package/dist/okf/types/CloudWatchQuery.md +9 -0
  75. package/dist/okf/types/Dashboard.md +1 -1
  76. package/dist/okf/types/Datasource.md +1 -1
  77. package/dist/okf/types/DatasourceProvisioning.md +9 -0
  78. package/dist/okf/types/ElasticsearchQuery.md +9 -0
  79. package/dist/okf/types/ExternalDatasource.md +1 -1
  80. package/dist/okf/types/Folder.md +9 -0
  81. package/dist/okf/types/GroupByVariable.md +9 -0
  82. package/dist/okf/types/MSSQLQuery.md +9 -0
  83. package/dist/okf/types/MySQLQuery.md +9 -0
  84. package/dist/okf/types/PostgresQuery.md +9 -0
  85. package/dist/okf/types/PyroscopeQuery.md +9 -0
  86. package/dist/okf/types/SwitchVariable.md +9 -0
  87. package/dist/op/activities/grafana-apply.d.ts +11 -0
  88. package/dist/op/activities/grafana-apply.d.ts.map +1 -1
  89. package/dist/op/activities/index.d.ts +1 -1
  90. package/dist/op/activities/index.d.ts.map +1 -1
  91. package/dist/ownership.d.ts +11 -0
  92. package/dist/ownership.d.ts.map +1 -1
  93. package/dist/pin.d.ts +1 -1
  94. package/dist/pin.d.ts.map +1 -1
  95. package/dist/plugin.d.ts.map +1 -1
  96. package/dist/promql-check.d.ts.map +1 -1
  97. package/dist/query-models.d.ts +95 -0
  98. package/dist/query-models.d.ts.map +1 -0
  99. package/dist/query.d.ts +107 -10
  100. package/dist/query.d.ts.map +1 -1
  101. package/dist/rules/graf101.ts +2 -2
  102. package/dist/rules/graf104.ts +3 -3
  103. package/dist/rules/graf106.ts +3 -3
  104. package/dist/rules/graf110.ts +17 -0
  105. package/dist/rules/grafana-helpers.ts +13 -3
  106. package/dist/schema/azuremonitor.gen.d.ts +354 -0
  107. package/dist/schema/azuremonitor.gen.d.ts.map +1 -0
  108. package/dist/schema/bigquery.gen.d.ts +93 -0
  109. package/dist/schema/bigquery.gen.d.ts.map +1 -0
  110. package/dist/schema/cloudwatch.gen.d.ts +394 -0
  111. package/dist/schema/cloudwatch.gen.d.ts.map +1 -0
  112. package/dist/schema/elasticsearch.gen.d.ts +444 -0
  113. package/dist/schema/elasticsearch.gen.d.ts.map +1 -0
  114. package/dist/schema/googlecloudmonitoring.gen.d.ts +312 -0
  115. package/dist/schema/googlecloudmonitoring.gen.d.ts.map +1 -0
  116. package/dist/schema/grafanapyroscope.gen.d.ts +60 -0
  117. package/dist/schema/grafanapyroscope.gen.d.ts.map +1 -0
  118. package/dist/schema/index.d.ts +6 -0
  119. package/dist/schema/index.d.ts.map +1 -1
  120. package/dist/schema/table.gen.d.ts +13 -0
  121. package/dist/schema/table.gen.d.ts.map +1 -1
  122. package/dist/schema-validate.d.ts +9 -0
  123. package/dist/schema-validate.d.ts.map +1 -1
  124. package/dist/skill-defs.d.ts.map +1 -1
  125. package/dist/skills/chant-grafana-operations.md +108 -0
  126. package/dist/skills/chant-grafana.md +5 -4
  127. package/dist/spec/schemas.d.ts +9 -7
  128. package/dist/spec/schemas.d.ts.map +1 -1
  129. package/dist/spec/schemas.gen.d.ts +3 -0
  130. package/dist/spec/schemas.gen.d.ts.map +1 -0
  131. package/dist/validate-alerting.d.ts.map +1 -1
  132. package/dist/validate-output.d.ts +15 -2
  133. package/dist/validate-output.d.ts.map +1 -1
  134. package/dist/validate.d.ts.map +1 -1
  135. package/dist/validation.d.ts +14 -0
  136. package/dist/validation.d.ts.map +1 -0
  137. package/dist/variables.d.ts +102 -5
  138. package/dist/variables.d.ts.map +1 -1
  139. package/package.json +2 -2
  140. package/src/annotations.ts +84 -0
  141. package/src/api/apply.test.ts +19 -1
  142. package/src/api/apply.ts +18 -8
  143. package/src/api/fake-grafana.ts +6 -2
  144. package/src/api/folders.ts +106 -32
  145. package/src/build.test.ts +142 -6
  146. package/src/build.ts +126 -24
  147. package/src/catalog.ts +20 -2
  148. package/src/codegen/docs.ts +13 -6
  149. package/src/codegen/generate.ts +27 -1
  150. package/src/composites/shared.ts +3 -2
  151. package/src/dashboard.ts +59 -14
  152. package/src/datasource-refs.ts +30 -6
  153. package/src/datasource-settings.test.ts +106 -0
  154. package/src/datasource-settings.ts +941 -0
  155. package/src/datasource.ts +71 -11
  156. package/src/deep-observe-hooks.ts +16 -1
  157. package/src/deep-observe.test.ts +47 -1
  158. package/src/deep-observe.ts +36 -13
  159. package/src/describe-resources.test.ts +16 -0
  160. package/src/describe-resources.ts +36 -1
  161. package/src/detect.ts +3 -3
  162. package/src/folder.ts +118 -0
  163. package/src/generated/lexicon-grafana.json +70 -0
  164. package/src/import/generated-types.e2e.test.ts +15 -3
  165. package/src/import/generator.ts +2 -1
  166. package/src/import/mappings.ts +98 -26
  167. package/src/import/model.ts +7 -0
  168. package/src/import/normalize.ts +32 -3
  169. package/src/import/parser.test.ts +97 -21
  170. package/src/import/parser.ts +169 -18
  171. package/src/import/roundtrip.test.ts +104 -9
  172. package/src/import/testdata/fixtures.ts +8 -0
  173. package/src/import/v2.ts +4 -3
  174. package/src/index.ts +122 -13
  175. package/src/init-templates.test.ts +74 -0
  176. package/src/init-templates.ts +349 -0
  177. package/src/lint/audit-catalog.ts +9 -1
  178. package/src/lint/post-synth/graf101.ts +2 -2
  179. package/src/lint/post-synth/graf104.ts +3 -3
  180. package/src/lint/post-synth/graf106.ts +3 -3
  181. package/src/lint/post-synth/graf110.ts +17 -0
  182. package/src/lint/post-synth/grafana-helpers.ts +13 -3
  183. package/src/lint/post-synth/index.ts +2 -0
  184. package/src/lint/post-synth/post-synth.test.ts +99 -2
  185. package/src/load-cost.test.ts +35 -0
  186. package/src/op/activities/grafana-apply.e2e.test.ts +14 -5
  187. package/src/op/activities/grafana-apply.test.ts +16 -2
  188. package/src/op/activities/grafana-apply.ts +29 -3
  189. package/src/op/activities/index.ts +1 -1
  190. package/src/ownership.ts +19 -0
  191. package/src/panels.test.ts +3 -1
  192. package/src/pin.ts +12 -0
  193. package/src/plugin.test.ts +9 -2
  194. package/src/plugin.ts +9 -0
  195. package/src/promql-check.ts +5 -1
  196. package/src/query-models.ts +94 -0
  197. package/src/query.test.ts +166 -0
  198. package/src/query.ts +177 -12
  199. package/src/schema/azuremonitor.gen.ts +381 -0
  200. package/src/schema/bigquery.gen.ts +110 -0
  201. package/src/schema/cloudwatch.gen.ts +423 -0
  202. package/src/schema/elasticsearch.gen.ts +508 -0
  203. package/src/schema/googlecloudmonitoring.gen.ts +330 -0
  204. package/src/schema/grafanapyroscope.gen.ts +66 -0
  205. package/src/schema/index.ts +6 -0
  206. package/src/schema/table.gen.ts +14 -0
  207. package/src/schema-validate.ts +58 -7
  208. package/src/skill-defs.ts +17 -0
  209. package/src/skills/chant-grafana-operations.md +108 -0
  210. package/src/skills/chant-grafana.md +5 -4
  211. package/src/spec/overlay/table.overlay.json +19 -0
  212. package/src/spec/schemas/azuremonitor.jsonschema.json +679 -0
  213. package/src/spec/schemas/bigquery.jsonschema.json +290 -0
  214. package/src/spec/schemas/cloudwatch.jsonschema.json +721 -0
  215. package/src/spec/schemas/elasticsearch.jsonschema.json +1695 -0
  216. package/src/spec/schemas/googlecloudmonitoring.jsonschema.json +488 -0
  217. package/src/spec/schemas/grafanapyroscope.jsonschema.json +93 -0
  218. package/src/spec/schemas.gen.ts +40 -0
  219. package/src/spec/schemas.ts +9 -7
  220. package/src/validate-alerting.ts +4 -2
  221. package/src/validate-output.ts +96 -4
  222. package/src/validate.ts +14 -0
  223. package/src/validation.ts +27 -0
  224. package/src/variables.ts +113 -6
@@ -0,0 +1,834 @@
1
+ /**
2
+ * Typed `jsonData` and `secureJsonData` for the datasource plugins this
3
+ * lexicon has query classes for.
4
+ *
5
+ * Grafana defines datasource settings in each plugin's TypeScript (and reads
6
+ * them in its Go backend), with no CUE kind, so foundation-sdk publishes no
7
+ * schema for them. The types here are written by hand from the source of the
8
+ * plugin versions bundled with grafana/grafana:13.2.2 (the image's
9
+ * `data/plugins-bundled/<id>`, read through each plugin's source map), from
10
+ * Grafana's own tree at v13.2.2 for the plugins still in it (CloudWatch,
11
+ * Azure Monitor, `@grafana/sql`, `@grafana/o11y-ds-frontend`), and from
12
+ * grafana-plugin-sdk-go v0.296.2 (the version Grafana 13.2.2 builds with)
13
+ * for the HTTP client settings every HTTP-based plugin shares. Each type
14
+ * cites where it was read.
15
+ *
16
+ * Every key is optional: a provisioning file may leave anything out and
17
+ * Grafana fills in its defaults. Keys a plugin still reads from older
18
+ * versions are kept and marked deprecated. `secureJsonData` is typed by its
19
+ * keys only; the values are strings, which GRAF002 wants as `$__env{NAME}`
20
+ * or `$__file{/path}`.
21
+ *
22
+ * A field that names another datasource takes a `LinkedDatasource`: a
23
+ * declared or external datasource of a plugin type Grafana's picker offers
24
+ * there (written as its uid), or the uid as a string for anything else.
25
+ */
26
+ import type { DatasourceEntity, ExternalDatasourceEntity } from "./datasource.js";
27
+ import type { TraceqlFilter } from "./schema/tempo.gen.js";
28
+ /**
29
+ * Another datasource, named inside a datasource's settings: a declared or
30
+ * external datasource of one of the plugin types `T` (the build writes its
31
+ * uid), or a uid string, which is not checked.
32
+ */
33
+ export type LinkedDatasource<T extends string = string> = DatasourceEntity<T> | ExternalDatasourceEntity<T> | string;
34
+ /**
35
+ * The tracing datasources Grafana's picker offers for exemplar and derived
36
+ * field links: the bundled plugins whose plugin.json sets `tracing: true`
37
+ * in grafana/grafana:13.2.2.
38
+ */
39
+ export declare const TRACING_DATASOURCE_TYPES: readonly ["tempo", "jaeger", "zipkin"];
40
+ export type TracingDatasourceType = (typeof TRACING_DATASOURCE_TYPES)[number];
41
+ /**
42
+ * The logs datasources the traces-to-logs picker offers: `supportedDataSourceTypes`,
43
+ * packages/grafana-o11y-ds-frontend/src/TraceToLogs/TraceToLogsSettings.tsx:80-88 at v13.2.2.
44
+ */
45
+ export declare const TRACE_TO_LOGS_DATASOURCE_TYPES: readonly ["loki", "elasticsearch", "grafana-splunk-datasource", "grafana-opensearch-datasource", "grafana-falconlogscale-datasource", "googlecloud-logging-datasource", "victoriametrics-logs-datasource"];
46
+ export type TraceToLogsDatasourceType = (typeof TRACE_TO_LOGS_DATASOURCE_TYPES)[number];
47
+ /** The metrics datasources the traces-to-metrics picker offers, TraceToMetricsSettings.tsx:38-41 at v13.2.2. */
48
+ export declare const TRACE_TO_METRICS_DATASOURCE_TYPES: readonly ["prometheus", "victoriametrics-metrics-datasource"];
49
+ export type TraceToMetricsDatasourceType = (typeof TRACE_TO_METRICS_DATASOURCE_TYPES)[number];
50
+ /**
51
+ * Settings every datasource may carry: `DataSourceJsonData`,
52
+ * packages/grafana-data/src/types/datasource.ts:755-763 at v13.2.2.
53
+ */
54
+ export interface CommonJsonData {
55
+ authType?: string;
56
+ defaultRegion?: string;
57
+ profile?: string;
58
+ /** Show this datasource's alert rules in Grafana Alerting. */
59
+ manageAlerts?: boolean;
60
+ allowAsRecordingRulesTarget?: boolean;
61
+ /** The Alertmanager datasource this one's alerts go to. */
62
+ alertmanagerUid?: LinkedDatasource<"alertmanager">;
63
+ disableGrafanaCache?: boolean;
64
+ }
65
+ /**
66
+ * The HTTP client settings every HTTP-based plugin shares, read by
67
+ * grafana-plugin-sdk-go v0.296.2: `parseHTTPSettings` in
68
+ * backend/http_settings.go:108-305, the secure socks proxy in
69
+ * backend/proxy/secure_socks_proxy.go:245 and backend/common.go:336-383.
70
+ * `keepCookies`, `timeout` and `oauthPassThru` are also what @grafana/plugin-ui's
71
+ * `AdvancedHttpSettings` and `Auth` config components write.
72
+ */
73
+ export interface HttpJsonData extends CommonJsonData {
74
+ /** Request timeout, in seconds. */
75
+ timeout?: number;
76
+ dialTimeout?: number;
77
+ httpKeepAlive?: number;
78
+ httpTLSHandshakeTimeout?: number;
79
+ httpExpectContinueTimeout?: number;
80
+ httpMaxConnsPerHost?: number;
81
+ httpMaxIdleConns?: number;
82
+ httpMaxIdleConnsPerHost?: number;
83
+ httpIdleConnTimeout?: number;
84
+ /** Present a client certificate (`tlsClientCert`, `tlsClientKey`). */
85
+ tlsAuth?: boolean;
86
+ /** Verify the server against `tlsCACert`. */
87
+ tlsAuthWithCACert?: boolean;
88
+ tlsSkipVerify?: boolean;
89
+ /** The TLS server name to verify. */
90
+ serverName?: string;
91
+ /** Sign requests with AWS SigV4. */
92
+ sigV4Auth?: boolean;
93
+ sigV4AuthType?: string;
94
+ sigV4Region?: string;
95
+ sigV4AssumeRoleArn?: string;
96
+ sigV4ExternalId?: string;
97
+ sigV4Profile?: string;
98
+ /** Forward the user's OAuth identity to the datasource. */
99
+ oauthPassThru?: boolean;
100
+ /** Cookies to forward to the datasource, by name. */
101
+ keepCookies?: string[];
102
+ enableSecureSocksProxy?: boolean;
103
+ secureSocksProxyUsername?: string;
104
+ /** Secure socks proxy keep-alive, in seconds. */
105
+ keepAlive?: number;
106
+ /** Custom headers: `httpHeaderName1` names the header whose value is `secureJsonData.httpHeaderValue1`. */
107
+ [header: `httpHeaderName${number}`]: string | undefined;
108
+ }
109
+ /** `secureJsonData` keys the HTTP client reads (same sources as `HttpJsonData`); `password` is the datasource user's (backend/common.go:142-146). */
110
+ export type HttpSecureJsonKey = "basicAuthPassword" | "password" | "tlsCACert" | "tlsClientCert" | "tlsClientKey" | "sigV4AccessKey" | "sigV4SecretKey" | "sigV4SessionToken" | "secureSocksProxyPassword" | `httpHeaderValue${number}`;
111
+ /** `TraceToLogsTag`, packages/grafana-o11y-ds-frontend/src/TraceToLogs/TraceToLogsSettings.tsx:18-21 at v13.2.2. */
112
+ export interface TraceToLogsTag {
113
+ key: string;
114
+ value?: string;
115
+ }
116
+ /**
117
+ * Trace to logs: `TraceToLogsOptionsV2`, TraceToLogsSettings.tsx:36-45.
118
+ * `customQuery` is required there; the editor treats a missing one as false.
119
+ */
120
+ export interface TraceToLogsOptionsV2 {
121
+ datasourceUid?: LinkedDatasource<TraceToLogsDatasourceType>;
122
+ tags?: TraceToLogsTag[];
123
+ spanStartTimeShift?: string;
124
+ spanEndTimeShift?: string;
125
+ filterByTraceID?: boolean;
126
+ filterBySpanID?: boolean;
127
+ /** The logs query, when `customQuery` is set. */
128
+ query?: string;
129
+ customQuery?: boolean;
130
+ }
131
+ /**
132
+ * @deprecated The pre-9.x trace-to-logs settings, `TraceToLogsOptions` (TraceToLogsSettings.tsx:24-34).
133
+ * Grafana reads them when `tracesToLogsV2` is absent and rewrites them as `tracesToLogsV2` when the settings are saved.
134
+ */
135
+ export interface TraceToLogsOptions {
136
+ datasourceUid?: LinkedDatasource<TraceToLogsDatasourceType>;
137
+ tags?: string[];
138
+ mappedTags?: TraceToLogsTag[];
139
+ mapTagNamesEnabled?: boolean;
140
+ spanStartTimeShift?: string;
141
+ spanEndTimeShift?: string;
142
+ filterByTraceID?: boolean;
143
+ filterBySpanID?: boolean;
144
+ lokiSearch?: boolean;
145
+ }
146
+ /**
147
+ * Trace to metrics: `TraceToMetricsOptions` and `TraceToMetricQuery`,
148
+ * packages/grafana-o11y-ds-frontend/src/TraceToMetrics/TraceToMetricsSettings.tsx:18-29
149
+ * at v13.2.2; the picker offers `prometheus` and `victoriametrics-metrics-datasource` (lines 38-41).
150
+ */
151
+ export interface TraceToMetricsOptions {
152
+ datasourceUid?: LinkedDatasource<TraceToMetricsDatasourceType>;
153
+ tags?: Array<{
154
+ key: string;
155
+ value?: string;
156
+ }>;
157
+ queries?: Array<{
158
+ name?: string;
159
+ query?: string;
160
+ }>;
161
+ spanStartTimeShift?: string;
162
+ spanEndTimeShift?: string;
163
+ }
164
+ /**
165
+ * Trace to profiles: `TraceToProfilesOptions`,
166
+ * packages/grafana-o11y-ds-frontend/src/TraceToProfiles/TraceToProfilesSettings.tsx:21-27
167
+ * at v13.2.2; the picker offers only `grafana-pyroscope-datasource` (line 36).
168
+ */
169
+ export interface TraceToProfilesOptions {
170
+ datasourceUid?: LinkedDatasource<"grafana-pyroscope-datasource">;
171
+ tags?: Array<{
172
+ key: string;
173
+ value?: string;
174
+ }>;
175
+ query?: string;
176
+ profileTypeId?: string;
177
+ customQuery?: boolean;
178
+ }
179
+ /**
180
+ * Where an exemplar's trace id links: `ExemplarTraceIdDestination`,
181
+ * packages/grafana-prometheus/src/types.ts:58-63 in prometheus 13.1.7
182
+ * (bundled with grafana/grafana:13.2.2). Either `datasourceUid` (an
183
+ * internal link to a tracing datasource) or `url`.
184
+ */
185
+ export interface ExemplarTraceIdDestination {
186
+ /** The exemplar label that holds the trace id, e.g. `trace_id`. */
187
+ name: string;
188
+ datasourceUid?: LinkedDatasource<TracingDatasourceType>;
189
+ url?: string;
190
+ urlDisplayLabel?: string;
191
+ }
192
+ /**
193
+ * Prometheus settings: `PromOptions`, packages/grafana-prometheus/src/types.ts:35-56
194
+ * in prometheus 13.1.7, bundled with grafana/grafana:13.2.2, with the
195
+ * enums at types.ts:21-33 and querybuilder/shared/types.ts:88-91.
196
+ */
197
+ export interface PrometheusJsonData extends HttpJsonData {
198
+ /** The scrape interval, the lower bound for `$__interval`, e.g. `15s`. */
199
+ timeInterval?: string;
200
+ queryTimeout?: string;
201
+ httpMethod?: "POST" | "GET";
202
+ /** Extra query string parameters, `a=b&c=d`. */
203
+ customQueryParameters?: string;
204
+ disableMetricsLookup?: boolean;
205
+ exemplarTraceIdDestinations?: ExemplarTraceIdDestination[];
206
+ prometheusType?: "Prometheus" | "Cortex" | "Mimir" | "Thanos";
207
+ prometheusVersion?: string;
208
+ cacheLevel?: "Low" | "Medium" | "High" | "None";
209
+ defaultEditor?: "code" | "builder";
210
+ incrementalQuerying?: boolean;
211
+ incrementalQueryOverlapWindow?: string;
212
+ disableRecordingRules?: boolean;
213
+ seriesEndpoint?: boolean;
214
+ seriesLimit?: number;
215
+ maxSamplesProcessedWarningThreshold?: number;
216
+ maxSamplesProcessedErrorThreshold?: number;
217
+ queryStatsEnabled?: boolean;
218
+ }
219
+ /**
220
+ * A derived field: a link from a log line (by regex) or a label to a URL or
221
+ * a tracing datasource. `DerivedFieldConfig`, types.ts:57-65 in loki 13.2.0
222
+ * (bundled with grafana/grafana:13.2.2); the datasource picker is limited to
223
+ * tracing datasources (configuration/DerivedField.tsx:192).
224
+ */
225
+ export interface DerivedFieldConfig {
226
+ /** The regex (or, with `matcherType: "label"`, the label name) the value is taken from. */
227
+ matcherRegex: string;
228
+ name: string;
229
+ url?: string;
230
+ urlDisplayLabel?: string;
231
+ datasourceUid?: LinkedDatasource<TracingDatasourceType>;
232
+ matcherType?: "label" | "regex";
233
+ targetBlank?: boolean;
234
+ }
235
+ /**
236
+ * Loki settings: `LokiOptions`, types.ts:37-42 in loki 13.2.0, bundled with
237
+ * grafana/grafana:13.2.2. `keepCookies` is in `HttpJsonData`.
238
+ */
239
+ export interface LokiJsonData extends HttpJsonData {
240
+ /** The default line limit, as a string (`"1000"`). */
241
+ maxLines?: string;
242
+ derivedFields?: DerivedFieldConfig[];
243
+ /** @deprecated Read by Loki's alerting settings before `alertmanagerUid`. */
244
+ alertmanager?: string;
245
+ }
246
+ /**
247
+ * Tempo settings: `TempoJsonData`, types.ts:6-29 in tempo 13.1.5 (bundled
248
+ * with grafana/grafana:13.2.2), with the trace-link settings of
249
+ * `@grafana/o11y-ds-frontend` its config editor writes (configuration/ConfigEditor.tsx)
250
+ * and `streamingEnabled.metrics` (configuration/StreamingSection.tsx:66-72).
251
+ */
252
+ export interface TempoJsonData extends HttpJsonData {
253
+ tracesToLogsV2?: TraceToLogsOptionsV2;
254
+ /** @deprecated Rewritten as `tracesToLogsV2` when the settings are saved. */
255
+ tracesToLogs?: TraceToLogsOptions;
256
+ tracesToMetrics?: TraceToMetricsOptions;
257
+ tracesToProfiles?: TraceToProfilesOptions;
258
+ /** The Prometheus the service graph and RED metrics come from. */
259
+ serviceMap?: {
260
+ datasourceUid?: LinkedDatasource<"prometheus">;
261
+ };
262
+ search?: {
263
+ hide?: boolean;
264
+ filters?: TraceqlFilter[];
265
+ };
266
+ nodeGraph?: {
267
+ enabled?: boolean;
268
+ };
269
+ spanBar?: {
270
+ type?: string;
271
+ tag?: string;
272
+ };
273
+ tagLimit?: number;
274
+ traceQuery?: {
275
+ timeShiftEnabled?: boolean;
276
+ spanStartTimeShift?: string;
277
+ spanEndTimeShift?: string;
278
+ };
279
+ streamingEnabled?: {
280
+ search?: boolean;
281
+ metrics?: boolean;
282
+ };
283
+ timeRangeForTags?: number;
284
+ }
285
+ /**
286
+ * elasticsearch 12.8.2, bundled in grafana/grafana:13.2.2:
287
+ * src/types.ts ElasticsearchOptions, DataLinkConfig, Interval, QueryType;
288
+ * src/configuration/ElasticDetails.tsx, LogsConfig.tsx, ApiKeyConfig.tsx, utils.ts;
289
+ * backend pkg/elasticsearch/elasticsearch.go NewDatasource
290
+ * (github.com/grafana/grafana-elasticsearch-datasource@v12.8.2).
291
+ *
292
+ * HTTP client: yes. Backend uses settings.HTTPClientOptions() (with SigV4
293
+ * middleware when sigV4Auth is on, service "es"), so the settings include `HttpJsonData`,
294
+ * its sigV4 keys among them.
295
+ */
296
+ export interface ElasticsearchJsonData extends HttpJsonData {
297
+ /** Index name or pattern, e.g. "[logs-]YYYY.MM.DD". Falls back to the top-level `database` field when empty. */
298
+ index?: string;
299
+ /** Index pattern interval. Omit for "no pattern". */
300
+ interval?: "Hourly" | "Daily" | "Weekly" | "Monthly" | "Yearly";
301
+ /** Required by the backend; config editor defaults it to "@timestamp". */
302
+ timeField?: string;
303
+ /** Min time interval, e.g. "10s". Validated against /^\d+(ms|[Mwdhmsy])$/. */
304
+ timeInterval?: string;
305
+ /** Default 5. The config editor stores this as a string; the backend accepts number or numeric string. */
306
+ maxConcurrentShardRequests?: number | string;
307
+ logMessageField?: string;
308
+ logLevelField?: string;
309
+ includeFrozen?: boolean;
310
+ /** Default "metrics". */
311
+ defaultQueryMode?: "metrics" | "logs" | "raw_data" | "raw_document";
312
+ /** When true, backend sends "Authorization: ApiKey <secureJsonData.apiKey>". */
313
+ apiKeyAuth?: boolean;
314
+ dataLinks?: ElasticsearchDataLink[];
315
+ }
316
+ export interface ElasticsearchDataLink {
317
+ /** Exact field name or regex. */
318
+ field?: string;
319
+ /** URL, or the query when datasourceUid is set. */
320
+ url?: string;
321
+ urlDisplayLabel?: string;
322
+ datasourceUid?: LinkedDatasource<TracingDatasourceType>;
323
+ }
324
+ export type ElasticsearchSecureJsonKey = "apiKey";
325
+ /**
326
+ * @grafana/aws-sdk 0.12.0 src/types.ts AwsAuthDataSourceJsonData, AwsAuthType,
327
+ * src/components/ConnectionConfig.tsx (github.com/grafana/grafana-aws-sdk-react@v0.12.0);
328
+ * github.com/grafana/grafana-aws-sdk@v1.5.1 pkg/awsds/settings.go AWSDatasourceSettings.
329
+ */
330
+ export interface AwsAuthJsonData extends CommonJsonData {
331
+ /**
332
+ * "arn" is the old name of "default"; "sharedCreds" is accepted by the Go
333
+ * side only as an alias of "credentials". Unknown values fall back to "default".
334
+ */
335
+ authType?: "keys" | "credentials" | "default" | "ec2_iam_role" | "grafana_assume_role" | "arn" | "sharedCreds";
336
+ /** Go struct tag is "assumeRoleARN"; Go matching is case-insensitive, UI writes "assumeRoleArn". */
337
+ assumeRoleArn?: string;
338
+ externalId?: string;
339
+ /** Grafana Assume Role only: use grafanaExternalId instead of the stack-level external ID. */
340
+ usePerDatasourceExternalId?: boolean;
341
+ /** Grafana Assume Role only: per-datasource external ID, "{stackExternalId}-{dsUid}". */
342
+ grafanaExternalId?: string;
343
+ /** Profile name in ~/.aws/credentials (authType "credentials"). */
344
+ profile?: string;
345
+ /** Region; this is what the UI writes. */
346
+ defaultRegion?: string;
347
+ /**
348
+ * Read by the Go SDK before defaultRegion; if empty or "default" it falls
349
+ * back to defaultRegion. Not written by the UI.
350
+ */
351
+ region?: string;
352
+ /** Override for the AWS service endpoint. */
353
+ endpoint?: string;
354
+ /** Default "env" on the Go side. */
355
+ proxyType?: "none" | "env" | "url";
356
+ proxyUrl?: string;
357
+ proxyUsername?: string;
358
+ }
359
+ export type AwsAuthSecureJsonKey = "accessKey" | "secretKey" | "sessionToken" | "proxyPassword";
360
+ /**
361
+ * cloudwatch, core plugin in grafana/grafana v13.2.2:
362
+ * public/app/plugins/datasource/cloudwatch/types.ts CloudWatchJsonData,
363
+ * components/ConfigEditor/ConfigEditor.tsx, dataquery.gen.ts LogGroup;
364
+ * pkg/tsdb/cloudwatch/models/settings.go CloudWatchSettings.
365
+ * AWS auth keys from @grafana/aws-sdk 0.12.0 / grafana-aws-sdk v1.5.1 (see AwsAuthJsonData).
366
+ *
367
+ * HTTP client: no. The backend calls HTTPClientOptions() only to take
368
+ * ProxyOptions for the secure socks proxy dialer, so of `HttpJsonData` only
369
+ * the secure socks proxy keys apply.
370
+ */
371
+ export interface CloudWatchJsonData extends AwsAuthJsonData {
372
+ enableSecureSocksProxy?: boolean;
373
+ secureSocksProxyUsername?: string;
374
+ /** Comma-separated list of custom metric namespaces, e.g. "CWAgent". */
375
+ customMetricsNamespaces?: string;
376
+ /**
377
+ * Logs query timeout. Duration string such as "30m" (Go time.ParseDuration),
378
+ * or a number of nanoseconds. Backend default 30m.
379
+ */
380
+ logsTimeout?: string | number;
381
+ /** X-Ray datasource used to build trace links from logs containing traceId. */
382
+ tracingDatasourceUid?: LinkedDatasource<"grafana-x-ray-datasource">;
383
+ /** Default log groups for new logs queries. */
384
+ logGroups?: CloudWatchLogGroup[];
385
+ /** @deprecated Use logGroups. The config editor migrates these names to logGroups; still read as a fallback. */
386
+ defaultLogGroups?: string[];
387
+ /**
388
+ * @deprecated Legacy home of the credentials profile name. Use profile.
389
+ * The config editor still checks jsonData.database when authType is "credentials".
390
+ */
391
+ database?: string;
392
+ /** @deprecated Declared in types.ts but not read anywhere at v13.2.2. */
393
+ timeField?: string;
394
+ }
395
+ /** public/app/plugins/datasource/cloudwatch/dataquery.gen.ts LogGroup (arn and name required there). */
396
+ export interface CloudWatchLogGroup {
397
+ arn: string;
398
+ name: string;
399
+ /** Monitoring account ID, for cross-account observability. */
400
+ accountId?: string;
401
+ accountLabel?: string;
402
+ }
403
+ export type CloudWatchSecureJsonKey = AwsAuthSecureJsonKey | "secureSocksProxyPassword";
404
+ /**
405
+ * @grafana/azure-sdk 0.1.0 src/credentials/AzureCredentials.ts,
406
+ * src/credentials/AzureCredentialsConfig.ts, src/settings.ts, src/clouds.ts
407
+ * (github.com/grafana/grafana-azure-sdk-react@v0.1.0);
408
+ * github.com/grafana/grafana-azure-sdk-go/v2@v2.5.0 azcredentials/builder.go, azsettings/clouds.go.
409
+ *
410
+ * Stored in jsonData.azureCredentials. Secrets are never stored here; they go
411
+ * to secureJsonData (azureClientSecret, password, clientCertificate,
412
+ * privateKey, certificatePassword).
413
+ */
414
+ export type AzureCloudName = "AzureCloud" | "AzureChinaCloud" | "AzureUSGovernment" | "AzureCustomizedCloud" | (string & {});
415
+ export type AzureCredentials = {
416
+ authType: "msi";
417
+ } | {
418
+ authType: "workloadidentity";
419
+ } | {
420
+ authType: "clientsecret" | "clientsecret-obo";
421
+ /** Required by the Go SDK. UI defaults it to Grafana's configured cloud. */
422
+ azureCloud?: AzureCloudName;
423
+ tenantId?: string;
424
+ clientId?: string;
425
+ } | {
426
+ authType: "clientcertificate";
427
+ azureCloud?: AzureCloudName;
428
+ tenantId?: string;
429
+ clientId?: string;
430
+ /** Go SDK defaults to "pem" when empty. */
431
+ certificateFormat?: "pem" | "pfx";
432
+ } | {
433
+ /** Entra ID username/password; secret in secureJsonData.password. */
434
+ authType: "ad-password";
435
+ userId?: string;
436
+ clientId?: string;
437
+ } | {
438
+ authType: "currentuser";
439
+ serviceCredentialsEnabled?: boolean;
440
+ /** Fallback credentials used where there is no signed-in user (e.g. alerting). */
441
+ serviceCredentials?: {
442
+ authType: "msi";
443
+ } | {
444
+ authType: "workloadidentity";
445
+ } | {
446
+ authType: "clientsecret";
447
+ azureCloud?: AzureCloudName;
448
+ tenantId?: string;
449
+ clientId?: string;
450
+ } | {
451
+ authType: "clientcertificate";
452
+ azureCloud?: AzureCloudName;
453
+ tenantId?: string;
454
+ clientId?: string;
455
+ certificateFormat?: "pem" | "pfx";
456
+ };
457
+ };
458
+ /**
459
+ * grafana-azure-monitor-datasource, core plugin in grafana/grafana v13.2.2:
460
+ * public/app/plugins/datasource/azuremonitor/types/types.ts AzureMonitorDataSourceJsonData,
461
+ * credentials.ts getLegacyCredentials, components/ConfigEditor/MonitorConfig.tsx,
462
+ * AzureCredentialsForm.tsx; pkg/tsdb/azuremonitor/types/types.go AzureMonitorSettings,
463
+ * AzureMonitorCustomizedCloudSettings, azmoncredentials/builder.go, routes.go,
464
+ * loganalytics/azure-log-analytics-datasource.go.
465
+ * Base AzureDataSourceJsonData from @grafana/azure-sdk 0.1.0 src/settings.ts.
466
+ *
467
+ * HTTP client: yes. Each route's client is built from settings.HTTPClientOptions()
468
+ * with Azure auth middleware added (pkg/tsdb/azuremonitor/httpclient.go), so
469
+ * the settings include `HttpJsonData`. The config editor exposes timeout, keepCookies and
470
+ * enableSecureSocksProxy. The "clientsecret-obo" and "currentuser" flows set
471
+ * oauthPassThru (and currentuser also disableGrafanaCache) from the base.
472
+ */
473
+ export interface AzureMonitorJsonData extends HttpJsonData {
474
+ /**
475
+ * Current credentials format. The UI offers msi, workloadidentity,
476
+ * clientsecret, clientcertificate and currentuser (currentuser needs the
477
+ * azureMonitorEnableUserAuth feature toggle).
478
+ */
479
+ azureCredentials?: AzureCredentials;
480
+ /** Default subscription for queries and the resource picker. */
481
+ subscriptionId?: string;
482
+ basicLogsEnabled?: boolean;
483
+ /** Use the Azure Monitor metrics batch API. */
484
+ batchAPIEnabled?: boolean;
485
+ /** Default Log Analytics workspace; still read by the frontend and backend settings. */
486
+ logAnalyticsDefaultWorkspace?: string;
487
+ /**
488
+ * Routes used when the resolved cloud is "AzureCustomizedCloud". Keys are
489
+ * route names: "Azure Monitor", "Azure Log Analytics", "Azure Resource Graph",
490
+ * "Azure Traces", "Azure Portal", "traceql", "Azure Monitor Batch Metrics".
491
+ * The Go struct has no json tags, so keys match case-insensitively.
492
+ */
493
+ customizedRoutes?: Record<string, {
494
+ URL?: string;
495
+ Scopes?: string[];
496
+ Headers?: Record<string, string>;
497
+ }>;
498
+ /** @deprecated Use azureCredentials.authType. Legacy backend path supports msi, workloadidentity, clientsecret, currentuser. */
499
+ azureAuthType?: "msi" | "workloadidentity" | "clientsecret" | "currentuser";
500
+ /** @deprecated Use azureCredentials.azureCloud. Legacy cloud names mapped by resolveLegacyCloudName. */
501
+ cloudName?: "azuremonitor" | "chinaazuremonitor" | "govazuremonitor" | "customizedazuremonitor";
502
+ /** @deprecated Use azureCredentials.tenantId. */
503
+ tenantId?: string;
504
+ /** @deprecated Use azureCredentials.clientId. */
505
+ clientId?: string;
506
+ /**
507
+ * @deprecated Separate Log Analytics credentials are no longer supported.
508
+ * Backend accepts boolean or "true"/"false" string; false makes Log Analytics queries fail.
509
+ */
510
+ azureLogAnalyticsSameAs?: boolean | "true" | "false";
511
+ /** @deprecated Separate Log Analytics credentials; declared in types.ts, not read at v13.2.2. */
512
+ logAnalyticsTenantId?: string;
513
+ /** @deprecated Separate Log Analytics credentials; declared in types.ts, not read at v13.2.2. */
514
+ logAnalyticsClientId?: string;
515
+ /** @deprecated Separate Log Analytics credentials; declared in types.ts, not read at v13.2.2. */
516
+ logAnalyticsSubscriptionId?: string;
517
+ /** @deprecated Application Insights app; in Go AzureMonitorSettings but not used for queries at v13.2.2. */
518
+ appInsightsAppId?: string;
519
+ }
520
+ export type AzureMonitorSecureJsonKey =
521
+ /** Client secret for clientsecret / clientsecret-obo / currentuser fallback. */
522
+ "azureClientSecret"
523
+ /** Legacy client secret name; read when azureClientSecret is absent. */
524
+ | "clientSecret" | "clientCertificate" | "privateKey" | "certificatePassword"
525
+ /** Entra password for "ad-password"; in the SDK but not offered by the Azure Monitor UI. */
526
+ | "password"
527
+ /** Deprecated Application Insights API key; declared in types.ts, not read at v13.2.2. */
528
+ | "appInsightsApiKey";
529
+ /**
530
+ * @grafana/google-sdk 0.6.0 dist/esm/index.d.ts DataSourceOptions,
531
+ * dist/esm/types.js GoogleAuthType, components/AuthConfig.js, JWTForm.js,
532
+ * WIFConfigEditor.js (npm tarball; the GitHub repo grafana/grafana-google-sdk-react
533
+ * has no v0.6.0 tag); github.com/grafana/grafana-google-sdk-go@v0.4.2
534
+ * pkg/utils/utils.go GetPrivateKey.
535
+ */
536
+ export interface GoogleAuthJsonData {
537
+ /**
538
+ * Default "jwt". "workloadIdentityFederation" and "forwardOAuthIdentity"
539
+ * are only offered in Grafana Cloud for Cloud Monitoring; BigQuery offers
540
+ * forwardOAuthIdentity everywhere.
541
+ */
542
+ authenticationType?: "jwt" | "gce" | "workloadIdentityFederation" | "forwardOAuthIdentity";
543
+ /** JWT: token_uri from the service account key. */
544
+ tokenUri?: string;
545
+ /** JWT: client_email from the service account key. */
546
+ clientEmail?: string;
547
+ /** Project used when a query does not name one. */
548
+ defaultProject?: string;
549
+ /** JWT: path to a private key file on the Grafana host; used instead of secureJsonData.privateKey when set. */
550
+ privateKeyPath?: string;
551
+ /** jwt/gce only. */
552
+ usingImpersonation?: boolean;
553
+ serviceAccountToImpersonate?: string;
554
+ /** workloadIdentityFederation: required by the backend for that auth type. */
555
+ workloadIdentityPoolProvider?: string;
556
+ wifServiceAccountEmail?: string;
557
+ }
558
+ export type GoogleAuthSecureJsonKey = "privateKey";
559
+ /**
560
+ * stackdriver 12.6.1, bundled in grafana/grafana:13.2.2:
561
+ * src/types/types.ts CloudMonitoringOptions, src/components/ConfigEditor/ConfigEditor.tsx,
562
+ * src/datasource.ts; backend pkg/cloudmonitoring/cloudmonitoring.go datasourceJSONData,
563
+ * httpclient.go (github.com/grafana/grafana-cloudmonitoring-datasource@v12.6.1).
564
+ * Google auth keys from @grafana/google-sdk 0.6.0 (see GoogleAuthJsonData).
565
+ *
566
+ * HTTP client: yes. Clients are built from settings.HTTPClientOptions() plus the
567
+ * Google token middleware, so the settings include `HttpJsonData`. forwardOAuthIdentity and
568
+ * workloadIdentityFederation rely on oauthPassThru from the base.
569
+ */
570
+ export interface CloudMonitoringJsonData extends HttpJsonData, GoogleAuthJsonData {
571
+ /**
572
+ * gce auth: default project. The frontend uses it if set and otherwise asks
573
+ * the backend (resource "gceDefaultProject") and caches it in memory only.
574
+ */
575
+ gceDefaultProject?: string;
576
+ /** Default "googleapis.com". Service URLs become https://monitoring.<universeDomain> etc. */
577
+ universeDomain?: string;
578
+ }
579
+ export type CloudMonitoringSecureJsonKey = GoogleAuthSecureJsonKey;
580
+ /**
581
+ * grafana-bigquery-datasource 3.4.2 (not bundled in grafana/grafana:13.2.2):
582
+ * github.com/grafana/google-bigquery-datasource@v3.4.2 src/types.ts BigQueryOptions,
583
+ * QueryPriority, src/components/ConfigEditor.tsx, src/constants.ts PROCESSING_LOCATIONS;
584
+ * pkg/bigquery/types/types.go BigQuerySettings, pkg/bigquery/settings.go.
585
+ * Google auth keys from @grafana/google-sdk 0.6.1 (same .d.ts as 0.6.0).
586
+ *
587
+ * HTTP client: yes. pkg/bigquery/datasource.go builds clients from
588
+ * config.HTTPClientOptions() (http_client.go adds the token middleware or,
589
+ * with oauthPassThru, forwards headers), so the settings include `HttpJsonData`.
590
+ */
591
+ export interface BigQueryJsonData extends HttpJsonData, GoogleAuthJsonData {
592
+ /** Location code such as "US", "EU", "us-east5"; "" means automatic. */
593
+ processingLocation?: string;
594
+ /** Custom BigQuery API endpoint. */
595
+ serviceEndpoint?: string;
596
+ /**
597
+ * Query byte limit. Must be a JSON number: the Go field is int64 and a
598
+ * string fails settings unmarshal. Note the capitalised key.
599
+ */
600
+ MaxBytesBilled?: number;
601
+ /** Limit dataset listings to datasets the credentials can access. */
602
+ restrictToAccessibleDatasets?: boolean;
603
+ /** Comma-separated extra datasets allowed when restrictToAccessibleDatasets is on. */
604
+ additionalAllowedDatasets?: string;
605
+ /** Declared in types.ts and the Go struct; no reader found at v3.4.2. */
606
+ flatRateProject?: string;
607
+ /** Declared in types.ts and the Go struct; the datasource-level value is not read at v3.4.2 (queries carry their own). */
608
+ queryPriority?: "INTERACTIVE" | "BATCH";
609
+ }
610
+ export type BigQuerySecureJsonKey = GoogleAuthSecureJsonKey;
611
+ /**
612
+ * grafana-pyroscope-datasource 13.0.4, bundled in grafana/grafana:13.2.2:
613
+ * src/types.ts PyroscopeDataSourceOptions, src/ConfigEditor.tsx;
614
+ * backend pkg/grafana-pyroscope-datasource/query.go, instance.go
615
+ * (github.com/grafana/grafana-pyroscope-datasource@v13.0.4).
616
+ *
617
+ * HTTP client: yes. settings.HTTPClientOptions() with ForwardHTTPHeaders, so
618
+ * the settings include `HttpJsonData`. Config editor uses plugin-ui ConnectionSettings, Auth,
619
+ * AdvancedHttpSettings and SecureSocksProxySettings.
620
+ */
621
+ export interface PyroscopeJsonData extends HttpJsonData {
622
+ /** Minimum step, e.g. "15s". Validated against /^\d+(ms|[Mwdhmsy])$/. */
623
+ minStep?: string;
624
+ }
625
+ /** Pyroscope names no secure keys of its own; basic auth / TLS / header secrets come from the base. */
626
+ export type PyroscopeSecureJsonKey = never;
627
+ /**
628
+ * grafana/grafana v13.2.2 packages/grafana-sql/src/types.ts SQLOptions,
629
+ * SQLConnectionLimits; components/configuration/useMigrateDatabaseFields.ts,
630
+ * ConnectionLimits.tsx. The three plugins depend on @grafana/sql 13.1.1.
631
+ *
632
+ * Differences from SQLOptions:
633
+ * - user and url are left out: they are top-level datasource fields
634
+ * (settings.User / settings.URL), not jsonData, in all three backends.
635
+ * - tlsAuth, tlsAuthWithCACert, tlsSkipVerify and timezone are moved to the
636
+ * plugins that read them (MySQL; MSSQL reads tlsSkipVerify).
637
+ *
638
+ * HTTP client: none of the SQL backends builds an HTTP client, so their settings do
639
+ * not include `HttpJsonData`. All three honour enableSecureSocksProxy /
640
+ * secureSocksProxyUsername through settings.ProxyClient().
641
+ */
642
+ export interface SqlJsonData extends CommonJsonData {
643
+ enableSecureSocksProxy?: boolean;
644
+ secureSocksProxyUsername?: string;
645
+ /**
646
+ * Database name. The config editor migrates the deprecated top-level
647
+ * `database` field into jsonData.database; backends fall back to the
648
+ * top-level field when this is empty.
649
+ */
650
+ database?: string;
651
+ /** Default from Grafana [sql_datasources] max_open_conns_default. */
652
+ maxOpenConns?: number;
653
+ /** Default from Grafana [sql_datasources] max_idle_conns_default. Not applied by the Postgres (pgx) backend. */
654
+ maxIdleConns?: number;
655
+ /** UI-only: keep maxIdleConns equal to maxOpenConns. Backends ignore it. */
656
+ maxIdleConnsAuto?: boolean;
657
+ /** Seconds. Default from Grafana [sql_datasources] max_conn_lifetime_default. */
658
+ connMaxLifetime?: number;
659
+ /** Min time interval, e.g. "1m". */
660
+ timeInterval?: string;
661
+ }
662
+ /**
663
+ * grafana-postgresql-datasource 13.0.3, bundled in grafana/grafana:13.2.2:
664
+ * src/types.ts PostgresOptions, PostgresTLSModes, PostgresTLSMethods,
665
+ * src/configuration/ConfigurationEditor.tsx (postgresVersions), useAutoDetectFeatures.ts;
666
+ * backend pkg/postgresql/postgres.go, tlsmanager.go, sqleng/sql_engine.go JsonData
667
+ * (github.com/grafana/grafana-postgresql-datasource@v13.0.3).
668
+ *
669
+ * Also provisioned under type "postgres" (Grafana's devenv/datasources.yaml uses it).
670
+ * HTTP client: no (see SqlJsonData).
671
+ */
672
+ export interface PostgresJsonData extends SqlJsonData {
673
+ /**
674
+ * libpq sslmode. UI default "require". The backend passes the value to the
675
+ * connection string unchanged, so other libpq modes ("allow", "prefer")
676
+ * would also connect, but the UI only offers these four.
677
+ */
678
+ sslmode?: "disable" | "require" | "verify-ca" | "verify-full";
679
+ /** Default "file-path". "file-content" writes secureJsonData tlsCACert/tlsClientCert/tlsClientKey to temp files. */
680
+ tlsConfigurationMethod?: "file-path" | "file-content";
681
+ /** file-path method: CA certificate path on the Grafana host. */
682
+ sslRootCertFile?: string;
683
+ /** file-path method: client certificate path. */
684
+ sslCertFile?: string;
685
+ /** file-path method: client key path. */
686
+ sslKeyFile?: string;
687
+ /**
688
+ * Server version as major*100+minor: 900..906, 1000, 1100, 1200, 1300, 1400,
689
+ * 1500 ("15+"). UI default 903; auto-detected on save and may hold an
690
+ * unlisted value. Frontend only (macro/SQL generation hints).
691
+ */
692
+ postgresVersion?: number;
693
+ /** Enable TimescaleDB-specific macros. */
694
+ timescaledb?: boolean;
695
+ }
696
+ /** password, plus TLS material for tlsConfigurationMethod "file-content" (pkg/postgresql/tlsmanager.go). */
697
+ export type PostgresSecureJsonKey = "password" | "tlsCACert" | "tlsClientCert" | "tlsClientKey" | "secureSocksProxyPassword";
698
+ /**
699
+ * mysql 13.1.2, bundled in grafana/grafana:13.2.2:
700
+ * src/types.ts MySQLOptions, src/configuration/ConfigurationEditor.tsx;
701
+ * backend pkg/mysql/mysql.go, sqleng/sql_engine.go JsonData
702
+ * (github.com/grafana/grafana-mysql-datasource@v13.1.2).
703
+ *
704
+ * HTTP client: no HTTP client, but the backend calls settings.HTTPClientOptions()
705
+ * and sdkhttpclient.GetTLSConfig() to build the MySQL TLS config. So the TLS part
706
+ * of the common settings applies (tlsAuth, tlsAuthWithCACert, tlsSkipVerify,
707
+ * serverName, secure tlsCACert/tlsClientCert/tlsClientKey); timeout, headers,
708
+ * cookies do not. The TLS flags are repeated here with the same names and types
709
+ * as the base so the two can be combined.
710
+ */
711
+ export interface MySQLJsonData extends SqlJsonData {
712
+ /** Adds allowCleartextPasswords=true to the DSN. */
713
+ allowCleartextPasswords?: boolean;
714
+ /** Session time zone, e.g. "Europe/Berlin" or "+02:00"; sent as time_zone in the DSN. */
715
+ timezone?: string;
716
+ /** Use a TLS client certificate (secureJsonData tlsClientCert/tlsClientKey). */
717
+ tlsAuth?: boolean;
718
+ /** Verify the server with secureJsonData.tlsCACert. */
719
+ tlsAuthWithCACert?: boolean;
720
+ /** Adds tls=skip-verify when no CA/client cert is configured. */
721
+ tlsSkipVerify?: boolean;
722
+ /** TLS server name override, read through HTTPClientOptions(). Not shown in the MySQL config editor. */
723
+ serverName?: string;
724
+ }
725
+ export type MySQLSecureJsonKey = "password" | "tlsCACert" | "tlsClientCert" | "tlsClientKey" | "secureSocksProxyPassword";
726
+ /**
727
+ * mssql 13.0.5, bundled in grafana/grafana:13.2.2:
728
+ * src/types.ts MssqlOptions, MSSQLAuthenticationType, MSSQLEncryptOptions,
729
+ * src/configuration/ConfigurationEditor.tsx, Kerberos.tsx,
730
+ * src/azureauth/AzureAuthSettings.tsx, AzureCredentialsForm.tsx, AzureCredentialsConfig.ts;
731
+ * backend pkg/mssql/sqleng/connection.go generateConnectionString, sqleng/sql_engine.go JsonData,
732
+ * kerberos/kerberos.go KerberosAuth, azure/connection.go, utils/utils.go
733
+ * (github.com/grafana/grafana-mssql-datasource@v13.0.5).
734
+ * Azure credential shape from @grafana/azure-sdk 0.1.0 / grafana-azure-sdk-go v2.5.0.
735
+ *
736
+ * HTTP client: no (see SqlJsonData). TLS is configured by the MSSQL driver from
737
+ * encrypt / tlsSkipVerify / serverName / sslRootCertFile below, not by the
738
+ * common TLS settings.
739
+ */
740
+ export interface MSSQLJsonData extends SqlJsonData {
741
+ /** Default "SQL Server Authentication". */
742
+ authenticationType?: "SQL Server Authentication" | "Windows Authentication" | "Azure AD Authentication" | "Windows AD: Username + password" | "Windows AD: Keytab" | "Windows AD: Credential cache" | "Windows AD: Credential cache file";
743
+ /** String, not boolean. Backend default "false". */
744
+ encrypt?: "disable" | "false" | "true";
745
+ /** encrypt "true" only: sets TrustServerCertificate. */
746
+ tlsSkipVerify?: boolean;
747
+ /** encrypt "true" only: hostNameInCertificate. Go tag is "servername" (case-insensitive match). */
748
+ serverName?: string;
749
+ /** encrypt "true" only: path to the CA certificate on the Grafana host. */
750
+ sslRootCertFile?: string;
751
+ /** Seconds; 0 means driver default. */
752
+ connectionTimeout?: number;
753
+ /**
754
+ * "Azure AD Authentication" only. The MSSQL UI offers clientsecret, msi,
755
+ * ad-password and currentuser; the backend (azure/connection.go) handles
756
+ * the same four.
757
+ */
758
+ azureCredentials?: AzureCredentials;
759
+ /** "Windows AD: Keytab": keytab file path. */
760
+ keytabFilePath?: string;
761
+ /** "Windows AD: Credential cache": credential cache file path. */
762
+ credentialCache?: string;
763
+ /** "Windows AD: Credential cache file": JSON lookup file mapping address/database/user to a cache file. */
764
+ credentialCacheLookupFile?: string;
765
+ /** krb5 config file path. Default /etc/krb5.conf. */
766
+ configFilePath?: string;
767
+ /** krb5 udp_preference_limit. Default 1. Backend also accepts a numeric string. */
768
+ UDPConnectionLimit?: number | string;
769
+ /** krb5 dns_lookup_kdc, passed through as text; UI placeholder "true". */
770
+ enableDNSLookupKDC?: string;
771
+ }
772
+ export type MSSQLSecureJsonKey =
773
+ /** SQL/Kerberos password, and also the Entra password for azureCredentials.authType "ad-password". */
774
+ "password"
775
+ /** azureCredentials clientsecret / currentuser fallback. */
776
+ | "azureClientSecret"
777
+ /** Legacy client secret name; the Go SDK reads it when azureClientSecret is absent. */
778
+ | "clientSecret" | "secureSocksProxyPassword";
779
+ /** Each typed plugin's `jsonData`, by plugin id. `postgres` is the PostgreSQL plugin's old id, which Grafana still accepts. */
780
+ export interface DatasourceJsonDataTypes {
781
+ prometheus: PrometheusJsonData;
782
+ loki: LokiJsonData;
783
+ tempo: TempoJsonData;
784
+ elasticsearch: ElasticsearchJsonData;
785
+ cloudwatch: CloudWatchJsonData;
786
+ "grafana-azure-monitor-datasource": AzureMonitorJsonData;
787
+ stackdriver: CloudMonitoringJsonData;
788
+ "grafana-bigquery-datasource": BigQueryJsonData;
789
+ "grafana-pyroscope-datasource": PyroscopeJsonData;
790
+ "grafana-postgresql-datasource": PostgresJsonData;
791
+ postgres: PostgresJsonData;
792
+ mysql: MySQLJsonData;
793
+ mssql: MSSQLJsonData;
794
+ }
795
+ /** Each typed plugin's `secureJsonData` keys, by plugin id. */
796
+ export interface DatasourceSecureJsonKeys {
797
+ prometheus: HttpSecureJsonKey;
798
+ loki: HttpSecureJsonKey;
799
+ tempo: HttpSecureJsonKey;
800
+ elasticsearch: HttpSecureJsonKey | ElasticsearchSecureJsonKey;
801
+ cloudwatch: CloudWatchSecureJsonKey;
802
+ "grafana-azure-monitor-datasource": HttpSecureJsonKey | AzureMonitorSecureJsonKey;
803
+ stackdriver: HttpSecureJsonKey | CloudMonitoringSecureJsonKey;
804
+ "grafana-bigquery-datasource": HttpSecureJsonKey | BigQuerySecureJsonKey;
805
+ "grafana-pyroscope-datasource": HttpSecureJsonKey | PyroscopeSecureJsonKey;
806
+ "grafana-postgresql-datasource": PostgresSecureJsonKey;
807
+ postgres: PostgresSecureJsonKey;
808
+ mysql: MySQLSecureJsonKey;
809
+ mssql: MSSQLSecureJsonKey;
810
+ }
811
+ /** The plugin ids whose settings are typed. */
812
+ export type TypedDatasourceType = keyof DatasourceJsonDataTypes;
813
+ /** `jsonData` for a datasource of plugin type `T`: typed for the plugins above, any object for the rest. */
814
+ export type DatasourceJsonData<T extends string = string> = T extends TypedDatasourceType ? DatasourceJsonDataTypes[T] : Record<string, unknown>;
815
+ /** `secureJsonData` for a datasource of plugin type `T`: the plugin's keys, each a string; any keys for other plugins. */
816
+ export type DatasourceSecureJsonData<T extends string = string> = T extends TypedDatasourceType ? {
817
+ [K in DatasourceSecureJsonKeys[T]]?: string;
818
+ } : Record<string, string>;
819
+ /**
820
+ * One place in a plugin's `jsonData` that names another datasource by uid,
821
+ * and the plugin types the field's type accepts there. The importer turns
822
+ * such a uid into a reference to the `Datasource` of the same file that has
823
+ * it, when that datasource is of one of these types; `*` stands for every
824
+ * element of an array.
825
+ */
826
+ export interface JsonDataLink {
827
+ /** The plugin types whose settings have this field; every plugin when left out. */
828
+ readonly on?: readonly string[];
829
+ readonly path: readonly string[];
830
+ readonly targets: readonly string[];
831
+ }
832
+ /** Every `LinkedDatasource` field in the types above. */
833
+ export declare const JSONDATA_LINKS: readonly JsonDataLink[];
834
+ //# sourceMappingURL=datasource-settings.d.ts.map