@nsshunt/stsobservability 1.0.5 → 1.0.7

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.
@@ -5071,6 +5071,328 @@ const GetSocketIOSubscriptionKey = (subscriptionKey) => {
5071
5071
  return `SubscriptionData_${subscriptionKey.id}`;
5072
5072
  };
5073
5073
  const KAFKA_PREFIX = "__STS__";
5074
+ var influxDBDataType = /* @__PURE__ */ ((influxDBDataType2) => {
5075
+ influxDBDataType2["intField"] = "intField";
5076
+ influxDBDataType2["floatField"] = "floatField";
5077
+ influxDBDataType2["stringField"] = "stringField";
5078
+ return influxDBDataType2;
5079
+ })(influxDBDataType || {});
5080
+ const instrumentationObservationInterval = 1e3;
5081
+ const instrumentationTimeWindow = 600;
5082
+ const consoleLogging = true;
5083
+ const instrumentLogging = true;
5084
+ const globalServiceDefinitions = {
5085
+ coreFieldList: [
5086
+ { fieldName: "requestCount", gauge: Gauge.REQUEST_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
5087
+ { fieldName: "errorCount", gauge: Gauge.ERROR_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
5088
+ { fieldName: "retryCount", gauge: Gauge.RETRY_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
5089
+ { fieldName: "authenticationCount", gauge: Gauge.AUTHENTICATION_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
5090
+ { fieldName: "authenticationErrorCount", gauge: Gauge.AUTHENTICATION_ERROR_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
5091
+ { fieldName: "authenticationRetryCount", gauge: Gauge.AUTHENTICATION_RETRY_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
5092
+ { fieldName: "velocity", gauge: Gauge.VELOCITY_GAUGE, instrumentProperty: "va", dataType: "number", influxdbDataType: "floatField", gaugeType: GaugeTypes.INSTRUMENT_VELOCITY },
5093
+ {
5094
+ fieldName: "activeRequestCount",
5095
+ gauge: Gauge.ACTIVE_REQUEST_GAUGE,
5096
+ instrumentProperty: "val",
5097
+ dataType: "number",
5098
+ timeSeriesIndex: true,
5099
+ quantile: true,
5100
+ influxdbDataType: "intField",
5101
+ gaugeType: GaugeTypes.INSTRUMENT_GAUGE,
5102
+ instrumentOptions: {
5103
+ interval: instrumentationObservationInterval,
5104
+ sampleSize: instrumentationTimeWindow
5105
+ }
5106
+ },
5107
+ { fieldName: "coreCount", gauge: Gauge.CORE_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
5108
+ { fieldName: "rx", gauge: Gauge.NETWORK_RX_GAUGE, instrumentProperty: "va", dataType: "number", influxdbDataType: "floatField", gaugeType: GaugeTypes.INSTRUMENT_VELOCITY },
5109
+ { fieldName: "tx", gauge: Gauge.NETWORK_TX_GAUGE, instrumentProperty: "va", dataType: "number", influxdbDataType: "floatField", gaugeType: GaugeTypes.INSTRUMENT_VELOCITY },
5110
+ { fieldName: "timer", gauge: Gauge.TIMER_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "floatField", gaugeType: GaugeTypes.INSTRUMENT_TIMER },
5111
+ {
5112
+ fieldName: "duration",
5113
+ gauge: Gauge.DURATION_GAUGE,
5114
+ instrumentProperty: "val",
5115
+ dataType: "number",
5116
+ timeSeriesIndex: true,
5117
+ quantile: true,
5118
+ influxdbDataType: "floatField",
5119
+ gaugeType: GaugeTypes.INSTRUMENT_GAUGE,
5120
+ instrumentOptions: {
5121
+ interval: instrumentationObservationInterval,
5122
+ sampleSize: instrumentationTimeWindow
5123
+ },
5124
+ histo: [
5125
+ { label: "B10", bucketLimit: 10 },
5126
+ { label: "B20", bucketLimit: 20 },
5127
+ { label: "B50", bucketLimit: 50 },
5128
+ { label: "B100", bucketLimit: 100 },
5129
+ { label: "B1000", bucketLimit: 1e3 },
5130
+ { label: "B50000", bucketLimit: 5e4 },
5131
+ { label: "BInfinity", bucketLimit: -1 }
5132
+ ],
5133
+ histoGauge: Gauge.DURATION_HISTOGRAM_GAUGE
5134
+ },
5135
+ {
5136
+ fieldName: "latency",
5137
+ gauge: Gauge.LATENCY_GAUGE,
5138
+ instrumentProperty: "val",
5139
+ dataType: "number",
5140
+ timeSeriesIndex: true,
5141
+ quantile: true,
5142
+ influxdbDataType: "floatField",
5143
+ gaugeType: GaugeTypes.INSTRUMENT_GAUGE,
5144
+ instrumentOptions: {
5145
+ interval: instrumentationObservationInterval,
5146
+ sampleSize: instrumentationTimeWindow
5147
+ },
5148
+ histo: [
5149
+ { label: "B10", bucketLimit: 10 },
5150
+ { label: "B20", bucketLimit: 20 },
5151
+ { label: "B50", bucketLimit: 50 },
5152
+ { label: "B100", bucketLimit: 100 },
5153
+ { label: "B1000", bucketLimit: 1e3 },
5154
+ { label: "B50000", bucketLimit: 5e4 },
5155
+ { label: "BInfinity", bucketLimit: -1 }
5156
+ ],
5157
+ histoGauge: Gauge.LATENCY_HISTOGRAM_GAUGE
5158
+ }
5159
+ ],
5160
+ logFieldList: [
5161
+ {
5162
+ fieldName: "log",
5163
+ gauge: Gauge.LOGGER,
5164
+ instrumentProperty: "val",
5165
+ dataType: "string",
5166
+ timeSeriesIndex: false,
5167
+ quantile: false,
5168
+ influxdbDataType: "stringField",
5169
+ gaugeType: GaugeTypes.INSTRUMENT_LOG,
5170
+ instrumentOptions: {
5171
+ consoleLogging,
5172
+ instrumentLogging
5173
+ }
5174
+ }
5175
+ ],
5176
+ services: {
5177
+ ["service"]: {
5178
+ influxDBContextTags: [
5179
+ "serviceId",
5180
+ "serviceName",
5181
+ "serviceVersion",
5182
+ "serviceInstanceId",
5183
+ "serviceInstanceProcessId",
5184
+ "hostName",
5185
+ "pid",
5186
+ "ppid"
5187
+ ],
5188
+ redisIndexPrefixDefinitions: {
5189
+ timeSeriesIndex: "idx:serviceIndexTimeSeries",
5190
+ timeSeriesPrefix: "/serviceTimeSeries:",
5191
+ instantIndex: "idx:serviceIndexInstant",
5192
+ instantPrefix: "/serviceInstant:"
5193
+ },
5194
+ fieldList: [
5195
+ {
5196
+ fieldName: "cpu",
5197
+ gauge: Gauge.CPU_LOAD_GAUGE,
5198
+ instrumentProperty: "val",
5199
+ dataType: "number",
5200
+ timeSeriesIndex: true,
5201
+ quantile: true,
5202
+ influxdbDataType: "floatField",
5203
+ gaugeType: GaugeTypes.INSTRUMENT_GAUGE,
5204
+ instrumentOptions: {
5205
+ interval: instrumentationObservationInterval,
5206
+ sampleSize: instrumentationTimeWindow
5207
+ }
5208
+ },
5209
+ {
5210
+ fieldName: "connectionCount",
5211
+ gauge: Gauge.CONNECTION_COUNT_GAUGE,
5212
+ instrumentProperty: "val",
5213
+ dataType: "number",
5214
+ timeSeriesIndex: true,
5215
+ quantile: true,
5216
+ influxdbDataType: "intField",
5217
+ gaugeType: GaugeTypes.INSTRUMENT_GAUGE,
5218
+ instrumentOptions: {
5219
+ interval: instrumentationObservationInterval,
5220
+ sampleSize: instrumentationTimeWindow
5221
+ }
5222
+ },
5223
+ { fieldName: "connectionPoolCount", gauge: Gauge.CONNECTION_POOL_TOTAL_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
5224
+ { fieldName: "connectionIdleCount", gauge: Gauge.CONNECTION_POOL_IDLE_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
5225
+ { fieldName: "connectionWaitingCount", gauge: Gauge.CONNECTION_POOL_WAITING_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
5226
+ { fieldName: "systemcpu", gauge: Gauge.CPU_SYSTEM_LOAD_GAUGE, instrumentProperty: "val", dataType: "number", timeSeriesIndex: true, quantile: true, influxdbDataType: "floatField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
5227
+ {
5228
+ fieldName: "memory",
5229
+ gauge: Gauge.OBJECT_GAUGE,
5230
+ instrumentProperty: "val",
5231
+ dataType: "JSON",
5232
+ influxdbDataType: "stringField",
5233
+ gaugeType: GaugeTypes.INSTRUMENT_OBJECT,
5234
+ instrumentOptions: {
5235
+ label: "InstrumentObjectMaster"
5236
+ }
5237
+ }
5238
+ ],
5239
+ GetPathFromContext(context) {
5240
+ const { serviceId, serviceInstanceId, serviceInstanceProcessId } = context;
5241
+ return `/${serviceId}/${serviceInstanceId}/${serviceInstanceProcessId}`;
5242
+ },
5243
+ redisQueryFilters: {
5244
+ level1ContextField: "serviceType",
5245
+ level2ContextField: "appid",
5246
+ level3ContextField: "appinstanceid"
5247
+ },
5248
+ subscriptionTopics: [
5249
+ {
5250
+ subscriptionTopic: SubscriptionTopic.AllServicesCombined,
5251
+ route: "/metrics"
5252
+ },
5253
+ {
5254
+ subscriptionTopic: SubscriptionTopic.Services,
5255
+ route: "/metrics/services"
5256
+ },
5257
+ {
5258
+ subscriptionTopic: SubscriptionTopic.ServiceInstances,
5259
+ route: "/metrics/services/:key"
5260
+ },
5261
+ {
5262
+ subscriptionTopic: SubscriptionTopic.ServiceInstance,
5263
+ route: "/metrics/services/:key/:subkey"
5264
+ }
5265
+ ]
5266
+ },
5267
+ ["agent"]: {
5268
+ influxDBContextTags: [
5269
+ "id",
5270
+ "hostName",
5271
+ "agentName",
5272
+ "threadId",
5273
+ "asyncRunnerId"
5274
+ ],
5275
+ redisIndexPrefixDefinitions: {
5276
+ timeSeriesIndex: "idx:agentIndexTimeSeries",
5277
+ timeSeriesPrefix: "/agentTimeSeries:",
5278
+ instantIndex: "idx:agentIndexInstant",
5279
+ instantPrefix: "/agentInstant:"
5280
+ },
5281
+ fieldList: [
5282
+ { fieldName: "childCount", gauge: Gauge.CHILD_COUNT, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE }
5283
+ ],
5284
+ //@@ need type declare in appframework ?? agent does not use appframework ... perhaps stspublisher
5285
+ GetPathFromContext(context) {
5286
+ const { agentName, threadId, asyncRunnerId } = context;
5287
+ return `/${agentName}/${threadId}/${asyncRunnerId}`;
5288
+ },
5289
+ redisQueryFilters: {
5290
+ level1ContextField: "serviceType",
5291
+ level2ContextField: "appid",
5292
+ //@@ this should be named something else
5293
+ level3ContextField: "appinstanceid"
5294
+ //@@ this should be named something else
5295
+ },
5296
+ subscriptionTopics: [
5297
+ {
5298
+ subscriptionTopic: SubscriptionTopic.AllAgentsCombined,
5299
+ route: "/metrics"
5300
+ },
5301
+ {
5302
+ subscriptionTopic: SubscriptionTopic.Agents,
5303
+ route: "/metrics/agents"
5304
+ },
5305
+ {
5306
+ subscriptionTopic: SubscriptionTopic.AgentWorkers,
5307
+ route: "/metrics/agents/:key"
5308
+ },
5309
+ {
5310
+ subscriptionTopic: SubscriptionTopic.AgentWorker,
5311
+ route: "/metrics/agents/:key/:subkey"
5312
+ }
5313
+ ]
5314
+ },
5315
+ ["lambda"]: {
5316
+ influxDBContextTags: [
5317
+ "technology",
5318
+ "subTechnology",
5319
+ "lambdaFunctionName",
5320
+ "lambdaInstance",
5321
+ "hostName",
5322
+ "processId",
5323
+ "parentProcessId",
5324
+ "useCase",
5325
+ "pattern"
5326
+ ],
5327
+ redisIndexPrefixDefinitions: {
5328
+ timeSeriesIndex: "idx:lambdaIndexTimeSeries",
5329
+ timeSeriesPrefix: "/lambdaTimeSeries:",
5330
+ instantIndex: "idx:lambdaIndexInstant",
5331
+ instantPrefix: "/lambdaInstant:"
5332
+ },
5333
+ fieldList: [
5334
+ { fieldName: "cpu", gauge: Gauge.CPU_LOAD_GAUGE, instrumentProperty: "val", dataType: "number", timeSeriesIndex: true, quantile: true, influxdbDataType: "floatField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
5335
+ { fieldName: "connectionCount", gauge: Gauge.CONNECTION_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", timeSeriesIndex: true, quantile: true, influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
5336
+ { fieldName: "connectionPoolCount", gauge: Gauge.CONNECTION_POOL_TOTAL_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
5337
+ { fieldName: "connectionIdleCount", gauge: Gauge.CONNECTION_POOL_IDLE_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
5338
+ { fieldName: "connectionWaitingCount", gauge: Gauge.CONNECTION_POOL_WAITING_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
5339
+ { fieldName: "systemcpu", gauge: Gauge.CPU_SYSTEM_LOAD_GAUGE, instrumentProperty: "val", dataType: "number", timeSeriesIndex: true, quantile: true, influxdbDataType: "floatField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
5340
+ { fieldName: "memory", gauge: Gauge.OBJECT_GAUGE, instrumentProperty: "val", dataType: "JSON", influxdbDataType: "stringField", gaugeType: GaugeTypes.INSTRUMENT_OBJECT }
5341
+ ],
5342
+ //@@ need type declare in appframework
5343
+ GetPathFromContext(context) {
5344
+ const { technology, subTechnology, lambdaInstance } = context;
5345
+ return `/${technology}/${subTechnology}/${lambdaInstance}`;
5346
+ },
5347
+ redisQueryFilters: {
5348
+ level1ContextField: "serviceType",
5349
+ level2ContextField: "technology",
5350
+ level3ContextField: "subTechnology"
5351
+ },
5352
+ subscriptionTopics: [
5353
+ {
5354
+ subscriptionTopic: SubscriptionTopic.AllLambdasCombined,
5355
+ // uicontrollerlanding
5356
+ route: "/metrics"
5357
+ },
5358
+ {
5359
+ subscriptionTopic: SubscriptionTopic.LambdaTechnologies,
5360
+ // uicontrollerlambda
5361
+ route: "/metrics/lambdas"
5362
+ },
5363
+ {
5364
+ subscriptionTopic: SubscriptionTopic.LambdaSubTechnologies,
5365
+ // uicontrollerlambdasubtechnologies
5366
+ route: "/metrics/lambdas/:key"
5367
+ },
5368
+ {
5369
+ subscriptionTopic: SubscriptionTopic.LambdaSubTechnologiesInstance,
5370
+ // uicontrollerlambdasubtechnologiesinstance
5371
+ route: "/metrics/lambdas/:key/:subkey"
5372
+ }
5373
+ ]
5374
+ }
5375
+ }
5376
+ };
5377
+ const GetInstruments = (service) => {
5378
+ const fieldList = [
5379
+ ...globalServiceDefinitions.coreFieldList,
5380
+ ...globalServiceDefinitions.logFieldList,
5381
+ ...globalServiceDefinitions.services[service].fieldList
5382
+ ];
5383
+ const retVal = [];
5384
+ fieldList.forEach((v) => {
5385
+ if (v.instrumentOptions) {
5386
+ retVal.push([v.gauge, v.gaugeType, v.instrumentOptions]);
5387
+ } else {
5388
+ retVal.push([v.gauge, v.gaugeType]);
5389
+ }
5390
+ if (v.histo) {
5391
+ retVal.push([v.histoGauge, GaugeTypes.INSTRUMENT_HISTOGRAM]);
5392
+ }
5393
+ });
5394
+ return retVal;
5395
+ };
5074
5396
  const _ObservabilityModelUtils = class _ObservabilityModelUtils {
5075
5397
  static GetModelNode(data) {
5076
5398
  const fixedSize = 2;
@@ -5169,6 +5491,25 @@ const _ObservabilityModelUtils = class _ObservabilityModelUtils {
5169
5491
  };
5170
5492
  }
5171
5493
  }
5494
+ static GetModelData(serviceType, model, data, parseLog) {
5495
+ const fieldList = [
5496
+ ...globalServiceDefinitions.coreFieldList,
5497
+ ...globalServiceDefinitions.services[serviceType].fieldList
5498
+ ];
5499
+ fieldList.forEach((field) => {
5500
+ if (field.quantile) {
5501
+ _ObservabilityModelUtils.ParseModelNodeWithQuantile(model, data, parseLog, field.gauge, field.fieldName, `${field.fieldName}_quantile`);
5502
+ } else if (field.histo) {
5503
+ console.log(`ParseModelNodeHisto ...............................`);
5504
+ _ObservabilityModelUtils.ParseModelNodeHisto(model, data, parseLog, field.histoGauge, `${field.fieldName}_histo`);
5505
+ console.log(`ParseModelNodeHisto Completed ...............................`);
5506
+ } else if (field.gaugeType.localeCompare(GaugeTypes.INSTRUMENT_OBJECT) === 0) {
5507
+ _ObservabilityModelUtils.ParseModelNodeObject(model, data, parseLog, field.gauge, field.fieldName);
5508
+ } else {
5509
+ _ObservabilityModelUtils.ParseModelNode(model, data, parseLog, field.gauge, field.fieldName);
5510
+ }
5511
+ });
5512
+ }
5172
5513
  static GetModelForService(id, data, subscribeToKafka, logger) {
5173
5514
  try {
5174
5515
  const parseLog = [];
@@ -5176,29 +5517,7 @@ const _ObservabilityModelUtils = class _ObservabilityModelUtils {
5176
5517
  id,
5177
5518
  instruments: {}
5178
5519
  };
5179
- _ObservabilityModelUtils.ParseModelNode(model, data, parseLog, Gauge.REQUEST_COUNT_GAUGE, "requestCount");
5180
- _ObservabilityModelUtils.ParseModelNode(model, data, parseLog, Gauge.ERROR_COUNT_GAUGE, "errorCount");
5181
- _ObservabilityModelUtils.ParseModelNode(model, data, parseLog, Gauge.RETRY_COUNT_GAUGE, "retryCount");
5182
- _ObservabilityModelUtils.ParseModelNode(model, data, parseLog, Gauge.AUTHENTICATION_COUNT_GAUGE, "authenticationCount");
5183
- _ObservabilityModelUtils.ParseModelNode(model, data, parseLog, Gauge.AUTHENTICATION_ERROR_COUNT_GAUGE, "authenticationErrorCount");
5184
- _ObservabilityModelUtils.ParseModelNode(model, data, parseLog, Gauge.AUTHENTICATION_RETRY_COUNT_GAUGE, "authenticationRetryCount");
5185
- _ObservabilityModelUtils.ParseModelNode(model, data, parseLog, Gauge.VELOCITY_GAUGE, "velocity");
5186
- _ObservabilityModelUtils.ParseModelNode(model, data, parseLog, Gauge.ACTIVE_REQUEST_GAUGE, "activeRequestCount");
5187
- _ObservabilityModelUtils.ParseModelNode(model, data, parseLog, Gauge.CONNECTION_COUNT_GAUGE, "connectionCount");
5188
- _ObservabilityModelUtils.ParseModelNode(model, data, parseLog, Gauge.CONNECTION_POOL_TOTAL_GAUGE, "connectionPoolCount");
5189
- _ObservabilityModelUtils.ParseModelNode(model, data, parseLog, Gauge.CONNECTION_POOL_IDLE_GAUGE, "connectionIdleCount");
5190
- _ObservabilityModelUtils.ParseModelNode(model, data, parseLog, Gauge.CONNECTION_POOL_WAITING_GAUGE, "connectionWaitingCount");
5191
- _ObservabilityModelUtils.ParseModelNode(model, data, parseLog, Gauge.CORE_COUNT_GAUGE, "coreCount");
5192
- _ObservabilityModelUtils.ParseModelNode(model, data, parseLog, Gauge.TIMER_GAUGE, "timer");
5193
- _ObservabilityModelUtils.ParseModelNode(model, data, parseLog, Gauge.NETWORK_RX_GAUGE, "rx");
5194
- _ObservabilityModelUtils.ParseModelNode(model, data, parseLog, Gauge.NETWORK_TX_GAUGE, "tx");
5195
- _ObservabilityModelUtils.ParseModelNodeWithQuantile(model, data, parseLog, Gauge.CPU_LOAD_GAUGE, "cpu", "cpu_quantile");
5196
- _ObservabilityModelUtils.ParseModelNodeWithQuantile(model, data, parseLog, Gauge.CPU_SYSTEM_LOAD_GAUGE, "systemcpu", "systemcpu_quantile");
5197
- _ObservabilityModelUtils.ParseModelNodeWithQuantile(model, data, parseLog, Gauge.DURATION_GAUGE, "duration", "duration_quantile");
5198
- _ObservabilityModelUtils.ParseModelNodeWithQuantile(model, data, parseLog, Gauge.LATENCY_GAUGE, "latency", "latency_quantile");
5199
- _ObservabilityModelUtils.ParseModelNodeHisto(model, data, parseLog, Gauge.DURATION_HISTOGRAM_GAUGE, "duration_histo");
5200
- _ObservabilityModelUtils.ParseModelNodeHisto(model, data, parseLog, Gauge.LATENCY_HISTOGRAM_GAUGE, "latency_histo");
5201
- _ObservabilityModelUtils.ParseModelNodeObject(model, data, parseLog, Gauge.OBJECT_GAUGE, "memory");
5520
+ this.GetModelData("service", model, data, parseLog);
5202
5521
  if (!subscribeToKafka) {
5203
5522
  model.instruments[Gauge.LOGGER] = _ObservabilityModelUtils.GetModelNodeRawStringArray(data["logMessages"]);
5204
5523
  }
@@ -5217,29 +5536,7 @@ const _ObservabilityModelUtils = class _ObservabilityModelUtils {
5217
5536
  id,
5218
5537
  instruments: {}
5219
5538
  };
5220
- _ObservabilityModelUtils.ParseModelNode(model, data, parseLog, Gauge.REQUEST_COUNT_GAUGE, "requestCount");
5221
- _ObservabilityModelUtils.ParseModelNode(model, data, parseLog, Gauge.ERROR_COUNT_GAUGE, "errorCount");
5222
- _ObservabilityModelUtils.ParseModelNode(model, data, parseLog, Gauge.RETRY_COUNT_GAUGE, "retryCount");
5223
- _ObservabilityModelUtils.ParseModelNode(model, data, parseLog, Gauge.AUTHENTICATION_COUNT_GAUGE, "authenticationCount");
5224
- _ObservabilityModelUtils.ParseModelNode(model, data, parseLog, Gauge.AUTHENTICATION_ERROR_COUNT_GAUGE, "authenticationErrorCount");
5225
- _ObservabilityModelUtils.ParseModelNode(model, data, parseLog, Gauge.AUTHENTICATION_RETRY_COUNT_GAUGE, "authenticationRetryCount");
5226
- _ObservabilityModelUtils.ParseModelNode(model, data, parseLog, Gauge.VELOCITY_GAUGE, "velocity");
5227
- _ObservabilityModelUtils.ParseModelNode(model, data, parseLog, Gauge.ACTIVE_REQUEST_GAUGE, "activeRequestCount");
5228
- _ObservabilityModelUtils.ParseModelNode(model, data, parseLog, Gauge.CONNECTION_COUNT_GAUGE, "connectionCount");
5229
- _ObservabilityModelUtils.ParseModelNode(model, data, parseLog, Gauge.CONNECTION_POOL_TOTAL_GAUGE, "connectionPoolCount");
5230
- _ObservabilityModelUtils.ParseModelNode(model, data, parseLog, Gauge.CONNECTION_POOL_IDLE_GAUGE, "connectionIdleCount");
5231
- _ObservabilityModelUtils.ParseModelNode(model, data, parseLog, Gauge.CONNECTION_POOL_WAITING_GAUGE, "connectionWaitingCount");
5232
- _ObservabilityModelUtils.ParseModelNode(model, data, parseLog, Gauge.CORE_COUNT_GAUGE, "coreCount");
5233
- _ObservabilityModelUtils.ParseModelNode(model, data, parseLog, Gauge.TIMER_GAUGE, "timer");
5234
- _ObservabilityModelUtils.ParseModelNode(model, data, parseLog, Gauge.NETWORK_RX_GAUGE, "rx");
5235
- _ObservabilityModelUtils.ParseModelNode(model, data, parseLog, Gauge.NETWORK_TX_GAUGE, "tx");
5236
- _ObservabilityModelUtils.ParseModelNodeWithQuantile(model, data, parseLog, Gauge.CPU_LOAD_GAUGE, "cpu", "cpu_quantile");
5237
- _ObservabilityModelUtils.ParseModelNodeWithQuantile(model, data, parseLog, Gauge.CPU_SYSTEM_LOAD_GAUGE, "systemcpu", "systemcpu_quantile");
5238
- _ObservabilityModelUtils.ParseModelNodeWithQuantile(model, data, parseLog, Gauge.DURATION_GAUGE, "duration", "duration_quantile");
5239
- _ObservabilityModelUtils.ParseModelNodeWithQuantile(model, data, parseLog, Gauge.LATENCY_GAUGE, "latency", "latency_quantile");
5240
- _ObservabilityModelUtils.ParseModelNodeHisto(model, data, parseLog, Gauge.DURATION_HISTOGRAM_GAUGE, "duration_histo");
5241
- _ObservabilityModelUtils.ParseModelNodeHisto(model, data, parseLog, Gauge.LATENCY_HISTOGRAM_GAUGE, "latency_histo");
5242
- _ObservabilityModelUtils.ParseModelNodeObject(model, data, parseLog, Gauge.OBJECT_GAUGE, "memory");
5539
+ this.GetModelData("lambda", model, data, parseLog);
5243
5540
  if (!subscribeToKafka) {
5244
5541
  model.instruments[Gauge.LOGGER] = _ObservabilityModelUtils.GetModelNodeRawStringArray(data["logMessages"]);
5245
5542
  }
@@ -5261,22 +5558,7 @@ const _ObservabilityModelUtils = class _ObservabilityModelUtils {
5261
5558
  id,
5262
5559
  instruments: {}
5263
5560
  };
5264
- _ObservabilityModelUtils.ParseModelNode(model, data, parseLog, Gauge.REQUEST_COUNT_GAUGE, "requestCount");
5265
- _ObservabilityModelUtils.ParseModelNode(model, data, parseLog, Gauge.ERROR_COUNT_GAUGE, "errorCount");
5266
- _ObservabilityModelUtils.ParseModelNode(model, data, parseLog, Gauge.RETRY_COUNT_GAUGE, "retryCount");
5267
- _ObservabilityModelUtils.ParseModelNode(model, data, parseLog, Gauge.AUTHENTICATION_COUNT_GAUGE, "authenticationCount");
5268
- _ObservabilityModelUtils.ParseModelNode(model, data, parseLog, Gauge.AUTHENTICATION_ERROR_COUNT_GAUGE, "authenticationErrorCount");
5269
- _ObservabilityModelUtils.ParseModelNode(model, data, parseLog, Gauge.AUTHENTICATION_RETRY_COUNT_GAUGE, "authenticationRetryCount");
5270
- _ObservabilityModelUtils.ParseModelNode(model, data, parseLog, Gauge.VELOCITY_GAUGE, "velocity");
5271
- _ObservabilityModelUtils.ParseModelNode(model, data, parseLog, Gauge.CORE_COUNT_GAUGE, "coreCount");
5272
- _ObservabilityModelUtils.ParseModelNode(model, data, parseLog, Gauge.TIMER_GAUGE, "timer");
5273
- _ObservabilityModelUtils.ParseModelNode(model, data, parseLog, Gauge.ACTIVE_REQUEST_GAUGE, "activeRequestCount");
5274
- _ObservabilityModelUtils.ParseModelNode(model, data, parseLog, Gauge.NETWORK_RX_GAUGE, "rx");
5275
- _ObservabilityModelUtils.ParseModelNode(model, data, parseLog, Gauge.NETWORK_TX_GAUGE, "tx");
5276
- _ObservabilityModelUtils.ParseModelNodeWithQuantile(model, data, parseLog, Gauge.DURATION_GAUGE, "duration", "duration_quantile");
5277
- _ObservabilityModelUtils.ParseModelNodeWithQuantile(model, data, parseLog, Gauge.LATENCY_GAUGE, "latency", "latency_quantile");
5278
- _ObservabilityModelUtils.ParseModelNodeHisto(model, data, parseLog, Gauge.DURATION_HISTOGRAM_GAUGE, "duration_histo");
5279
- _ObservabilityModelUtils.ParseModelNodeHisto(model, data, parseLog, Gauge.LATENCY_HISTOGRAM_GAUGE, "latency_histo");
5561
+ this.GetModelData("agent", model, data, parseLog);
5280
5562
  if (!subscribeToKafka) {
5281
5563
  model.instruments[Gauge.LOGGER] = _ObservabilityModelUtils.GetModelNodeRawStringArray(data["logMessages"]);
5282
5564
  }
@@ -6480,383 +6762,61 @@ EstablishSocketConnect_fn = function(name, onConnectCallBack, socketEventsCallBa
6480
6762
  socketDetail.socket = io(socketDetail.address, socketOptions);
6481
6763
  socketDetail.socket.on("connect", () => {
6482
6764
  if (socketDetail.socket) {
6483
- __privateMethod(this, _LogDebugMessage5, LogDebugMessage_fn5).call(this, `Socket: [${socketDetail.socket.id}]: connected`);
6484
- if (onConnectCallBack) {
6485
- setTimeout(() => {
6486
- onConnectCallBack(socketDetail.socket);
6487
- }, 0);
6488
- }
6489
- if (socketEventsCallBack) {
6490
- socketEventsCallBack(socketDetail.socket);
6491
- }
6492
- } else {
6493
- const errorMessage = "Could not get socket object from socket.io";
6494
- __privateMethod(this, _LogErrorMessage4, LogErrorMessage_fn4).call(this, errorMessage);
6495
- socketDetail.errorCallBack(new Error(errorMessage));
6496
- }
6497
- });
6498
- socketDetail.socket.on("disconnect", (reason) => {
6499
- __privateMethod(this, _LogDebugMessage5, LogDebugMessage_fn5).call(this, "socket disconnect: " + reason);
6500
- switch (reason) {
6501
- case "io server disconnect":
6502
- {
6503
- __privateMethod(this, _LogDebugMessage5, LogDebugMessage_fn5).call(this, "The server disconnected using disconnectSockets, i.e. normal safe shutdown from explicit disconnection by the server.");
6504
- __privateMethod(this, _LogDebugMessage5, LogDebugMessage_fn5).call(this, "The connection will be re-established when the server becomes available.");
6505
- const socketDetail2 = this.sockets[name];
6506
- socketDetail2.socket = null;
6507
- if (isNode) {
6508
- setTimeout(() => __privateMethod(this, _EstablishSocketConnect, EstablishSocketConnect_fn).call(this, name, onConnectCallBack, socketEventsCallBack), 100).unref();
6509
- } else {
6510
- setTimeout(() => __privateMethod(this, _EstablishSocketConnect, EstablishSocketConnect_fn).call(this, name, onConnectCallBack, socketEventsCallBack), 100);
6511
- }
6512
- }
6513
- break;
6514
- case "io client disconnect":
6515
- __privateMethod(this, _LogDebugMessage5, LogDebugMessage_fn5).call(this, "The client disconnected using disconnectSockets, i.e. normal safe disconnection from explicit disconnection by the client.");
6516
- __privateMethod(this, _LogDebugMessage5, LogDebugMessage_fn5).call(this, "The connection will not be re-established automatically.");
6517
- break;
6518
- case "transport close":
6519
- case "ping timeout":
6520
- case "transport error":
6521
- {
6522
- __privateMethod(this, _LogDebugMessage5, LogDebugMessage_fn5).call(this, `Server unexpectedly disconnected. Reason: [${reason}]`);
6523
- __privateMethod(this, _LogDebugMessage5, LogDebugMessage_fn5).call(this, "The connection will be re-established when the server becomes available.");
6524
- const socketDetail2 = this.sockets[name];
6525
- if (socketDetail2.socket) {
6526
- socketDetail2.socket.disconnect();
6527
- }
6528
- socketDetail2.socket = null;
6529
- if (isNode) {
6530
- setTimeout(() => __privateMethod(this, _EstablishSocketConnect, EstablishSocketConnect_fn).call(this, name, onConnectCallBack, socketEventsCallBack), 100).unref();
6531
- } else {
6532
- setTimeout(() => __privateMethod(this, _EstablishSocketConnect, EstablishSocketConnect_fn).call(this, name, onConnectCallBack, socketEventsCallBack), 100);
6533
- }
6534
- }
6535
- break;
6536
- }
6537
- });
6538
- };
6539
- var influxDBDataType = /* @__PURE__ */ ((influxDBDataType2) => {
6540
- influxDBDataType2["intField"] = "intField";
6541
- influxDBDataType2["floatField"] = "floatField";
6542
- influxDBDataType2["stringField"] = "stringField";
6543
- return influxDBDataType2;
6544
- })(influxDBDataType || {});
6545
- const instrumentationObservationInterval = 1e3;
6546
- const instrumentationTimeWindow = 600;
6547
- const consoleLogging = true;
6548
- const instrumentLogging = true;
6549
- const globalServiceDefinitions = {
6550
- coreFieldList: [
6551
- { fieldName: "requestCount", gauge: Gauge.REQUEST_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
6552
- { fieldName: "errorCount", gauge: Gauge.ERROR_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
6553
- { fieldName: "retryCount", gauge: Gauge.RETRY_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
6554
- { fieldName: "authenticationCount", gauge: Gauge.AUTHENTICATION_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
6555
- { fieldName: "authenticationErrorCount", gauge: Gauge.AUTHENTICATION_ERROR_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
6556
- { fieldName: "authenticationRetryCount", gauge: Gauge.AUTHENTICATION_RETRY_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
6557
- { fieldName: "velocity", gauge: Gauge.VELOCITY_GAUGE, instrumentProperty: "va", dataType: "number", influxdbDataType: "floatField", gaugeType: GaugeTypes.INSTRUMENT_VELOCITY },
6558
- {
6559
- fieldName: "activeRequestCount",
6560
- gauge: Gauge.ACTIVE_REQUEST_GAUGE,
6561
- instrumentProperty: "val",
6562
- dataType: "number",
6563
- timeSeriesIndex: true,
6564
- quantile: true,
6565
- influxdbDataType: "intField",
6566
- gaugeType: GaugeTypes.INSTRUMENT_GAUGE,
6567
- instrumentOptions: {
6568
- interval: instrumentationObservationInterval,
6569
- sampleSize: instrumentationTimeWindow
6570
- }
6571
- },
6572
- { fieldName: "coreCount", gauge: Gauge.CORE_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
6573
- { fieldName: "rx", gauge: Gauge.NETWORK_RX_GAUGE, instrumentProperty: "va", dataType: "number", influxdbDataType: "floatField", gaugeType: GaugeTypes.INSTRUMENT_VELOCITY },
6574
- { fieldName: "tx", gauge: Gauge.NETWORK_TX_GAUGE, instrumentProperty: "va", dataType: "number", influxdbDataType: "floatField", gaugeType: GaugeTypes.INSTRUMENT_VELOCITY },
6575
- { fieldName: "timer", gauge: Gauge.TIMER_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "floatField", gaugeType: GaugeTypes.INSTRUMENT_TIMER },
6576
- {
6577
- fieldName: "duration",
6578
- gauge: Gauge.DURATION_GAUGE,
6579
- instrumentProperty: "val",
6580
- dataType: "number",
6581
- timeSeriesIndex: true,
6582
- quantile: true,
6583
- influxdbDataType: "floatField",
6584
- gaugeType: GaugeTypes.INSTRUMENT_GAUGE,
6585
- instrumentOptions: {
6586
- interval: instrumentationObservationInterval,
6587
- sampleSize: instrumentationTimeWindow
6588
- },
6589
- histo: [
6590
- { label: "B10", bucketLimit: 10 },
6591
- { label: "B20", bucketLimit: 20 },
6592
- { label: "B50", bucketLimit: 50 },
6593
- { label: "B100", bucketLimit: 100 },
6594
- { label: "B1000", bucketLimit: 1e3 },
6595
- { label: "B50000", bucketLimit: 5e4 },
6596
- { label: "BInfinity", bucketLimit: -1 }
6597
- ],
6598
- histoGaugeType: Gauge.DURATION_HISTOGRAM_GAUGE
6599
- },
6600
- {
6601
- fieldName: "latency",
6602
- gauge: Gauge.LATENCY_GAUGE,
6603
- instrumentProperty: "val",
6604
- dataType: "number",
6605
- timeSeriesIndex: true,
6606
- quantile: true,
6607
- influxdbDataType: "floatField",
6608
- gaugeType: GaugeTypes.INSTRUMENT_GAUGE,
6609
- instrumentOptions: {
6610
- interval: instrumentationObservationInterval,
6611
- sampleSize: instrumentationTimeWindow
6612
- },
6613
- histo: [
6614
- { label: "B10", bucketLimit: 10 },
6615
- { label: "B20", bucketLimit: 20 },
6616
- { label: "B50", bucketLimit: 50 },
6617
- { label: "B100", bucketLimit: 100 },
6618
- { label: "B1000", bucketLimit: 1e3 },
6619
- { label: "B50000", bucketLimit: 5e4 },
6620
- { label: "BInfinity", bucketLimit: -1 }
6621
- ],
6622
- histoGaugeType: Gauge.LATENCY_HISTOGRAM_GAUGE
6623
- }
6624
- ],
6625
- logFieldList: [
6626
- {
6627
- fieldName: "log",
6628
- gauge: Gauge.LOGGER,
6629
- instrumentProperty: "val",
6630
- dataType: "string",
6631
- timeSeriesIndex: false,
6632
- quantile: false,
6633
- influxdbDataType: "stringField",
6634
- gaugeType: GaugeTypes.INSTRUMENT_LOG,
6635
- instrumentOptions: {
6636
- consoleLogging,
6637
- instrumentLogging
6765
+ __privateMethod(this, _LogDebugMessage5, LogDebugMessage_fn5).call(this, `Socket: [${socketDetail.socket.id}]: connected`);
6766
+ if (onConnectCallBack) {
6767
+ setTimeout(() => {
6768
+ onConnectCallBack(socketDetail.socket);
6769
+ }, 0);
6770
+ }
6771
+ if (socketEventsCallBack) {
6772
+ socketEventsCallBack(socketDetail.socket);
6638
6773
  }
6774
+ } else {
6775
+ const errorMessage = "Could not get socket object from socket.io";
6776
+ __privateMethod(this, _LogErrorMessage4, LogErrorMessage_fn4).call(this, errorMessage);
6777
+ socketDetail.errorCallBack(new Error(errorMessage));
6639
6778
  }
6640
- ],
6641
- services: {
6642
- ["service"]: {
6643
- influxDBContextTags: [
6644
- "serviceId",
6645
- "serviceName",
6646
- "serviceVersion",
6647
- "serviceInstanceId",
6648
- "serviceInstanceProcessId",
6649
- "hostName",
6650
- "pid",
6651
- "ppid"
6652
- ],
6653
- redisIndexPrefixDefinitions: {
6654
- timeSeriesIndex: "idx:serviceIndexTimeSeries",
6655
- timeSeriesPrefix: "/serviceTimeSeries:",
6656
- instantIndex: "idx:serviceIndexInstant",
6657
- instantPrefix: "/serviceInstant:"
6658
- },
6659
- fieldList: [
6779
+ });
6780
+ socketDetail.socket.on("disconnect", (reason) => {
6781
+ __privateMethod(this, _LogDebugMessage5, LogDebugMessage_fn5).call(this, "socket disconnect: " + reason);
6782
+ switch (reason) {
6783
+ case "io server disconnect":
6660
6784
  {
6661
- fieldName: "cpu",
6662
- gauge: Gauge.CPU_LOAD_GAUGE,
6663
- instrumentProperty: "val",
6664
- dataType: "number",
6665
- timeSeriesIndex: true,
6666
- quantile: true,
6667
- influxdbDataType: "floatField",
6668
- gaugeType: GaugeTypes.INSTRUMENT_GAUGE,
6669
- instrumentOptions: {
6670
- interval: instrumentationObservationInterval,
6671
- sampleSize: instrumentationTimeWindow
6785
+ __privateMethod(this, _LogDebugMessage5, LogDebugMessage_fn5).call(this, "The server disconnected using disconnectSockets, i.e. normal safe shutdown from explicit disconnection by the server.");
6786
+ __privateMethod(this, _LogDebugMessage5, LogDebugMessage_fn5).call(this, "The connection will be re-established when the server becomes available.");
6787
+ const socketDetail2 = this.sockets[name];
6788
+ socketDetail2.socket = null;
6789
+ if (isNode) {
6790
+ setTimeout(() => __privateMethod(this, _EstablishSocketConnect, EstablishSocketConnect_fn).call(this, name, onConnectCallBack, socketEventsCallBack), 100).unref();
6791
+ } else {
6792
+ setTimeout(() => __privateMethod(this, _EstablishSocketConnect, EstablishSocketConnect_fn).call(this, name, onConnectCallBack, socketEventsCallBack), 100);
6672
6793
  }
6673
- },
6794
+ }
6795
+ break;
6796
+ case "io client disconnect":
6797
+ __privateMethod(this, _LogDebugMessage5, LogDebugMessage_fn5).call(this, "The client disconnected using disconnectSockets, i.e. normal safe disconnection from explicit disconnection by the client.");
6798
+ __privateMethod(this, _LogDebugMessage5, LogDebugMessage_fn5).call(this, "The connection will not be re-established automatically.");
6799
+ break;
6800
+ case "transport close":
6801
+ case "ping timeout":
6802
+ case "transport error":
6674
6803
  {
6675
- fieldName: "connectionCount",
6676
- gauge: Gauge.CONNECTION_COUNT_GAUGE,
6677
- instrumentProperty: "val",
6678
- dataType: "number",
6679
- timeSeriesIndex: true,
6680
- quantile: true,
6681
- influxdbDataType: "intField",
6682
- gaugeType: GaugeTypes.INSTRUMENT_GAUGE,
6683
- instrumentOptions: {
6684
- interval: instrumentationObservationInterval,
6685
- sampleSize: instrumentationTimeWindow
6804
+ __privateMethod(this, _LogDebugMessage5, LogDebugMessage_fn5).call(this, `Server unexpectedly disconnected. Reason: [${reason}]`);
6805
+ __privateMethod(this, _LogDebugMessage5, LogDebugMessage_fn5).call(this, "The connection will be re-established when the server becomes available.");
6806
+ const socketDetail2 = this.sockets[name];
6807
+ if (socketDetail2.socket) {
6808
+ socketDetail2.socket.disconnect();
6686
6809
  }
6687
- },
6688
- { fieldName: "connectionPoolCount", gauge: Gauge.CONNECTION_POOL_TOTAL_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
6689
- { fieldName: "connectionIdleCount", gauge: Gauge.CONNECTION_POOL_IDLE_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
6690
- { fieldName: "connectionWaitingCount", gauge: Gauge.CONNECTION_POOL_WAITING_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
6691
- { fieldName: "systemcpu", gauge: Gauge.CPU_SYSTEM_LOAD_GAUGE, instrumentProperty: "val", dataType: "number", timeSeriesIndex: true, quantile: true, influxdbDataType: "floatField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
6692
- {
6693
- fieldName: "memory",
6694
- gauge: Gauge.OBJECT_GAUGE,
6695
- instrumentProperty: "val",
6696
- dataType: "JSON",
6697
- influxdbDataType: "stringField",
6698
- gaugeType: GaugeTypes.INSTRUMENT_OBJECT,
6699
- instrumentOptions: {
6700
- label: "InstrumentObjectMaster"
6810
+ socketDetail2.socket = null;
6811
+ if (isNode) {
6812
+ setTimeout(() => __privateMethod(this, _EstablishSocketConnect, EstablishSocketConnect_fn).call(this, name, onConnectCallBack, socketEventsCallBack), 100).unref();
6813
+ } else {
6814
+ setTimeout(() => __privateMethod(this, _EstablishSocketConnect, EstablishSocketConnect_fn).call(this, name, onConnectCallBack, socketEventsCallBack), 100);
6701
6815
  }
6702
6816
  }
6703
- ],
6704
- GetPathFromContext(context) {
6705
- const { serviceId, serviceInstanceId, serviceInstanceProcessId } = context;
6706
- return `/${serviceId}/${serviceInstanceId}/${serviceInstanceProcessId}`;
6707
- },
6708
- redisQueryFilters: {
6709
- level1ContextField: "serviceType",
6710
- level2ContextField: "appid",
6711
- level3ContextField: "appinstanceid"
6712
- },
6713
- subscriptionTopics: [
6714
- {
6715
- subscriptionTopic: SubscriptionTopic.AllServicesCombined,
6716
- route: "/metrics"
6717
- },
6718
- {
6719
- subscriptionTopic: SubscriptionTopic.Services,
6720
- route: "/metrics/services"
6721
- },
6722
- {
6723
- subscriptionTopic: SubscriptionTopic.ServiceInstances,
6724
- route: "/metrics/services/:key"
6725
- },
6726
- {
6727
- subscriptionTopic: SubscriptionTopic.ServiceInstance,
6728
- route: "/metrics/services/:key/:subkey"
6729
- }
6730
- ]
6731
- },
6732
- ["agent"]: {
6733
- influxDBContextTags: [
6734
- "id",
6735
- "hostName",
6736
- "agentName",
6737
- "threadId",
6738
- "asyncRunnerId"
6739
- ],
6740
- redisIndexPrefixDefinitions: {
6741
- timeSeriesIndex: "idx:agentIndexTimeSeries",
6742
- timeSeriesPrefix: "/agentTimeSeries:",
6743
- instantIndex: "idx:agentIndexInstant",
6744
- instantPrefix: "/agentInstant:"
6745
- },
6746
- fieldList: [
6747
- { fieldName: "childCount", gauge: Gauge.CHILD_COUNT, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE }
6748
- ],
6749
- //@@ need type declare in appframework ?? agent does not use appframework ... perhaps stspublisher
6750
- GetPathFromContext(context) {
6751
- const { agentName, threadId, asyncRunnerId } = context;
6752
- return `/${agentName}/${threadId}/${asyncRunnerId}`;
6753
- },
6754
- redisQueryFilters: {
6755
- level1ContextField: "serviceType",
6756
- level2ContextField: "appid",
6757
- //@@ this should be named something else
6758
- level3ContextField: "appinstanceid"
6759
- //@@ this should be named something else
6760
- },
6761
- subscriptionTopics: [
6762
- {
6763
- subscriptionTopic: SubscriptionTopic.AllAgentsCombined,
6764
- route: "/metrics"
6765
- },
6766
- {
6767
- subscriptionTopic: SubscriptionTopic.Agents,
6768
- route: "/metrics/agents"
6769
- },
6770
- {
6771
- subscriptionTopic: SubscriptionTopic.AgentWorkers,
6772
- route: "/metrics/agents/:key"
6773
- },
6774
- {
6775
- subscriptionTopic: SubscriptionTopic.AgentWorker,
6776
- route: "/metrics/agents/:key/:subkey"
6777
- }
6778
- ]
6779
- },
6780
- ["lambda"]: {
6781
- influxDBContextTags: [
6782
- "technology",
6783
- "subTechnology",
6784
- "lambdaFunctionName",
6785
- "lambdaInstance",
6786
- "hostName",
6787
- "processId",
6788
- "parentProcessId",
6789
- "useCase",
6790
- "pattern"
6791
- ],
6792
- redisIndexPrefixDefinitions: {
6793
- timeSeriesIndex: "idx:lambdaIndexTimeSeries",
6794
- timeSeriesPrefix: "/lambdaTimeSeries:",
6795
- instantIndex: "idx:lambdaIndexInstant",
6796
- instantPrefix: "/lambdaInstant:"
6797
- },
6798
- fieldList: [
6799
- { fieldName: "cpu", gauge: Gauge.CPU_LOAD_GAUGE, instrumentProperty: "val", dataType: "number", timeSeriesIndex: true, quantile: true, influxdbDataType: "floatField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
6800
- { fieldName: "connectionCount", gauge: Gauge.CONNECTION_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", timeSeriesIndex: true, quantile: true, influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
6801
- { fieldName: "connectionPoolCount", gauge: Gauge.CONNECTION_POOL_TOTAL_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
6802
- { fieldName: "connectionIdleCount", gauge: Gauge.CONNECTION_POOL_IDLE_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
6803
- { fieldName: "connectionWaitingCount", gauge: Gauge.CONNECTION_POOL_WAITING_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
6804
- { fieldName: "systemcpu", gauge: Gauge.CPU_SYSTEM_LOAD_GAUGE, instrumentProperty: "val", dataType: "number", timeSeriesIndex: true, quantile: true, influxdbDataType: "floatField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
6805
- { fieldName: "memory", gauge: Gauge.OBJECT_GAUGE, instrumentProperty: "val", dataType: "JSON", influxdbDataType: "stringField", gaugeType: GaugeTypes.INSTRUMENT_OBJECT }
6806
- ],
6807
- //@@ need type declare in appframework
6808
- GetPathFromContext(context) {
6809
- const { technology, subTechnology, lambdaInstance } = context;
6810
- return `/${technology}/${subTechnology}/${lambdaInstance}`;
6811
- },
6812
- redisQueryFilters: {
6813
- level1ContextField: "serviceType",
6814
- level2ContextField: "technology",
6815
- level3ContextField: "subTechnology"
6816
- },
6817
- subscriptionTopics: [
6818
- {
6819
- subscriptionTopic: SubscriptionTopic.AllLambdasCombined,
6820
- // uicontrollerlanding
6821
- route: "/metrics"
6822
- },
6823
- {
6824
- subscriptionTopic: SubscriptionTopic.LambdaTechnologies,
6825
- // uicontrollerlambda
6826
- route: "/metrics/lambdas"
6827
- },
6828
- {
6829
- subscriptionTopic: SubscriptionTopic.LambdaSubTechnologies,
6830
- // uicontrollerlambdasubtechnologies
6831
- route: "/metrics/lambdas/:key"
6832
- },
6833
- {
6834
- subscriptionTopic: SubscriptionTopic.LambdaSubTechnologiesInstance,
6835
- // uicontrollerlambdasubtechnologiesinstance
6836
- route: "/metrics/lambdas/:key/:subkey"
6837
- }
6838
- ]
6839
- }
6840
- }
6841
- };
6842
- const GetInstruments = (service) => {
6843
- const fieldList = [
6844
- ...globalServiceDefinitions.coreFieldList,
6845
- ...globalServiceDefinitions.logFieldList,
6846
- ...globalServiceDefinitions.services[service].fieldList
6847
- ];
6848
- const retVal = [];
6849
- fieldList.forEach((v) => {
6850
- if (v.instrumentOptions) {
6851
- retVal.push([v.gauge, v.gaugeType, v.instrumentOptions]);
6852
- } else {
6853
- retVal.push([v.gauge, v.gaugeType]);
6854
- }
6855
- if (v.histo) {
6856
- retVal.push([v.histoGaugeType, GaugeTypes.INSTRUMENT_HISTOGRAM]);
6817
+ break;
6857
6818
  }
6858
6819
  });
6859
- return retVal;
6860
6820
  };
6861
6821
  export {
6862
6822
  AgentInstrumentController,