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