@d-dash/datasource-grpc 0.1.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 +31 -0
- package/dist/index.d.ts +55 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +155 -0
- package/dist/index.js.map +1 -0
- package/package.json +51 -0
package/README.md
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# @d-dash/datasource-grpc
|
|
2
|
+
|
|
3
|
+
gRPC-backed `DatasourceAdapter` for d-dash.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import { createGrpcDatasourceAdapter } from "@d-dash/datasource-grpc";
|
|
9
|
+
|
|
10
|
+
const adapter = createGrpcDatasourceAdapter({
|
|
11
|
+
id: "grpc",
|
|
12
|
+
client: {
|
|
13
|
+
async query(request, context) {
|
|
14
|
+
// Map request to protobuf call, then map response envelope.
|
|
15
|
+
return { status: "success", frames: [] };
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
registry.registerDatasource(adapter);
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Client contract
|
|
24
|
+
|
|
25
|
+
Your injected `client` handles transport specifics and returns a normalized envelope:
|
|
26
|
+
|
|
27
|
+
- `query(request, context)` is required
|
|
28
|
+
- `getMetrics()` is optional and enables metadata discovery
|
|
29
|
+
|
|
30
|
+
The adapter normalizes frame payloads to d-dash `DataFrame[]` and maps gRPC
|
|
31
|
+
transport and response failures into structured datasource errors.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { DatasourceAdapter, RuntimeContext, VisualizationKind } from "@d-dash/core";
|
|
2
|
+
/** Wire-format query envelope forwarded to gRPC datasource backends. */
|
|
3
|
+
export type GrpcQueryEnvelope = {
|
|
4
|
+
metric: string;
|
|
5
|
+
from: number;
|
|
6
|
+
to: number;
|
|
7
|
+
filters?: Record<string, unknown>;
|
|
8
|
+
context?: {
|
|
9
|
+
traceId?: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
/** Wire-format field returned by gRPC datasource backends. */
|
|
13
|
+
export type GrpcField = {
|
|
14
|
+
name: string;
|
|
15
|
+
type: "time" | "number" | "string" | "boolean";
|
|
16
|
+
values: (string | number | boolean | null)[];
|
|
17
|
+
labels?: Record<string, string>;
|
|
18
|
+
};
|
|
19
|
+
/** Wire-format frame returned by gRPC datasource backends. */
|
|
20
|
+
export type GrpcFrame = {
|
|
21
|
+
fields: GrpcField[];
|
|
22
|
+
};
|
|
23
|
+
/** Wire-format top-level response envelope returned by gRPC datasource backends. */
|
|
24
|
+
export type GrpcResponseEnvelope = {
|
|
25
|
+
status: "success" | "partial" | "error";
|
|
26
|
+
frames: GrpcFrame[];
|
|
27
|
+
warnings?: string[];
|
|
28
|
+
error?: {
|
|
29
|
+
code?: string;
|
|
30
|
+
message?: string;
|
|
31
|
+
retriable?: boolean;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
/** Wire-format metric definition shape returned by optional discovery APIs. */
|
|
35
|
+
export type GrpcMetricWire = string | {
|
|
36
|
+
id?: string;
|
|
37
|
+
name?: string;
|
|
38
|
+
unit?: string;
|
|
39
|
+
supportedVisualizations?: VisualizationKind[];
|
|
40
|
+
};
|
|
41
|
+
/** Transport client contract injected into the gRPC datasource adapter. */
|
|
42
|
+
export type GrpcDatasourceClient = {
|
|
43
|
+
/** Execute a datasource query over gRPC and return normalized wire envelope. */
|
|
44
|
+
query(request: GrpcQueryEnvelope, context: RuntimeContext): Promise<GrpcResponseEnvelope>;
|
|
45
|
+
/** Optionally discover supported metrics from backend metadata services. */
|
|
46
|
+
getMetrics?(): Promise<GrpcMetricWire[]>;
|
|
47
|
+
};
|
|
48
|
+
/** Configuration options for creating the gRPC datasource adapter. */
|
|
49
|
+
export type GrpcDatasourceAdapterOptions = {
|
|
50
|
+
id: string;
|
|
51
|
+
client: GrpcDatasourceClient;
|
|
52
|
+
};
|
|
53
|
+
/** Creates a d-dash datasource adapter backed by an injected gRPC client. */
|
|
54
|
+
export declare function createGrpcDatasourceAdapter(options: GrpcDatasourceAdapterOptions): DatasourceAdapter;
|
|
55
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAGV,iBAAiB,EAMjB,cAAc,EACd,iBAAiB,EAClB,MAAM,cAAc,CAAC;AAEtB,wEAAwE;AACxE,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,OAAO,CAAC,EAAE;QACR,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;CACH,CAAC;AAEF,8DAA8D;AAC9D,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC;IAC/C,MAAM,EAAE,CAAC,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC,EAAE,CAAC;IAC7C,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACjC,CAAC;AAEF,8DAA8D;AAC9D,MAAM,MAAM,SAAS,GAAG;IACtB,MAAM,EAAE,SAAS,EAAE,CAAC;CACrB,CAAC;AAEF,oFAAoF;AACpF,MAAM,MAAM,oBAAoB,GAAG;IACjC,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;IACxC,MAAM,EAAE,SAAS,EAAE,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,KAAK,CAAC,EAAE;QACN,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,SAAS,CAAC,EAAE,OAAO,CAAC;KACrB,CAAC;CACH,CAAC;AAEF,+EAA+E;AAC/E,MAAM,MAAM,cAAc,GACtB,MAAM,GACN;IACE,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,uBAAuB,CAAC,EAAE,iBAAiB,EAAE,CAAC;CAC/C,CAAC;AAEN,2EAA2E;AAC3E,MAAM,MAAM,oBAAoB,GAAG;IACjC,gFAAgF;IAChF,KAAK,CACH,OAAO,EAAE,iBAAiB,EAC1B,OAAO,EAAE,cAAc,GACtB,OAAO,CAAC,oBAAoB,CAAC,CAAC;IACjC,4EAA4E;IAC5E,UAAU,CAAC,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC;CAC1C,CAAC;AAEF,sEAAsE;AACtE,MAAM,MAAM,4BAA4B,GAAG;IACzC,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,oBAAoB,CAAC;CAC9B,CAAC;AAqFF,6EAA6E;AAC7E,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,4BAA4B,GACpC,iBAAiB,CAuGnB"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
const DEFAULT_VISUALIZATIONS = [
|
|
2
|
+
"timeseries",
|
|
3
|
+
"stat",
|
|
4
|
+
"table",
|
|
5
|
+
"text",
|
|
6
|
+
"html",
|
|
7
|
+
];
|
|
8
|
+
function normalizeFrames(rawFrames) {
|
|
9
|
+
return rawFrames.map((frame) => ({
|
|
10
|
+
fields: frame.fields.map((field) => ({
|
|
11
|
+
name: field.name,
|
|
12
|
+
type: field.type,
|
|
13
|
+
values: field.values,
|
|
14
|
+
...(field.labels ? { labels: field.labels } : {}),
|
|
15
|
+
})),
|
|
16
|
+
}));
|
|
17
|
+
}
|
|
18
|
+
function toMetricDefinition(metric, datasourceId) {
|
|
19
|
+
if (typeof metric === "string") {
|
|
20
|
+
return {
|
|
21
|
+
id: metric,
|
|
22
|
+
name: metric,
|
|
23
|
+
unit: "",
|
|
24
|
+
datasource: datasourceId,
|
|
25
|
+
supportedVisualizations: DEFAULT_VISUALIZATIONS,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
const id = metric.id ?? metric.name ?? "";
|
|
29
|
+
return {
|
|
30
|
+
id,
|
|
31
|
+
name: metric.name ?? id,
|
|
32
|
+
unit: metric.unit ?? "",
|
|
33
|
+
datasource: datasourceId,
|
|
34
|
+
supportedVisualizations: metric.supportedVisualizations ?? DEFAULT_VISUALIZATIONS,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
function isRetriableGrpcCode(code) {
|
|
38
|
+
if (!code) {
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
return (code === "UNAVAILABLE" ||
|
|
42
|
+
code === "DEADLINE_EXCEEDED" ||
|
|
43
|
+
code === "RESOURCE_EXHAUSTED" ||
|
|
44
|
+
code === "ABORTED" ||
|
|
45
|
+
code === "INTERNAL");
|
|
46
|
+
}
|
|
47
|
+
function mapTransportError(error, datasourceId) {
|
|
48
|
+
const maybe = error;
|
|
49
|
+
const code = typeof maybe.code === "string" ? maybe.code : undefined;
|
|
50
|
+
const message = typeof maybe.message === "string" ? maybe.message : undefined;
|
|
51
|
+
return {
|
|
52
|
+
status: "error",
|
|
53
|
+
frames: [],
|
|
54
|
+
error: {
|
|
55
|
+
code: "DATASOURCE_QUERY_FAILED",
|
|
56
|
+
message: message ??
|
|
57
|
+
`gRPC transport error querying datasource '${datasourceId}'.`,
|
|
58
|
+
retriable: isRetriableGrpcCode(code),
|
|
59
|
+
details: code ? { grpcCode: code } : undefined,
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
const BASE_CAPABILITIES = {
|
|
64
|
+
supportsAdHocFilters: true,
|
|
65
|
+
};
|
|
66
|
+
/** Creates a d-dash datasource adapter backed by an injected gRPC client. */
|
|
67
|
+
export function createGrpcDatasourceAdapter(options) {
|
|
68
|
+
const capabilities = {
|
|
69
|
+
...BASE_CAPABILITIES,
|
|
70
|
+
...(options.client.getMetrics ? { supportsMetadataDiscovery: true } : {}),
|
|
71
|
+
};
|
|
72
|
+
return {
|
|
73
|
+
id: options.id,
|
|
74
|
+
capabilities,
|
|
75
|
+
async getMetrics() {
|
|
76
|
+
if (!options.client.getMetrics) {
|
|
77
|
+
return [];
|
|
78
|
+
}
|
|
79
|
+
try {
|
|
80
|
+
const raw = await options.client.getMetrics();
|
|
81
|
+
const metrics = [];
|
|
82
|
+
for (const item of raw) {
|
|
83
|
+
const metric = toMetricDefinition(item, options.id);
|
|
84
|
+
if (metric.id.trim().length === 0) {
|
|
85
|
+
continue;
|
|
86
|
+
}
|
|
87
|
+
metrics.push(metric);
|
|
88
|
+
}
|
|
89
|
+
return metrics;
|
|
90
|
+
}
|
|
91
|
+
catch {
|
|
92
|
+
return [];
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
async query(request, context) {
|
|
96
|
+
const envelope = {
|
|
97
|
+
metric: request.metric,
|
|
98
|
+
from: request.timeRange.from,
|
|
99
|
+
to: request.timeRange.to,
|
|
100
|
+
...(request.filters
|
|
101
|
+
? { filters: request.filters }
|
|
102
|
+
: {}),
|
|
103
|
+
context: {
|
|
104
|
+
traceId: context.traceId,
|
|
105
|
+
},
|
|
106
|
+
};
|
|
107
|
+
let response;
|
|
108
|
+
try {
|
|
109
|
+
response = await options.client.query(envelope, context);
|
|
110
|
+
}
|
|
111
|
+
catch (error) {
|
|
112
|
+
return mapTransportError(error, options.id);
|
|
113
|
+
}
|
|
114
|
+
const frames = normalizeFrames(response.frames ?? []);
|
|
115
|
+
if (response.status === "error") {
|
|
116
|
+
return {
|
|
117
|
+
status: "error",
|
|
118
|
+
frames,
|
|
119
|
+
warnings: response.warnings,
|
|
120
|
+
error: {
|
|
121
|
+
code: (response.error?.code ??
|
|
122
|
+
"DATASOURCE_QUERY_FAILED"),
|
|
123
|
+
message: response.error?.message ??
|
|
124
|
+
"Datasource returned a gRPC error response.",
|
|
125
|
+
retriable: typeof response.error?.retriable === "boolean"
|
|
126
|
+
? response.error.retriable
|
|
127
|
+
: isRetriableGrpcCode(response.error?.code),
|
|
128
|
+
},
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
if (response.status === "partial") {
|
|
132
|
+
return {
|
|
133
|
+
status: "partial",
|
|
134
|
+
frames,
|
|
135
|
+
warnings: response.warnings,
|
|
136
|
+
error: {
|
|
137
|
+
code: (response.error?.code ??
|
|
138
|
+
"DATASOURCE_PARTIAL"),
|
|
139
|
+
message: response.error?.message ??
|
|
140
|
+
"Datasource returned a partial gRPC response.",
|
|
141
|
+
retriable: typeof response.error?.retriable === "boolean"
|
|
142
|
+
? response.error.retriable
|
|
143
|
+
: isRetriableGrpcCode(response.error?.code),
|
|
144
|
+
},
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
return {
|
|
148
|
+
status: "success",
|
|
149
|
+
frames,
|
|
150
|
+
warnings: response.warnings,
|
|
151
|
+
};
|
|
152
|
+
},
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AA4EA,MAAM,sBAAsB,GAAwB;IAClD,YAAY;IACZ,MAAM;IACN,OAAO;IACP,MAAM;IACN,MAAM;CACP,CAAC;AAEF,SAAS,eAAe,CAAC,SAAsB;IAC7C,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QAC/B,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,CACtB,CAAC,KAAK,EAAa,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",
|
|
5
|
+
"license": "LGPL-3.0-or-later",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/thienvu18/d-dash.git",
|
|
9
|
+
"directory": "packages/datasource-grpc"
|
|
10
|
+
},
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/thienvu18/d-dash/issues"
|
|
13
|
+
},
|
|
14
|
+
"homepage": "https://github.com/thienvu18/d-dash/tree/main/packages/datasource-grpc#readme",
|
|
15
|
+
"type": "module",
|
|
16
|
+
"main": "./dist/index.js",
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"exports": {
|
|
19
|
+
".": {
|
|
20
|
+
"types": "./dist/index.d.ts",
|
|
21
|
+
"import": "./dist/index.js"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"scripts": {
|
|
25
|
+
"build": "tsc -p tsconfig.json",
|
|
26
|
+
"test": "npm run build && node --test $(find tests -name '*.spec.js')"
|
|
27
|
+
},
|
|
28
|
+
"peerDependencies": {
|
|
29
|
+
"@d-dash/core": "^0.1.0"
|
|
30
|
+
},
|
|
31
|
+
"keywords": [
|
|
32
|
+
"dashboard",
|
|
33
|
+
"datasource",
|
|
34
|
+
"grpc",
|
|
35
|
+
"d-dash"
|
|
36
|
+
],
|
|
37
|
+
"files": [
|
|
38
|
+
"dist",
|
|
39
|
+
"README.md"
|
|
40
|
+
],
|
|
41
|
+
"engines": {
|
|
42
|
+
"node": ">=18"
|
|
43
|
+
},
|
|
44
|
+
"publishConfig": {
|
|
45
|
+
"access": "public"
|
|
46
|
+
},
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"@d-dash/core": "file:../core",
|
|
49
|
+
"typescript": "^5.9.3"
|
|
50
|
+
}
|
|
51
|
+
}
|