forked from grafana/clickhouse-datasource
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlabels.ts
442 lines (434 loc) · 14 KB
/
labels.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
import { ColumnHint } from "types/queryBuilder";
export default {
components: {
Config: {
ConfigEditor: {
serverAddress: {
label: 'Server address',
placeholder: 'Server address',
tooltip: 'ClickHouse host address',
error: 'Server address required'
},
serverPort: {
label: 'Server port',
insecureNativePort: '9000',
insecureHttpPort: '8123',
secureNativePort: '9440',
secureHttpPort: '8443',
tooltip: 'ClickHouse server port',
error: 'Port is required'
},
path: {
label: 'HTTP URL Path',
tooltip: 'Additional URL path for HTTP requests',
placeholder: 'additional-path'
},
protocol: {
label: 'Protocol',
tooltip: 'Native or HTTP for server protocol',
},
username: {
label: 'Username',
placeholder: 'default',
tooltip: 'ClickHouse username',
},
password: {
label: 'Password',
placeholder: 'password',
tooltip: 'ClickHouse password',
},
tlsSkipVerify: {
label: 'Skip TLS Verify',
tooltip: 'Skip TLS Verify',
},
tlsClientAuth: {
label: 'TLS Client Auth',
tooltip: 'TLS Client Auth',
},
tlsAuthWithCACert: {
label: 'With CA Cert',
tooltip: 'Needed for verifying self-signed TLS Certs',
},
tlsCACert: {
label: 'CA Cert',
placeholder: 'CA Cert. Begins with -----BEGIN CERTIFICATE-----',
},
tlsClientCert: {
label: 'Client Cert',
placeholder: 'Client Cert. Begins with -----BEGIN CERTIFICATE-----',
},
tlsClientKey: {
label: 'Client Key',
placeholder: 'Client Key. Begins with -----BEGIN RSA PRIVATE KEY-----',
},
secure: {
label: 'Secure Connection',
tooltip: 'Toggle on if the connection is secure',
},
secureSocksProxy: {
label: 'Enable Secure Socks Proxy',
tooltip: 'Enable proxying the datasource connection through the secure socks proxy to a different network.',
},
},
HttpHeadersConfig: {
title: 'HTTP Headers',
label: 'Custom HTTP Headers',
description: 'Add Custom HTTP headers when querying the database',
headerNameLabel: 'Header Name',
headerNamePlaceholder: 'X-Custom-Header',
insecureHeaderValueLabel: 'Header Value',
secureHeaderValueLabel: 'Secure Header Value',
secureLabel: 'Secure',
addHeaderLabel: 'Add Header',
forwardGrafanaHeaders: {
label: 'Forward Grafana HTTP Headers',
tooltip: 'Forward Grafana HTTP Headers to datasource.',
},
},
AliasTableConfig: {
title: 'Column Alias Tables',
descriptionParts: ['Provide alias tables with a', '(`alias` String, `select` String, `type` String)', 'schema to use as a source for column selection.'],
addTableLabel: 'Add Table',
targetDatabaseLabel: 'Target Database',
targetDatabasePlaceholder: '(optional)',
targetTableLabel: 'Target Table',
aliasDatabaseLabel: 'Alias Database',
aliasDatabasePlaceholder: '(optional)',
aliasTableLabel: 'Alias Table',
},
DefaultDatabaseTableConfig: {
title: 'Default DB and table',
database: {
label: 'Default database',
description: 'the default database used by the query builder',
name: 'defaultDatabase',
placeholder: 'default'
},
table: {
label: 'Default table',
description: 'the default table used by the query builder',
name: 'defaultTable',
placeholder: 'table'
},
},
QuerySettingsConfig: {
title: 'Query settings',
dialTimeout: {
label: 'Dial Timeout (seconds)',
tooltip: 'Timeout in seconds for connection',
name: 'dialTimeout',
placeholder: '10',
},
queryTimeout: {
label: 'Query Timeout (seconds)',
tooltip: 'Timeout in seconds for read queries',
name: 'queryTimeout',
placeholder: '60',
},
validateSql: {
label: 'Validate SQL',
tooltip: 'Validate SQL in the editor.',
}
},
TracesConfig: {
title: 'Traces configuration',
description: '(Optional) Default settings for trace queries',
defaultDatabase: {
label: 'Default trace database',
description: 'the default database used by the trace query builder',
name: 'defaultDatabase',
placeholder: 'default'
},
defaultTable: {
label: 'Default trace table',
description: 'the default table used by the trace query builder',
name: 'defaultTable'
},
columns: {
title: 'Default columns',
description: 'Default columns for trace queries. Leave empty to disable.',
traceId: {
label: 'Trace ID column',
tooltip: 'Column for the trace ID'
},
spanId: {
label: 'Span ID column',
tooltip: 'Column for the span ID'
},
parentSpanId: {
label: 'Parent Span ID column',
tooltip: 'Column for the parent span ID'
},
serviceName: {
label: 'Service Name column',
tooltip: 'Column for the service name'
},
operationName: {
label: 'Operation Name column',
tooltip: 'Column for the operation name'
},
startTime: {
label: 'Start Time column',
tooltip: 'Column for the start time'
},
durationTime: {
label: 'Duration Time column',
tooltip: 'Column for the duration time'
},
tags: {
label: 'Tags column',
tooltip: 'Column for the trace tags'
},
serviceTags: {
label: 'Service Tags column',
tooltip: 'Column for the service tags'
}
}
},
LogsConfig: {
title: 'Logs configuration',
description: '(Optional) default settings for log queries',
defaultDatabase: {
label: 'Default log database',
description: 'the default database used by the logs query builder',
name: 'defaultDatabase',
placeholder: 'default'
},
defaultTable: {
label: 'Default log table',
description: 'the default table used by the logs query builder',
name: 'defaultTable'
},
columns: {
title: 'Default columns',
description: 'Default columns for log queries. Leave empty to disable.',
time: {
label: 'Time column',
tooltip: 'Column for the log timestamp'
},
level: {
label: 'Log Level column',
tooltip: 'Column for the log level'
},
message: {
label: 'Log Message column',
tooltip: 'Column for log message'
}
},
contextColumns: {
title: 'Context columns',
description: 'These columns are used to narrow down a single log row to its original service/container/pod source. At least one is required for the log context feature to work.',
selectContextColumns: {
label: 'Auto-Select Columns',
tooltip: 'When enabled, will always include context columns in log queries'
},
columns: {
label: 'Context Columns',
tooltip: 'Comma separated list of column names to use for identifying a log\'s source',
placeholder: 'Column name (enter key to add)'
},
}
}
},
EditorTypeSwitcher: {
label: 'Editor Type',
tooltip: 'Switches between the raw SQL Editor and the Query Builder.',
switcher: {
title: 'Are you sure?',
body: 'Queries that are too complex for the Query Builder will be altered.',
confirmText: 'Continue',
dismissText: 'Cancel',
},
cannotConvert: {
title: 'Cannot convert',
message: 'Do you want to delete your current query and use the query builder?',
confirmText: 'Yes',
},
},
expandBuilderButton: {
label: 'Show full query',
tooltip: 'Shows the full query builder'
},
QueryTypeSwitcher: {
label: 'Query Type',
tooltip: 'Sets the layout for the query builder',
sqlTooltip: 'Sets the panel type for explore view'
},
DatabaseSelect: {
label: 'Database',
tooltip: 'ClickHouse database to query from',
empty: '<select database>',
},
TableSelect: {
label: 'Table',
tooltip: 'ClickHouse table to query from',
empty: '<select table>',
},
ColumnsEditor: {
label: 'Columns',
tooltip: 'A list of columns to include in the query'
},
OtelVersionSelect: {
label: 'Use OTel',
tooltip: 'Enables Open Telemetry schema versioning'
},
LimitEditor: {
label: 'Limit',
tooltip: 'Limits the number of rows returned by the query'
},
SqlPreview: {
label: 'SQL Preview',
tooltip: 'Preview of the generated SQL. You can safely switch to SQL Editor to customize the generated query',
},
AggregatesEditor: {
label: 'Aggregates',
tooltip: 'Aggregate functions to use',
aliasLabel: 'as',
aliasTooltip: 'alias for this aggregate function',
addLabel: 'Aggregate',
},
OrderByEditor: {
label: 'Order By',
tooltip: 'Order by column',
addLabel: 'Order By',
},
FilterEditor: {
label: 'Filters',
tooltip: `List of filters`,
addLabel: 'Filter',
mapKeyPlaceholder: 'map key'
},
GroupByEditor: {
label: 'Group By',
tooltip: 'Group the results by specific column',
},
LogsQueryBuilder: {
logTimeColumn: {
label: 'Time',
tooltip: 'Column that contains the log timestamp'
},
logLevelColumn: {
label: 'Log Level',
tooltip: 'Column that contains the log level'
},
logMessageColumn: {
label: 'Message',
tooltip: 'Column that contains the log message'
},
logLabelsColumn: {
label: 'Labels',
tooltip: 'A column with a key/value structure for log labels'
},
liveView: {
label: 'Live View',
tooltip: 'Enable to update logs in real time'
},
logMessageFilter: {
label: 'Message Filter',
tooltip: 'Applies a LIKE filter to the log message body',
clearButton: 'Clear'
},
logLevelFilter: {
label: 'Level Filter',
tooltip: 'Applies a filter to the log level'
},
},
TimeSeriesQueryBuilder: {
simpleQueryModeLabel: 'Simple',
aggregateQueryModeLabel: 'Aggregate',
builderModeLabel: 'Builder Mode',
builderModeTooltip: 'Switches the query builder between the simple and aggregate modes',
timeColumn: {
label: 'Time',
tooltip: 'Column to use for the time series'
},
},
TableQueryBuilder: {
simpleQueryModeLabel: 'Simple',
aggregateQueryModeLabel: 'Aggregate',
builderModeLabel: 'Builder Mode',
builderModeTooltip: 'Switches the query builder between the simple and aggregate modes',
},
TraceQueryBuilder: {
traceIdModeLabel: 'Trace ID',
traceSearchModeLabel: 'Trace Search',
traceModeLabel: 'Trace Mode',
traceModeTooltip: 'Switches between trace ID and trace search mode',
columnsSection: 'Columns',
filtersSection: 'Filters',
columns: {
traceId: {
label: 'Trace ID Column',
tooltip: 'Column that contains the trace ID'
},
spanId: {
label: 'Span ID Column',
tooltip: 'Column that contains the span ID'
},
parentSpanId: {
label: 'Parent Span ID Column',
tooltip: 'Column that contains the parent span ID'
},
serviceName: {
label: 'Service Name Column',
tooltip: 'Column that contains the service name'
},
operationName: {
label: 'Operation Name Column',
tooltip: 'Column that contains the operation name'
},
startTime: {
label: 'Start Time Column',
tooltip: 'Column that contains the start time'
},
durationTime: {
label: 'Duration Time Column',
tooltip: 'Column that contains the duration time'
},
durationUnit: {
label: 'Duration Unit',
tooltip: 'The unit of time used for the duration time'
},
tags: {
label: 'Tags Column',
tooltip: 'Column that contains the trace tags'
},
serviceTags: {
label: 'Service Tags Column',
tooltip: 'Column that contains the service tags'
},
traceIdFilter: {
label: 'Trace ID',
tooltip: 'filter by a specific trace ID'
}
},
}
},
types: {
EditorType: {
sql: 'SQL Editor',
builder: 'Query Builder',
},
QueryType: {
table: 'Table',
logs: 'Logs',
timeseries: 'Time Series',
traces: 'Traces',
},
ColumnHint: {
[ColumnHint.Time]: 'Time',
[ColumnHint.LogLevel]: 'Level',
[ColumnHint.LogMessage]: 'Message',
[ColumnHint.LogLabels]: 'Labels',
[ColumnHint.TraceId]: 'Trace ID',
[ColumnHint.TraceSpanId]: 'Span ID',
[ColumnHint.TraceParentSpanId]: 'Parent Span ID',
[ColumnHint.TraceServiceName]: 'Service Name',
[ColumnHint.TraceOperationName]: 'Operation Name',
[ColumnHint.TraceDurationTime]: 'Duration Time',
[ColumnHint.TraceTags]: 'Tags',
[ColumnHint.TraceServiceTags]: 'Service Tags',
[ColumnHint.TraceStatusCode]: 'Status Code',
}
}
}