-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathtypes.ts
More file actions
73 lines (66 loc) · 1.66 KB
/
types.ts
File metadata and controls
73 lines (66 loc) · 1.66 KB
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
import { DataQuery, DataSourceJsonData } from '@grafana/data';
/**
* The complete query definition needed to request data from the Lightstep API.
*/
export interface LightstepQuery extends DataQuery {
projectName: string;
/** The UQL query text string */
text: string;
/** Custom display query name for chart tooltip and legend */
format: string;
language: 'tql';
}
/**
* The data source configuration options.
*/
export interface LightstepDataSourceOptions extends DataSourceJsonData {
orgName: string;
projectName: string;
apiHost: string;
}
/**
* Sensitive data source options that are stored in the Grafana backend.
* @remarks
* This is used to keep the Lightstep API key secret.
*/
export interface LightstepSecureJsonData {
apiKey?: string;
}
// --------------------------------------------------------
// DATA SHAPES
export type QueryRes = QueryLogsRes | QueryTimeseriesRes;
/**
* Response shape for a timeseries query
* @example metric requests | rate | group_by [customer], sum
*/
export interface QueryTimeseriesRes {
data: {
attributes: {
series: Array<{
'group-labels': string[];
/** Array of timestamp, value tuples */
points: Array<[timestamp: number, value: number]>;
}>;
};
};
}
/**
* Response shape for a logs query.
* @example logs | filter tags.customer == "name"
*/
export interface QueryLogsRes {
data: {
attributes: {
/** Array of timestamp, event tuples */
logs: Array<
[
timestamp: number,
/** nb: log fields do not have a formal schema */
log: {
[key: string]: unknown;
}
]
>;
};
};
}