@nsshunt/stsinstrumentmanagerclient 1.0.1
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/LICENSE +21 -0
- package/README.md +1 -0
- package/dist/index.cjs +5836 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.mjs +5836 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +62 -0
- package/types/commonTypes.d.ts +249 -0
- package/types/commonTypes.d.ts.map +1 -0
- package/types/globalServiceDefinitions.d.ts +57 -0
- package/types/globalServiceDefinitions.d.ts.map +1 -0
- package/types/index.d.ts +11 -0
- package/types/index.d.ts.map +1 -0
- package/types/index.test.d.ts +2 -0
- package/types/index.test.d.ts.map +1 -0
- package/types/publish/agentinstrumentcontroller.d.ts +10 -0
- package/types/publish/agentinstrumentcontroller.d.ts.map +1 -0
- package/types/publish/middleware/requestLoggerMiddleware.d.ts +32 -0
- package/types/publish/middleware/requestLoggerMiddleware.d.ts.map +1 -0
- package/types/publish/publishInstrumentController.d.ts +41 -0
- package/types/publish/publishInstrumentController.d.ts.map +1 -0
- package/types/publish/publishInstruments.d.ts +19 -0
- package/types/publish/publishInstruments.d.ts.map +1 -0
- package/types/publish/publishers/publishTransportRESTServer.d.ts +9 -0
- package/types/publish/publishers/publishTransportRESTServer.d.ts.map +1 -0
- package/types/publish/stsPluginKeys.d.ts +2 -0
- package/types/publish/stsPluginKeys.d.ts.map +1 -0
- package/types/subscribe/observabilityPayloadTransformer.d.ts +33 -0
- package/types/subscribe/observabilityPayloadTransformer.d.ts.map +1 -0
- package/types/subscribe/observabilitymodelutils.d.ts +46 -0
- package/types/subscribe/observabilitymodelutils.d.ts.map +1 -0
- package/types/subscribe/restClientSubscriber.d.ts +10 -0
- package/types/subscribe/restClientSubscriber.d.ts.map +1 -0
- package/types/subscribe/socketClientSubscriber.d.ts +20 -0
- package/types/subscribe/socketClientSubscriber.d.ts.map +1 -0
package/package.json
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@nsshunt/stsinstrumentmanagerclient",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "All in one client package to include publication and subscription capabilities.",
|
|
5
|
+
"type": "commonjs",
|
|
6
|
+
"main": "./dist/index.cjs",
|
|
7
|
+
"module": "./dist/index.mjs",
|
|
8
|
+
"types": "./types/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./types/index.d.ts",
|
|
12
|
+
"import": "./dist/index.mjs",
|
|
13
|
+
"require": "./dist/index.cjs",
|
|
14
|
+
"default": "./dist/index.mjs"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"sideEffects": false,
|
|
18
|
+
"files": [
|
|
19
|
+
"dist",
|
|
20
|
+
"types",
|
|
21
|
+
"LICENSE",
|
|
22
|
+
"README.md"
|
|
23
|
+
],
|
|
24
|
+
"scripts": {
|
|
25
|
+
"lint": "eslint .",
|
|
26
|
+
"lintex": "eslint . --fix",
|
|
27
|
+
"test": "FORCE_COLOR=3 vitest run --reporter verbose --pool forks",
|
|
28
|
+
"build": "tsc && vite build"
|
|
29
|
+
},
|
|
30
|
+
"repository": "https://github.com/nsshunt/stsinstrumentmanagerclient.git",
|
|
31
|
+
"author": "admin@stsmda.com.au",
|
|
32
|
+
"license": "MIT",
|
|
33
|
+
"bugs": {
|
|
34
|
+
"url": "https://github.com/nsshunt/stsinstrumentmanagerclient/issues"
|
|
35
|
+
},
|
|
36
|
+
"homepage": "https://github.com/nsshunt/stsinstrumentmanagerclient#readme",
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"@msgpack/msgpack": "^3.1.3",
|
|
39
|
+
"@nsshunt/stsobservability": "^1.0.141",
|
|
40
|
+
"@nsshunt/stssocketioutils": "^2.0.26",
|
|
41
|
+
"@nsshunt/stsutils": "^1.19.75",
|
|
42
|
+
"axios": "^1.13.5",
|
|
43
|
+
"chalk": "^4.1.2",
|
|
44
|
+
"detect-node": "^2.1.0",
|
|
45
|
+
"socket.io-client": "^4.8.3",
|
|
46
|
+
"tiny-emitter": "^2.1.0",
|
|
47
|
+
"vue": "^3.5.28"
|
|
48
|
+
},
|
|
49
|
+
"devDependencies": {
|
|
50
|
+
"@types/detect-node": "^2.0.2",
|
|
51
|
+
"@types/node": "^25.2.3",
|
|
52
|
+
"@typescript-eslint/eslint-plugin": "^8.55.0",
|
|
53
|
+
"@typescript-eslint/parser": "^8.55.0",
|
|
54
|
+
"eslint": "^9.39.2",
|
|
55
|
+
"globals": "^17.3.0",
|
|
56
|
+
"knip": "^5.83.1",
|
|
57
|
+
"rollup-plugin-visualizer": "^6.0.5",
|
|
58
|
+
"typescript": "^5.9.3",
|
|
59
|
+
"vite": "^7.3.1",
|
|
60
|
+
"vitest": "^4.0.18"
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
import { AgentManager, ISTSLogger, JSONObject } from '@nsshunt/stsutils';
|
|
2
|
+
import { type STSDefaultServerToClientEvents, type STSDefaultClientToServerEvents } from '@nsshunt/stssocketioutils';
|
|
3
|
+
import { InstrumentBase, Gauge, GaugeTypes, InstrumentBaseOptions } from '@nsshunt/stsobservability';
|
|
4
|
+
export interface IServiceSideSocketRecord {
|
|
5
|
+
start: number;
|
|
6
|
+
globalSockets: any;
|
|
7
|
+
namespaceSockets: any;
|
|
8
|
+
namespaceRoomSockets: any;
|
|
9
|
+
end: number;
|
|
10
|
+
duration: number;
|
|
11
|
+
message: string;
|
|
12
|
+
}
|
|
13
|
+
export interface ClientToServerEvents extends STSDefaultClientToServerEvents {
|
|
14
|
+
subscribe: (data: any, callback: (data: any) => void) => void;
|
|
15
|
+
unsubscribe: (data: any, callback: (data: any) => void) => void;
|
|
16
|
+
getCurrentSubscriptions: (namespace: string, rooms: string[], callback: (data: IServiceSideSocketRecord) => void) => void;
|
|
17
|
+
}
|
|
18
|
+
export interface ServerToClientEvents extends STSDefaultServerToClientEvents {
|
|
19
|
+
subscriptionData: (data: ISubscriptionPayload, callback: (data: any) => void) => void;
|
|
20
|
+
}
|
|
21
|
+
export declare enum SubscriptionTopic {
|
|
22
|
+
AllServicesCombined = "AllServicesCombined",
|
|
23
|
+
Services = "Services",
|
|
24
|
+
ServiceInstances = "ServiceInstances",
|
|
25
|
+
ServiceInstance = "ServiceInstance",
|
|
26
|
+
AllAgentsCombined = "AllAgentsCombined",
|
|
27
|
+
Agents = "Agents",
|
|
28
|
+
AgentWorkers = "AgentWorkers",
|
|
29
|
+
AgentWorker = "AgentWorker",
|
|
30
|
+
AllLambdasCombined = "AllLambdasCombined",
|
|
31
|
+
LambdaTechnologies = "LambdaTechnologies",// e.g. aws was lambdas
|
|
32
|
+
LambdaSubTechnologies = "LambdaSubTechnologies",// e.g. aws_s3, aws_sqs, aws_sns was LambdaInstances
|
|
33
|
+
LambdaSubTechnologiesInstance = "LambdaSubTechnologiesInstance",// (uuidv4()) was ServiceInstance
|
|
34
|
+
LogProcessing = "LogProcessing"
|
|
35
|
+
}
|
|
36
|
+
export interface ISubscriptionKey {
|
|
37
|
+
id: string;
|
|
38
|
+
topic: SubscriptionTopic;
|
|
39
|
+
key?: string;
|
|
40
|
+
subkey?: string;
|
|
41
|
+
}
|
|
42
|
+
export interface IKafkaData {
|
|
43
|
+
kafkaTopic: string;
|
|
44
|
+
kafkaGroupId: string;
|
|
45
|
+
partition: number;
|
|
46
|
+
topic: string;
|
|
47
|
+
key: string;
|
|
48
|
+
value: string;
|
|
49
|
+
}
|
|
50
|
+
export interface ISubscription {
|
|
51
|
+
subscriptionKey: ISubscriptionKey;
|
|
52
|
+
cb: (payload: ISubscriptionPayload) => void;
|
|
53
|
+
}
|
|
54
|
+
export type ISubscriptions = ISubscription[];
|
|
55
|
+
export type quantile = Record<string, number>;
|
|
56
|
+
export type histo = Record<string, number>;
|
|
57
|
+
export interface ICommonInstanceTelemetry {
|
|
58
|
+
activeRequestCount: number;
|
|
59
|
+
authenticationCount: number;
|
|
60
|
+
coreCount: number;
|
|
61
|
+
duration: number;
|
|
62
|
+
errorCount: number;
|
|
63
|
+
latency: number;
|
|
64
|
+
requestCount: number;
|
|
65
|
+
retryCount: number;
|
|
66
|
+
timer: number;
|
|
67
|
+
velocity: number;
|
|
68
|
+
duration_quantile: quantile;
|
|
69
|
+
duration_histo: histo;
|
|
70
|
+
latency_quantile: quantile;
|
|
71
|
+
latency_histo: histo;
|
|
72
|
+
}
|
|
73
|
+
export interface IServiceInstanceTelemetry extends ICommonInstanceTelemetry {
|
|
74
|
+
connectionCount: number;
|
|
75
|
+
connectionIdleCount: number;
|
|
76
|
+
connectionPoolCount: number;
|
|
77
|
+
connectionWaitingCount: number;
|
|
78
|
+
cpu: number;
|
|
79
|
+
cpu_quantile: quantile;
|
|
80
|
+
systemcpu: number;
|
|
81
|
+
systemcpu_quantile: quantile;
|
|
82
|
+
memory: string;
|
|
83
|
+
rx: number;
|
|
84
|
+
tx: number;
|
|
85
|
+
}
|
|
86
|
+
export interface ILambdaInstanceTelemetry extends ICommonInstanceTelemetry {
|
|
87
|
+
connectionCount: number;
|
|
88
|
+
connectionIdleCount: number;
|
|
89
|
+
connectionPoolCount: number;
|
|
90
|
+
connectionWaitingCount: number;
|
|
91
|
+
cpu: number;
|
|
92
|
+
cpu_quantile: quantile;
|
|
93
|
+
systemcpu: number;
|
|
94
|
+
systemcpu_quantile: quantile;
|
|
95
|
+
memory: string;
|
|
96
|
+
rx: number;
|
|
97
|
+
tx: number;
|
|
98
|
+
}
|
|
99
|
+
export interface IAgentInstanceTelemetry extends ICommonInstanceTelemetry {
|
|
100
|
+
childCount: number;
|
|
101
|
+
}
|
|
102
|
+
export interface ISubscriptionPayload {
|
|
103
|
+
subscriptionKey: ISubscriptionKey;
|
|
104
|
+
data: IKafkaData | IAgentInstanceTelemetry | IAgents | IAgentWorkers | IAgentWorkerRunners | IServiceInstanceTelemetry | IServices | IServiceInstances | IServiceInstancesThreads | IServiceInstanceTelemetry | ILambdaTechnologies | ILambdaSubTechnologies | ILambdaSubTechnologiesInstance | null;
|
|
105
|
+
}
|
|
106
|
+
export interface IServices {
|
|
107
|
+
[serviceId: string]: IServiceInstanceTelemetry;
|
|
108
|
+
}
|
|
109
|
+
export interface IServiceInstances {
|
|
110
|
+
[serviceId: string]: {
|
|
111
|
+
[serviceInstanceId: string]: IServiceInstanceTelemetry;
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
export interface IServiceInstancesThreads {
|
|
115
|
+
[serviceId: string]: {
|
|
116
|
+
[serviceInstanceId: string]: {
|
|
117
|
+
[threadId: string]: IServiceInstanceTelemetry;
|
|
118
|
+
};
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
export interface ILambdaTechnologies {
|
|
122
|
+
[lambdaTechnoplogyId: string]: ILambdaInstanceTelemetry;
|
|
123
|
+
}
|
|
124
|
+
export interface ILambdaSubTechnologies {
|
|
125
|
+
[lambdaTechnoplogyId: string]: {
|
|
126
|
+
[lambdaSubTechnoplogyId: string]: IServiceInstanceTelemetry;
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
export interface ILambdaSubTechnologiesInstance {
|
|
130
|
+
[lambdaTechnoplogyId: string]: {
|
|
131
|
+
[lambdaSubTechnoplogyId: string]: {
|
|
132
|
+
[lambdaSubTechnoplogyInstanceId: string]: IServiceInstanceTelemetry;
|
|
133
|
+
};
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
export interface IAgents {
|
|
137
|
+
[agentId: string]: IAgentInstanceTelemetry;
|
|
138
|
+
}
|
|
139
|
+
export interface IAgentWorkers {
|
|
140
|
+
[agentId: string]: {
|
|
141
|
+
[agentWorkerId: string]: IAgentInstanceTelemetry;
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
export interface IAgentWorkerRunners {
|
|
145
|
+
[agentId: string]: {
|
|
146
|
+
[agentWorkerId: string]: {
|
|
147
|
+
[asyncRunnerId: string]: IAgentInstanceTelemetry;
|
|
148
|
+
};
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
export declare const GetSocketIOSubscriptionKey: (subscriptionKey: ISubscriptionKey) => string;
|
|
152
|
+
export interface IObservabilitySocketIOSubscriberOptions {
|
|
153
|
+
socket?: any;
|
|
154
|
+
keepAlive?: number;
|
|
155
|
+
urlBase?: string;
|
|
156
|
+
agentManager?: AgentManager;
|
|
157
|
+
logger: ISTSLogger;
|
|
158
|
+
}
|
|
159
|
+
export interface IObservabilitySocketIOSubscriber {
|
|
160
|
+
Subscribe(subscriptions: ISubscriptions): void;
|
|
161
|
+
UnSubscribe(subscriptions: ISubscriptions): void;
|
|
162
|
+
}
|
|
163
|
+
export declare const KAFKA_PREFIX: string;
|
|
164
|
+
export interface IObservabilitySubscriberManagerOptions {
|
|
165
|
+
modelId: string;
|
|
166
|
+
consumeInstrumentationMode: string;
|
|
167
|
+
instrumentManagerEndpoint: string;
|
|
168
|
+
instrumentManagerPort: string;
|
|
169
|
+
instrumentManagerAPIRoot: string;
|
|
170
|
+
}
|
|
171
|
+
export declare enum TransportType {
|
|
172
|
+
none = 0,
|
|
173
|
+
IPC = 1,// Inter-process communication (local)
|
|
174
|
+
websocket = 2,// node ws
|
|
175
|
+
RESTAPI = 4,// RESTful API
|
|
176
|
+
redis = 8,
|
|
177
|
+
kafka = 16,// https://www.npmjs.com/package/kafkajs
|
|
178
|
+
influxdb = 32,// https://github.com/influxdata/influxdb-client-js/ https://www.npmjs.com/package/@influxdata/influxdb-client
|
|
179
|
+
prometheus = 64,
|
|
180
|
+
gRPC = 128,// https://www.npmjs.com/package/@grpc/grpc-js
|
|
181
|
+
unixsocket = 256,// Uses https://www.npmjs.com/package/json-socket
|
|
182
|
+
socketio = 512,// https://socket.io
|
|
183
|
+
otelcollector = 1024,
|
|
184
|
+
messageport = 2048,
|
|
185
|
+
jsonrpc = 4096,// https://www.npmjs.com/package/jayson
|
|
186
|
+
postgresql = 8192,
|
|
187
|
+
grafanaloki = 16384,
|
|
188
|
+
logstash = 32768,
|
|
189
|
+
fluentbit = 65536,
|
|
190
|
+
fluentd = 131072,
|
|
191
|
+
inmemory = 262144
|
|
192
|
+
}
|
|
193
|
+
export declare function GetTransportMode(transport: string): TransportType;
|
|
194
|
+
export type Nid = string;
|
|
195
|
+
export interface IContextBase extends JSONObject {
|
|
196
|
+
serviceType?: string;
|
|
197
|
+
nid?: Nid;
|
|
198
|
+
}
|
|
199
|
+
export declare enum InstrumentPayloadType {
|
|
200
|
+
agent = "agent",
|
|
201
|
+
service = "service"
|
|
202
|
+
}
|
|
203
|
+
export interface IInstrumentPayload {
|
|
204
|
+
context: IContextBase;
|
|
205
|
+
instruments: Record<string, InstrumentBase>;
|
|
206
|
+
}
|
|
207
|
+
export type InstrumentDefinition = [Gauge, GaugeTypes, InstrumentBaseOptions?];
|
|
208
|
+
export type InstrumentDefinitions = InstrumentDefinition[];
|
|
209
|
+
export interface IPublisherTransport {
|
|
210
|
+
Publish(payload: IInstrumentPayload): Promise<boolean>;
|
|
211
|
+
Close(): Promise<boolean>;
|
|
212
|
+
}
|
|
213
|
+
export interface IPublishInstrumentController {
|
|
214
|
+
GetPayloadData(): IInstrumentPayload;
|
|
215
|
+
}
|
|
216
|
+
export interface IPublishInstrumentControllerOptions {
|
|
217
|
+
processContext: IContextBase;
|
|
218
|
+
consoleLogging?: boolean;
|
|
219
|
+
instrumentLogging?: boolean;
|
|
220
|
+
httpServer?: boolean;
|
|
221
|
+
instrumentationObservationInterval?: number;
|
|
222
|
+
instrumentationTimeWindow?: number;
|
|
223
|
+
instrumentDefinitions?: InstrumentDefinitions;
|
|
224
|
+
publishInterval: number;
|
|
225
|
+
publishPostFailInterval: number;
|
|
226
|
+
logger: ISTSLogger;
|
|
227
|
+
publishTransportBaseOptions: IPublishTransportBaseOptions;
|
|
228
|
+
autoStart: boolean;
|
|
229
|
+
}
|
|
230
|
+
export interface IPublishInstrumentsOptions {
|
|
231
|
+
processContext: IContextBase;
|
|
232
|
+
publishInterval: number;
|
|
233
|
+
publishPostFailInterval: number;
|
|
234
|
+
logger: ISTSLogger;
|
|
235
|
+
publishInstrumentController?: IPublishInstrumentController;
|
|
236
|
+
publishTransportBaseOptions: IPublishTransportBaseOptions;
|
|
237
|
+
}
|
|
238
|
+
export interface IPublishTransportBaseOptions {
|
|
239
|
+
id?: string;
|
|
240
|
+
transportType: TransportType;
|
|
241
|
+
logger: ISTSLogger;
|
|
242
|
+
}
|
|
243
|
+
export interface IPublishTransportRESTServerOptions extends IPublishTransportBaseOptions {
|
|
244
|
+
url?: string;
|
|
245
|
+
socketPath?: string;
|
|
246
|
+
agentManager?: AgentManager;
|
|
247
|
+
showPublishPayload?: boolean;
|
|
248
|
+
}
|
|
249
|
+
//# sourceMappingURL=commonTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commonTypes.d.ts","sourceRoot":"","sources":["../src/commonTypes.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,EAAE,KAAK,8BAA8B,EAAE,KAAK,8BAA8B,EAAE,MAAM,2BAA2B,CAAA;AACpH,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,UAAU,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAA;AAEpG,MAAM,WAAW,wBAAwB;IACrC,KAAK,EAAE,MAAM,CAAA;IACb,aAAa,EAAE,GAAG,CAAA;IAClB,gBAAgB,EAAE,GAAG,CAAA;IACrB,oBAAoB,EAAE,GAAG,CAAA;IACzB,GAAG,EAAE,MAAM,CAAA;IACX,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,WAAW,oBAAqB,SAAQ,8BAA8B;IACxE,SAAS,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,KAAK,IAAI,CAAC;IAC9D,W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CAAA;CAC5B;AAED,MAAM,WAAW,4BAA4B;IACzC,cAAc,IAAI,kBAAkB,CAAA;CACvC;AAED,MAAM,WAAW,mCAAmC;IAChD,cAAc,EAAE,YAAY,CAAA;IAC5B,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,kCAAkC,CAAC,EAAE,MAAM,CAAA;IAC3C,yBAAyB,CAAC,EAAE,MAAM,CAAA;IAClC,qBAAqB,CAAC,EAAE,qBAAqB,CAAA;IAC7C,eAAe,EAAE,MAAM,CAAA;IACvB,uBAAuB,EAAE,MAAM,CAAA;IAC/B,MAAM,EAAE,UAAU,CAAA;IAClB,2BAA2B,EAAE,4BAA4B,CAAA;IACzD,SAAS,EAAE,OAAO,CAAA;CACrB;AAED,MAAM,WAAW,0BAA0B;IACvC,cAAc,EAAE,YAAY,CAAA;IAC5B,eAAe,EAAE,MAAM,CAAA;IACvB,uBAAuB,EAAE,MAAM,CAAA;IAC/B,MAAM,EAAE,UAAU,CAAA;IAClB,2BAA2B,CAAC,EAAE,4BAA4B,CAAA;IAC1D,2BAA2B,EAAE,4BAA4B,CAAA;CAC5D;AAED,MAAM,WAAW,4BAA4B;IACzC,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,aAAa,EAAE,aAAa,CAAA;IAC5B,MAAM,EAAE,UAAU,CAAA;CACrB;AAED,MAAM,WAAW,kCAAmC,SAAQ,4BAA4B;IACpF,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,YAAY,CAAC,EAAE,YAAY,CAAA;IAC3B,kBAAkB,CAAC,EAAE,OAAO,CAAA;CAC/B"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { Gauge, GaugeTypes, InstrumentBaseOptions } from '@nsshunt/stsobservability';
|
|
2
|
+
import { IContextBase, InstrumentDefinitions } from './commonTypes';
|
|
3
|
+
import { SubscriptionTopic } from './commonTypes';
|
|
4
|
+
export type IInstrumentHashMap = Record<string, string>;
|
|
5
|
+
export interface IHistoField {
|
|
6
|
+
label: string;
|
|
7
|
+
bucketLimit: number;
|
|
8
|
+
}
|
|
9
|
+
export declare enum influxDBDataType {
|
|
10
|
+
intField = "intField",
|
|
11
|
+
floatField = "floatField",
|
|
12
|
+
stringField = "stringField"
|
|
13
|
+
}
|
|
14
|
+
export interface IFieldRecord {
|
|
15
|
+
fieldName: string;
|
|
16
|
+
gauge: Gauge;
|
|
17
|
+
instrumentProperty: string;
|
|
18
|
+
dataType: string;
|
|
19
|
+
influxdbDataType: influxDBDataType;
|
|
20
|
+
timeSeriesIndex?: boolean;
|
|
21
|
+
quantile?: boolean;
|
|
22
|
+
histo?: IHistoField[];
|
|
23
|
+
histoGauge?: Gauge;
|
|
24
|
+
gaugeType: GaugeTypes;
|
|
25
|
+
instrumentOptions?: InstrumentBaseOptions;
|
|
26
|
+
}
|
|
27
|
+
export interface IRedisQueryFilters {
|
|
28
|
+
level1ContextField: string;
|
|
29
|
+
level2ContextField: string;
|
|
30
|
+
level3ContextField: string;
|
|
31
|
+
}
|
|
32
|
+
export interface IRedisIndexPrefixDefinitions {
|
|
33
|
+
timeSeriesIndex: string;
|
|
34
|
+
timeSeriesPrefix: string;
|
|
35
|
+
instantIndex: string;
|
|
36
|
+
instantPrefix: string;
|
|
37
|
+
}
|
|
38
|
+
export interface IsubscriptionTopic {
|
|
39
|
+
subscriptionTopic: SubscriptionTopic;
|
|
40
|
+
route: string;
|
|
41
|
+
}
|
|
42
|
+
export interface IServiceDefinition {
|
|
43
|
+
influxDBContextTags: string[];
|
|
44
|
+
redisIndexPrefixDefinitions: IRedisIndexPrefixDefinitions;
|
|
45
|
+
fieldList: IFieldRecord[];
|
|
46
|
+
GetPathFromContext: (context: IContextBase) => string;
|
|
47
|
+
redisQueryFilters: IRedisQueryFilters;
|
|
48
|
+
subscriptionTopics: IsubscriptionTopic[];
|
|
49
|
+
}
|
|
50
|
+
export interface IGlobalServiceDefinitions {
|
|
51
|
+
coreFieldList: IFieldRecord[];
|
|
52
|
+
logFieldList: IFieldRecord[];
|
|
53
|
+
services: Record<string, IServiceDefinition>;
|
|
54
|
+
}
|
|
55
|
+
export declare const globalServiceDefinitions: IGlobalServiceDefinitions;
|
|
56
|
+
export declare const GetInstruments: (service: string) => InstrumentDefinitions;
|
|
57
|
+
//# sourceMappingURL=globalServiceDefinitions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"globalServiceDefinitions.d.ts","sourceRoot":"","sources":["../src/globalServiceDefinitions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,qBAAqB,EAEhD,MAAM,2BAA2B,CAAA;AAElC,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAA;AAEnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AAEjD,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAExD,MAAM,WAAW,WAAW;IACxB,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,MAAM,CAAA;CACtB;AAED,oBAAY,gBAAgB;IACxB,QAAQ,aAAa;IACrB,UAAU,eAAe;IACzB,WAAW,gBAAgB;CAC9B;AAED,MAAM,WAAW,YAAY;IACzB,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,KAAK,CAAA;IACZ,kBAAkB,EAAE,MAAM,CAAA;IAC1B,QAAQ,EAAE,MAAM,CAAA;IAChB,gBAAgB,EAAE,gBAAgB,CAAA;IAClC,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,KAAK,CAAC,EAAE,WAAW,EAAE,CAAC;IACtB,UAAU,CAAC,EAAE,KAAK,CAAC;IACnB,SAAS,EAAE,UAAU,CAAC;IACtB,iBAAiB,CAAC,EAAE,qBAAqB,CAAA;CAC5C;AAGD,MAAM,WAAW,kBAAkB;IAC/B,kBAAkB,EAAE,MAAM,CAAA;IAC1B,kBAAkB,EAAE,MAAM,CAAA;IAC1B,kBAAkB,EAAE,MAAM,CAAA;CAC7B;AAED,MAAM,WAAW,4BAA4B;IACzC,eAAe,EAAE,MAAM,CAAA;IACvB,gBAAgB,EAAE,MAAM,CAAA;IACxB,YAAY,EAAE,MAAM,CAAA;IACpB,aAAa,EAAE,MAAM,CAAA;CACxB;AAED,MAAM,WAAW,kBAAkB;IAC/B,iBAAiB,EAAE,iBAAiB,CAAA;IACpC,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,kBAAkB;IAC/B,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAC9B,2BAA2B,EAAE,4BAA4B,CAAA;IACzD,SAAS,EAAE,YAAY,EAAE,CAAA;IACzB,kBAAkB,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,MAAM,CAAA;IACrD,iBAAiB,EAAE,kBAAkB,CAAA;IACrC,kBAAkB,EAAE,kBAAkB,EAAE,CAAA;CAC3C;AAED,MAAM,WAAW,yBAAyB;IACtC,aAAa,EAAE,YAAY,EAAE,CAAA;IAC7B,YAAY,EAAE,YAAY,EAAE,CAAA;IAC5B,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;CAChD;AAOD,eAAO,MAAM,wBAAwB,EAAE,yBAoPtC,CAAA;AAED,eAAO,MAAM,cAAc,GAAI,SAAS,MAAM,KAAG,qBAkBhD,CAAA"}
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from './commonTypes';
|
|
2
|
+
export * from './publish/middleware/requestLoggerMiddleware';
|
|
3
|
+
export * from './publish/publishInstrumentController';
|
|
4
|
+
export * from './publish/stsPluginKeys';
|
|
5
|
+
export * from './publish/agentinstrumentcontroller';
|
|
6
|
+
export * from './publish/publishers/publishTransportRESTServer';
|
|
7
|
+
export * from './subscribe/observabilityPayloadTransformer';
|
|
8
|
+
export * from './subscribe/restClientSubscriber';
|
|
9
|
+
export * from './subscribe/socketClientSubscriber';
|
|
10
|
+
export * from './globalServiceDefinitions';
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA;AAG7B,cAAc,8CAA8C,CAAA;AAC5D,cAAc,uCAAuC,CAAA;AACrD,cAAc,yBAAyB,CAAA;AACvC,cAAc,qCAAqC,CAAA;AACnD,cAAc,iDAAiD,CAAA;AAG/D,cAAc,6CAA6C,CAAA;AAC3D,cAAc,kCAAkC,CAAA;AAChD,cAAc,oCAAoC,CAAA;AAIlD,cAAc,4BAA4B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../src/index.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { PublishInstrumentController } from './publishInstrumentController';
|
|
2
|
+
import { IPublishInstrumentControllerOptions } from './../commonTypes';
|
|
3
|
+
export declare const GetSTSInstrumentControllerPluginKey: () => symbol;
|
|
4
|
+
export declare const CompareSTSInstrumentControllerPluginKey: (val: symbol) => boolean;
|
|
5
|
+
export declare const useSTSInstrumentControllerPlugin: () => PublishInstrumentController;
|
|
6
|
+
export declare const GetSTSInstrumentController: (app: any) => PublishInstrumentController;
|
|
7
|
+
export declare const STSInstrumentControllerPlugin: {
|
|
8
|
+
install: (app: any, options: IPublishInstrumentControllerOptions) => void;
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=agentinstrumentcontroller.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agentinstrumentcontroller.d.ts","sourceRoot":"","sources":["../../src/publish/agentinstrumentcontroller.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAA;AAC3E,OAAO,EAAE,mCAAmC,EAAE,MAAM,kBAAkB,CAAA;AAItE,eAAO,MAAM,mCAAmC,QAAO,MAA0C,CAAA;AAEjG,eAAO,MAAM,uCAAuC,GAAI,KAAK,MAAM,KAAG,OAAmD,CAAA;AAIzH,eAAO,MAAM,gCAAgC,QAAO,2BAAsG,CAAA;AAG1J,eAAO,MAAM,0BAA0B,GAAI,KAAK,GAAG,KAAG,2BAErD,CAAA;AAED,eAAO,MAAM,6BAA6B;mBAEvB,GAAG,WAAW,mCAAmC;CAuBnE,CAAA"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { JSONObject, STSOptionsBase } from '@nsshunt/stsutils';
|
|
2
|
+
export interface RequestLoggerMiddlewareOptions {
|
|
3
|
+
ignoresocketio: boolean;
|
|
4
|
+
}
|
|
5
|
+
export declare enum RequestLoggerMiddlewareEventName {
|
|
6
|
+
UpdateInstrument_AR_DEC = "UpdateInstrument_AR_DEC",// active request gauge - decrement
|
|
7
|
+
UpdateInstrument_AR_INC = "UpdateInstrument_AR_INC",// active request gauge - increment
|
|
8
|
+
UpdateInstrument_RC_INC = "UpdateInstrument_RC_INC",// request count gauge - increment
|
|
9
|
+
UpdateInstrument_V_INC = "UpdateInstrument_V_INC",// velocity gauge - increment
|
|
10
|
+
UpdateInstrument_DH_VAL = "UpdateInstrument_DH_VAL",// duration histo - value
|
|
11
|
+
UpdateInstrument_D_VAL = "UpdateInstrument_D_VAL"
|
|
12
|
+
}
|
|
13
|
+
export type RequestLoggerMiddlewareEventFunc = (data?: string | number | JSONObject) => void;
|
|
14
|
+
export declare class RequestLoggerMiddleware extends STSOptionsBase {
|
|
15
|
+
#private;
|
|
16
|
+
constructor(options: RequestLoggerMiddlewareOptions);
|
|
17
|
+
get options(): RequestLoggerMiddlewareOptions;
|
|
18
|
+
on(eventName: string, callBackFn: RequestLoggerMiddlewareEventFunc): void;
|
|
19
|
+
/**
|
|
20
|
+
* Use with .bind(class instance).
|
|
21
|
+
* Example;
|
|
22
|
+
* ---
|
|
23
|
+
* `let requestLoggerMiddleware = new RequestLoggerMiddleware();
|
|
24
|
+
* app.use(requestLoggerMiddleware.Middleware.bind(requestLoggerMiddleware));`
|
|
25
|
+
* @param {*} req
|
|
26
|
+
* @param {*} res
|
|
27
|
+
* @param {*} next
|
|
28
|
+
* @returns
|
|
29
|
+
*/
|
|
30
|
+
Middleware: (req: any, res: any, next: any) => Promise<void>;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=requestLoggerMiddleware.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"requestLoggerMiddleware.d.ts","sourceRoot":"","sources":["../../../src/publish/middleware/requestLoggerMiddleware.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAK9D,MAAM,WAAW,8BAA8B;IAC9C,cAAc,EAAE,OAAO,CAAA;CACvB;AAED,oBAAY,gCAAgC;IACxC,uBAAuB,4BAA4B,CAAE,mCAAmC;IACxF,uBAAuB,4BAA4B,CAAE,mCAAmC;IACxF,uBAAuB,4BAA4B,CAAE,kCAAkC;IACvF,sBAAsB,2BAA2B,CAAE,6BAA6B;IAChF,uBAAuB,4BAA4B,CAAE,yBAAyB;IAC9E,sBAAsB,2BAA2B;CACpD;AAED,MAAM,MAAM,gCAAgC,GAAG,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,UAAU,KAAK,IAAI,CAAC;AAG7F,qBAAa,uBAAwB,SAAQ,cAAc;;gBAI3C,OAAO,EAAE,8BAA8B;IAInD,IAAa,OAAO,IAAI,8BAA8B,CAErD;IAED,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,gCAAgC;IAqBlE;;;;;;;;;;OAUA;IAEA,UAAU,GAAU,KAAK,GAAG,EAAE,KAAK,GAAG,EAAE,MAAM,GAAG,mBAmChD;CACJ"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Gauge, InstrumentBaseTelemetry } from '@nsshunt/stsobservability';
|
|
2
|
+
import { STSOptionsBase } from '@nsshunt/stsutils';
|
|
3
|
+
import { IPublishInstrumentControllerOptions, IContextBase, IInstrumentPayload, IPublishInstrumentController } from './../commonTypes';
|
|
4
|
+
export declare enum ePublishState {
|
|
5
|
+
init = 0,
|
|
6
|
+
started = 1,
|
|
7
|
+
stopping = 2
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* This class managers the creation of instruments and the publication of instrumentation telemetry to the instrument manager service.
|
|
11
|
+
*/
|
|
12
|
+
export declare class PublishInstrumentController extends STSOptionsBase implements IPublishInstrumentController {
|
|
13
|
+
#private;
|
|
14
|
+
constructor(options: IPublishInstrumentControllerOptions);
|
|
15
|
+
get options(): IPublishInstrumentControllerOptions;
|
|
16
|
+
StartPublish(): Promise<boolean>;
|
|
17
|
+
EndPublish(): Promise<boolean>;
|
|
18
|
+
Publish(): Promise<boolean>;
|
|
19
|
+
LogEx: (message: string) => void;
|
|
20
|
+
GetPayloadData(): IInstrumentPayload;
|
|
21
|
+
SetupInstrumentation(): void;
|
|
22
|
+
/**
|
|
23
|
+
* Check if an instrument exists within the managed instrument collection
|
|
24
|
+
* @param instrumentName
|
|
25
|
+
* @returns
|
|
26
|
+
*/
|
|
27
|
+
InstrumentExists(instrumentName: Gauge): boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Update instrument telemetry.
|
|
30
|
+
* @param instrumentName
|
|
31
|
+
* @param telemetry
|
|
32
|
+
*/
|
|
33
|
+
UpdateInstrument(instrumentName: Gauge, telemetry: InstrumentBaseTelemetry): void;
|
|
34
|
+
/**
|
|
35
|
+
* Add additional instrument publishers. Usually invoked when adding workers to the app and/or async runners within a worker.
|
|
36
|
+
* @param processContext
|
|
37
|
+
* @returns Returns the newly created PublishInstrumentController
|
|
38
|
+
*/
|
|
39
|
+
AddPublishInstrumentController(processContext: IContextBase): PublishInstrumentController;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=publishInstrumentController.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publishInstrumentController.d.ts","sourceRoot":"","sources":["../../src/publish/publishInstrumentController.ts"],"names":[],"mappings":"AAGA,OAAO,EAAc,KAAK,EAAyC,uBAAuB,EAGzF,MAAM,2BAA2B,CAAA;AAElC,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAElD,OAAO,EAAE,mCAAmC,EACxC,YAAY,EAAE,kBAAkB,EAAE,4BAA4B,EAA8B,MAAM,kBAAkB,CAAA;AAGxH,oBAAY,aAAa;IACrB,IAAI,IAAA;IACJ,OAAO,IAAA;IACP,QAAQ,IAAA;CACX;AACD;;GAEG;AACH,qBAAa,2BAA4B,SAAQ,cAAe,YAAW,4BAA4B;;gBAIvF,OAAO,EAAE,mCAAmC;IAmBxD,IAAa,OAAO,IAAI,mCAAmC,CAE1D;IAEK,YAAY,IAAI,OAAO,CAAC,OAAO,CAAC;IAIhC,UAAU,IAAI,OAAO,CAAC,OAAO,CAAC;IAI9B,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC;IAIjC,KAAK,GAAI,SAAS,MAAM,UAIvB;IAsDD,cAAc,IAAI,kBAAkB;IAkBpC,oBAAoB;IAYpB;;;;OAIG;IACH,gBAAgB,CAAC,cAAc,EAAE,KAAK,GAAG,OAAO;IAOhD;;;;OAIG;IACH,gBAAgB,CAAC,cAAc,EAAE,KAAK,EAAE,SAAS,EAAE,uBAAuB,GAAG,IAAI;IASjF;;;;OAIA;IACA,8BAA8B,CAAC,cAAc,EAAE,YAAY,GAAG,2BAA2B;CAK5F"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { STSOptionsBase } from '@nsshunt/stsutils';
|
|
2
|
+
import { IPublishInstrumentsOptions } from './../commonTypes';
|
|
3
|
+
export declare enum ePublishState {
|
|
4
|
+
init = 0,
|
|
5
|
+
started = 1,
|
|
6
|
+
stopping = 2
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* This class managers the creation of instruments and the publication of instrumentation telemetry to the instrument manager service.
|
|
10
|
+
*/
|
|
11
|
+
export declare class PublishInstruments extends STSOptionsBase {
|
|
12
|
+
#private;
|
|
13
|
+
constructor(options: IPublishInstrumentsOptions);
|
|
14
|
+
get options(): IPublishInstrumentsOptions;
|
|
15
|
+
Publish(): Promise<boolean>;
|
|
16
|
+
StartPublish(): Promise<boolean>;
|
|
17
|
+
EndPublish(): Promise<boolean>;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=publishInstruments.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publishInstruments.d.ts","sourceRoot":"","sources":["../../src/publish/publishInstruments.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAElD,OAAO,EAAE,0BAA0B,EAA0D,MAAM,kBAAkB,CAAA;AAIrH,oBAAY,aAAa;IACrB,IAAI,IAAA;IACJ,OAAO,IAAA;IACP,QAAQ,IAAA;CACX;AACD;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,cAAc;;gBAMtC,OAAO,EAAE,0BAA0B;IAa/C,IAAa,OAAO,IAAI,0BAA0B,CAEjD;IAEK,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC;IA6C3B,YAAY,IAAI,OAAO,CAAC,OAAO,CAAC;IAgBhC,UAAU,IAAI,OAAO,CAAC,OAAO,CAAC;CAkBvC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IPublishTransportRESTServerOptions, IInstrumentPayload, IPublisherTransport } from './../../commonTypes';
|
|
2
|
+
import { STSOptionsBase } from '@nsshunt/stsutils';
|
|
3
|
+
export declare class PublishTransportRESTServer extends STSOptionsBase implements IPublisherTransport {
|
|
4
|
+
constructor(options: IPublishTransportRESTServerOptions);
|
|
5
|
+
get options(): IPublishTransportRESTServerOptions;
|
|
6
|
+
Publish: (payload: IInstrumentPayload) => Promise<boolean>;
|
|
7
|
+
Close(): Promise<boolean>;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=publishTransportRESTServer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publishTransportRESTServer.d.ts","sourceRoot":"","sources":["../../../src/publish/publishers/publishTransportRESTServer.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,kCAAkC,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAEjH,OAAO,EAAE,cAAc,EAAkB,MAAM,mBAAmB,CAAA;AAIlE,qBAAa,0BAA2B,SAAQ,cAAe,YAAW,mBAAmB;gBAE7E,OAAO,EAAE,kCAAkC;IAIvD,IAAa,OAAO,IAAI,kCAAkC,CAEzD;IAGD,OAAO,GAAU,SAAS,kBAAkB,KAAG,OAAO,CAAC,OAAO,CAAC,CAuE9D;IAEK,KAAK,IAAI,OAAO,CAAC,OAAO,CAAC;CAMlC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stsPluginKeys.d.ts","sourceRoot":"","sources":["../../src/publish/stsPluginKeys.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,gCAAgC,eAAiC,CAAA"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { JSONObject } from '@nsshunt/stsutils';
|
|
2
|
+
import { ISubscriptionPayload } from './../commonTypes';
|
|
3
|
+
import { ISTSLogger } from '@nsshunt/stsutils';
|
|
4
|
+
export interface IObservabilitySubscriptionManager {
|
|
5
|
+
logger: ISTSLogger;
|
|
6
|
+
maxLogLength: number;
|
|
7
|
+
}
|
|
8
|
+
export declare enum runStates {
|
|
9
|
+
idle = "idle",
|
|
10
|
+
started = "started",
|
|
11
|
+
stopped = "stopped"
|
|
12
|
+
}
|
|
13
|
+
export declare class ObservabilityPayloadTransformer {
|
|
14
|
+
#private;
|
|
15
|
+
constructor(options: IObservabilitySubscriptionManager);
|
|
16
|
+
get serviceModel(): JSONObject;
|
|
17
|
+
get agentModel(): JSONObject;
|
|
18
|
+
get lambdaModel(): JSONObject;
|
|
19
|
+
TransformSubscriptionPayloadCallback(subscriptionPayload: ISubscriptionPayload): void;
|
|
20
|
+
CreateModelAllServicesCombined(subscriptionPayload: ISubscriptionPayload): void;
|
|
21
|
+
CreateModelServices(subscriptionPayload: ISubscriptionPayload): void;
|
|
22
|
+
CreateModelServiceInstances(subscriptionPayload: ISubscriptionPayload): void;
|
|
23
|
+
CreateModelServiceInstance(subscriptionPayload: ISubscriptionPayload): void;
|
|
24
|
+
CreateModelAllAgentsCombined(subscriptionPayload: ISubscriptionPayload): void;
|
|
25
|
+
CreateModelAgents(subscriptionPayload: ISubscriptionPayload): void;
|
|
26
|
+
CreateModelAgentWorkers(subscriptionPayload: ISubscriptionPayload): void;
|
|
27
|
+
CreateModelAgentWorker(subscriptionPayload: ISubscriptionPayload): void;
|
|
28
|
+
CreateModelAllLambdasCombined(subscriptionPayload: ISubscriptionPayload): void;
|
|
29
|
+
CreateModelLambdaTechnologies(subscriptionPayload: ISubscriptionPayload): void;
|
|
30
|
+
CreateModelLambdaSubTechnologies(subscriptionPayload: ISubscriptionPayload): void;
|
|
31
|
+
CreateModelLambdaSubTechnologiesInstance(subscriptionPayload: ISubscriptionPayload): void;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=observabilityPayloadTransformer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"observabilityPayloadTransformer.d.ts","sourceRoot":"","sources":["../../src/subscribe/observabilityPayloadTransformer.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAC9C,OAAO,EAAE,oBAAoB,EAG6E,MAAM,kBAAkB,CAAA;AAMlI,OAAO,EAAE,UAAU,EAAE,MAAM,mB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stanceTelemetry, ILambdaInstanceTelemetry } from './../commonTypes';
|
|
3
|
+
import { ISTSLogger, JSONObject } from '@nsshunt/stsutils';
|
|
4
|
+
export interface IModelNode {
|
|
5
|
+
val: number;
|
|
6
|
+
vf: string;
|
|
7
|
+
value: string;
|
|
8
|
+
}
|
|
9
|
+
export interface IModelNodeRawStringArray {
|
|
10
|
+
val: string[];
|
|
11
|
+
}
|
|
12
|
+
export interface IModelNodeJSONFromObject {
|
|
13
|
+
val: any;
|
|
14
|
+
}
|
|
15
|
+
export interface IModelNodeQuantile {
|
|
16
|
+
val: number;
|
|
17
|
+
vf: string;
|
|
18
|
+
value: string;
|
|
19
|
+
percentile: QuantileDataElement[];
|
|
20
|
+
percentileFormatted: string;
|
|
21
|
+
}
|
|
22
|
+
export interface IModelNodeHist {
|
|
23
|
+
hist: HistogramDataElement[];
|
|
24
|
+
}
|
|
25
|
+
export interface IModelNodes {
|
|
26
|
+
id: string;
|
|
27
|
+
instruments: Record<string, IModelNode | IModelNodeRawStringArray | IModelNodeJSONFromObject | IModelNodeQuantile | IModelNodeHist>;
|
|
28
|
+
canNavigate?: boolean;
|
|
29
|
+
options?: JSONObject;
|
|
30
|
+
}
|
|
31
|
+
export declare class ObservabilityModelUtils {
|
|
32
|
+
static GetModelNode(data: number): IModelNode;
|
|
33
|
+
static GetModelNodeRawStringArray(data: string[]): IModelNodeRawStringArray;
|
|
34
|
+
static GetModelNodeObject(data: any): IModelNodeJSONFromObject;
|
|
35
|
+
static GetModelNodeWithQuantile(data: number, quantileData: quantile): IModelNodeQuantile;
|
|
36
|
+
static GetModelNodeHistFromInfluxData(data: histo): IModelNodeHist;
|
|
37
|
+
static ParseModelNode: (model: IModelNodes, data: IServiceInstanceTelemetry | IAgentInstanceTelemetry | ILambdaInstanceTelemetry, parseLog: string[], gaugeName: Gauge, fieldName: string) => void;
|
|
38
|
+
static ParseModelNodeWithQuantile: (model: IModelNodes, data: IServiceInstanceTelemetry | IAgentInstanceTelemetry | ILambdaInstanceTelemetry, parseLog: string[], gaugeName: Gauge, fieldName: string, quantileFieldName: string) => void;
|
|
39
|
+
static ParseModelNodeHisto: (model: IModelNodes, data: IServiceInstanceTelemetry | IAgentInstanceTelemetry | ILambdaInstanceTelemetry, parseLog: string[], gaugeName: Gauge, fieldName: string) => void;
|
|
40
|
+
static ParseModelNodeObject: (model: IModelNodes, data: IServiceInstanceTelemetry | IAgentInstanceTelemetry | ILambdaInstanceTelemetry, parseLog: string[], gaugeName: Gauge, fieldName: string) => void;
|
|
41
|
+
static GetModelData(serviceType: string, model: IModelNodes, data: IServiceInstanceTelemetry | ILambdaInstanceTelemetry | IAgentInstanceTelemetry, parseLog: string[]): void;
|
|
42
|
+
static GetModelForService(id: string, data: IServiceInstanceTelemetry, logger: ISTSLogger): IModelNodes | null;
|
|
43
|
+
static GetModelForLambda(id: string, data: ILambdaInstanceTelemetry, logger: ISTSLogger): IModelNodes | null;
|
|
44
|
+
static GetModelForAgent(id: string, data: IAgentInstanceTelemetry, logger: ISTSLogger): IModelNodes | null;
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=observabilitymodelutils.d.ts.map
|