@nsshunt/stsvueutils 1.0.82 → 1.0.84

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.
@@ -3236,6 +3236,303 @@ var SubscriptionTopic = /* @__PURE__ */ ((SubscriptionTopic2) => {
3236
3236
  SubscriptionTopic2["LogProcessing"] = "LogProcessing";
3237
3237
  return SubscriptionTopic2;
3238
3238
  })(SubscriptionTopic || {});
3239
+ const instrumentationObservationInterval = 1e3;
3240
+ const instrumentationTimeWindow = 600;
3241
+ const consoleLogging = true;
3242
+ const instrumentLogging = true;
3243
+ const globalServiceDefinitions = {
3244
+ coreFieldList: [
3245
+ { fieldName: "requestCount", gauge: Gauge.REQUEST_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
3246
+ { fieldName: "errorCount", gauge: Gauge.ERROR_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
3247
+ { fieldName: "retryCount", gauge: Gauge.RETRY_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
3248
+ { fieldName: "authenticationCount", gauge: Gauge.AUTHENTICATION_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
3249
+ { fieldName: "authenticationErrorCount", gauge: Gauge.AUTHENTICATION_ERROR_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
3250
+ { fieldName: "authenticationRetryCount", gauge: Gauge.AUTHENTICATION_RETRY_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
3251
+ { fieldName: "velocity", gauge: Gauge.VELOCITY_GAUGE, instrumentProperty: "va", dataType: "number", influxdbDataType: "floatField", gaugeType: GaugeTypes.INSTRUMENT_VELOCITY },
3252
+ {
3253
+ fieldName: "activeRequestCount",
3254
+ gauge: Gauge.ACTIVE_REQUEST_GAUGE,
3255
+ instrumentProperty: "val",
3256
+ dataType: "number",
3257
+ timeSeriesIndex: true,
3258
+ quantile: true,
3259
+ influxdbDataType: "intField",
3260
+ gaugeType: GaugeTypes.INSTRUMENT_GAUGE,
3261
+ instrumentOptions: {
3262
+ interval: instrumentationObservationInterval,
3263
+ sampleSize: instrumentationTimeWindow
3264
+ }
3265
+ },
3266
+ { fieldName: "coreCount", gauge: Gauge.CORE_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
3267
+ { fieldName: "rx", gauge: Gauge.NETWORK_RX_GAUGE, instrumentProperty: "va", dataType: "number", influxdbDataType: "floatField", gaugeType: GaugeTypes.INSTRUMENT_VELOCITY },
3268
+ { fieldName: "tx", gauge: Gauge.NETWORK_TX_GAUGE, instrumentProperty: "va", dataType: "number", influxdbDataType: "floatField", gaugeType: GaugeTypes.INSTRUMENT_VELOCITY },
3269
+ { fieldName: "timer", gauge: Gauge.TIMER_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "floatField", gaugeType: GaugeTypes.INSTRUMENT_TIMER },
3270
+ {
3271
+ fieldName: "duration",
3272
+ gauge: Gauge.DURATION_GAUGE,
3273
+ instrumentProperty: "val",
3274
+ dataType: "number",
3275
+ timeSeriesIndex: true,
3276
+ quantile: true,
3277
+ influxdbDataType: "floatField",
3278
+ gaugeType: GaugeTypes.INSTRUMENT_GAUGE,
3279
+ instrumentOptions: {
3280
+ interval: instrumentationObservationInterval,
3281
+ sampleSize: instrumentationTimeWindow
3282
+ },
3283
+ histo: [
3284
+ { label: "B10", bucketLimit: 10 },
3285
+ { label: "B20", bucketLimit: 20 },
3286
+ { label: "B50", bucketLimit: 50 },
3287
+ { label: "B100", bucketLimit: 100 },
3288
+ { label: "B1000", bucketLimit: 1e3 },
3289
+ { label: "B50000", bucketLimit: 5e4 },
3290
+ { label: "BInfinity", bucketLimit: -1 }
3291
+ ],
3292
+ histoGauge: Gauge.DURATION_HISTOGRAM_GAUGE
3293
+ },
3294
+ {
3295
+ fieldName: "latency",
3296
+ gauge: Gauge.LATENCY_GAUGE,
3297
+ instrumentProperty: "val",
3298
+ dataType: "number",
3299
+ timeSeriesIndex: true,
3300
+ quantile: true,
3301
+ influxdbDataType: "floatField",
3302
+ gaugeType: GaugeTypes.INSTRUMENT_GAUGE,
3303
+ instrumentOptions: {
3304
+ interval: instrumentationObservationInterval,
3305
+ sampleSize: instrumentationTimeWindow
3306
+ },
3307
+ histo: [
3308
+ { label: "B10", bucketLimit: 10 },
3309
+ { label: "B20", bucketLimit: 20 },
3310
+ { label: "B50", bucketLimit: 50 },
3311
+ { label: "B100", bucketLimit: 100 },
3312
+ { label: "B1000", bucketLimit: 1e3 },
3313
+ { label: "B50000", bucketLimit: 5e4 },
3314
+ { label: "BInfinity", bucketLimit: -1 }
3315
+ ],
3316
+ histoGauge: Gauge.LATENCY_HISTOGRAM_GAUGE
3317
+ }
3318
+ ],
3319
+ logFieldList: [
3320
+ {
3321
+ fieldName: "log",
3322
+ gauge: Gauge.LOGGER,
3323
+ instrumentProperty: "val",
3324
+ dataType: "string",
3325
+ timeSeriesIndex: false,
3326
+ quantile: false,
3327
+ influxdbDataType: "stringField",
3328
+ gaugeType: GaugeTypes.INSTRUMENT_LOG,
3329
+ instrumentOptions: {
3330
+ consoleLogging,
3331
+ instrumentLogging
3332
+ }
3333
+ }
3334
+ ],
3335
+ services: {
3336
+ ["service"]: {
3337
+ influxDBContextTags: [
3338
+ "serviceId",
3339
+ "serviceName",
3340
+ "serviceVersion",
3341
+ "serviceInstanceId",
3342
+ "serviceInstanceProcessId",
3343
+ "hostName",
3344
+ "pid",
3345
+ "ppid"
3346
+ ],
3347
+ redisIndexPrefixDefinitions: {
3348
+ timeSeriesIndex: "idx:serviceIndexTimeSeries",
3349
+ timeSeriesPrefix: "/serviceTimeSeries:",
3350
+ instantIndex: "idx:serviceIndexInstant",
3351
+ instantPrefix: "/serviceInstant:"
3352
+ },
3353
+ fieldList: [
3354
+ {
3355
+ fieldName: "cpu",
3356
+ gauge: Gauge.CPU_LOAD_GAUGE,
3357
+ instrumentProperty: "val",
3358
+ dataType: "number",
3359
+ timeSeriesIndex: true,
3360
+ quantile: true,
3361
+ influxdbDataType: "floatField",
3362
+ gaugeType: GaugeTypes.INSTRUMENT_GAUGE,
3363
+ instrumentOptions: {
3364
+ interval: instrumentationObservationInterval,
3365
+ sampleSize: instrumentationTimeWindow
3366
+ }
3367
+ },
3368
+ {
3369
+ fieldName: "connectionCount",
3370
+ gauge: Gauge.CONNECTION_COUNT_GAUGE,
3371
+ instrumentProperty: "val",
3372
+ dataType: "number",
3373
+ timeSeriesIndex: true,
3374
+ quantile: true,
3375
+ influxdbDataType: "intField",
3376
+ gaugeType: GaugeTypes.INSTRUMENT_GAUGE,
3377
+ instrumentOptions: {
3378
+ interval: instrumentationObservationInterval,
3379
+ sampleSize: instrumentationTimeWindow
3380
+ }
3381
+ },
3382
+ { fieldName: "connectionPoolCount", gauge: Gauge.CONNECTION_POOL_TOTAL_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
3383
+ { fieldName: "connectionIdleCount", gauge: Gauge.CONNECTION_POOL_IDLE_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
3384
+ { fieldName: "connectionWaitingCount", gauge: Gauge.CONNECTION_POOL_WAITING_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
3385
+ { fieldName: "systemcpu", gauge: Gauge.CPU_SYSTEM_LOAD_GAUGE, instrumentProperty: "val", dataType: "number", timeSeriesIndex: true, quantile: true, influxdbDataType: "floatField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
3386
+ {
3387
+ fieldName: "memory",
3388
+ gauge: Gauge.OBJECT_GAUGE,
3389
+ instrumentProperty: "val",
3390
+ dataType: "JSON",
3391
+ influxdbDataType: "stringField",
3392
+ gaugeType: GaugeTypes.INSTRUMENT_OBJECT,
3393
+ instrumentOptions: {
3394
+ label: "InstrumentObjectMaster"
3395
+ }
3396
+ }
3397
+ ],
3398
+ GetPathFromContext(context) {
3399
+ const { serviceId, serviceInstanceId, serviceInstanceProcessId } = context;
3400
+ return `/${serviceId}/${serviceInstanceId}/${serviceInstanceProcessId}`;
3401
+ },
3402
+ redisQueryFilters: {
3403
+ level1ContextField: "serviceType",
3404
+ level2ContextField: "appid",
3405
+ level3ContextField: "appinstanceid"
3406
+ },
3407
+ subscriptionTopics: [
3408
+ {
3409
+ subscriptionTopic: SubscriptionTopic.AllServicesCombined,
3410
+ route: "/metrics"
3411
+ },
3412
+ {
3413
+ subscriptionTopic: SubscriptionTopic.Services,
3414
+ route: "/metrics/services"
3415
+ },
3416
+ {
3417
+ subscriptionTopic: SubscriptionTopic.ServiceInstances,
3418
+ route: "/metrics/services/:key"
3419
+ },
3420
+ {
3421
+ subscriptionTopic: SubscriptionTopic.ServiceInstance,
3422
+ route: "/metrics/services/:key/:subkey"
3423
+ }
3424
+ ]
3425
+ },
3426
+ ["agent"]: {
3427
+ influxDBContextTags: [
3428
+ "id",
3429
+ "hostName",
3430
+ "agentName",
3431
+ "threadId",
3432
+ "asyncRunnerId"
3433
+ ],
3434
+ redisIndexPrefixDefinitions: {
3435
+ timeSeriesIndex: "idx:agentIndexTimeSeries",
3436
+ timeSeriesPrefix: "/agentTimeSeries:",
3437
+ instantIndex: "idx:agentIndexInstant",
3438
+ instantPrefix: "/agentInstant:"
3439
+ },
3440
+ fieldList: [
3441
+ { fieldName: "childCount", gauge: Gauge.CHILD_COUNT, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE }
3442
+ ],
3443
+ //@@ need type declare in appframework ?? agent does not use appframework ... perhaps stspublisher
3444
+ GetPathFromContext(context) {
3445
+ const { agentName, threadId, asyncRunnerId } = context;
3446
+ return `/${agentName}/${threadId}/${asyncRunnerId}`;
3447
+ },
3448
+ redisQueryFilters: {
3449
+ level1ContextField: "serviceType",
3450
+ level2ContextField: "appid",
3451
+ //@@ this should be named something else
3452
+ level3ContextField: "appinstanceid"
3453
+ //@@ this should be named something else
3454
+ },
3455
+ subscriptionTopics: [
3456
+ {
3457
+ subscriptionTopic: SubscriptionTopic.AllAgentsCombined,
3458
+ route: "/metrics"
3459
+ },
3460
+ {
3461
+ subscriptionTopic: SubscriptionTopic.Agents,
3462
+ route: "/metrics/agents"
3463
+ },
3464
+ {
3465
+ subscriptionTopic: SubscriptionTopic.AgentWorkers,
3466
+ route: "/metrics/agents/:key"
3467
+ },
3468
+ {
3469
+ subscriptionTopic: SubscriptionTopic.AgentWorker,
3470
+ route: "/metrics/agents/:key/:subkey"
3471
+ }
3472
+ ]
3473
+ },
3474
+ ["lambda"]: {
3475
+ influxDBContextTags: [
3476
+ "technology",
3477
+ "subTechnology",
3478
+ "lambdaFunctionName",
3479
+ "lambdaInstance",
3480
+ "hostName",
3481
+ "processId",
3482
+ "parentProcessId",
3483
+ "useCase",
3484
+ "pattern"
3485
+ ],
3486
+ redisIndexPrefixDefinitions: {
3487
+ timeSeriesIndex: "idx:lambdaIndexTimeSeries",
3488
+ timeSeriesPrefix: "/lambdaTimeSeries:",
3489
+ instantIndex: "idx:lambdaIndexInstant",
3490
+ instantPrefix: "/lambdaInstant:"
3491
+ },
3492
+ fieldList: [
3493
+ { fieldName: "cpu", gauge: Gauge.CPU_LOAD_GAUGE, instrumentProperty: "val", dataType: "number", timeSeriesIndex: true, quantile: true, influxdbDataType: "floatField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
3494
+ { fieldName: "connectionCount", gauge: Gauge.CONNECTION_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", timeSeriesIndex: true, quantile: true, influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
3495
+ { fieldName: "connectionPoolCount", gauge: Gauge.CONNECTION_POOL_TOTAL_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
3496
+ { fieldName: "connectionIdleCount", gauge: Gauge.CONNECTION_POOL_IDLE_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
3497
+ { fieldName: "connectionWaitingCount", gauge: Gauge.CONNECTION_POOL_WAITING_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
3498
+ { fieldName: "systemcpu", gauge: Gauge.CPU_SYSTEM_LOAD_GAUGE, instrumentProperty: "val", dataType: "number", timeSeriesIndex: true, quantile: true, influxdbDataType: "floatField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
3499
+ { fieldName: "memory", gauge: Gauge.OBJECT_GAUGE, instrumentProperty: "val", dataType: "JSON", influxdbDataType: "stringField", gaugeType: GaugeTypes.INSTRUMENT_OBJECT }
3500
+ ],
3501
+ //@@ need type declare in appframework
3502
+ GetPathFromContext(context) {
3503
+ const { technology, subTechnology, lambdaInstance } = context;
3504
+ return `/${technology}/${subTechnology}/${lambdaInstance}`;
3505
+ },
3506
+ redisQueryFilters: {
3507
+ level1ContextField: "serviceType",
3508
+ level2ContextField: "technology",
3509
+ level3ContextField: "subTechnology"
3510
+ },
3511
+ subscriptionTopics: [
3512
+ {
3513
+ subscriptionTopic: SubscriptionTopic.AllLambdasCombined,
3514
+ // uicontrollerlanding
3515
+ route: "/metrics"
3516
+ },
3517
+ {
3518
+ subscriptionTopic: SubscriptionTopic.LambdaTechnologies,
3519
+ // uicontrollerlambda
3520
+ route: "/metrics/lambdas"
3521
+ },
3522
+ {
3523
+ subscriptionTopic: SubscriptionTopic.LambdaSubTechnologies,
3524
+ // uicontrollerlambdasubtechnologies
3525
+ route: "/metrics/lambdas/:key"
3526
+ },
3527
+ {
3528
+ subscriptionTopic: SubscriptionTopic.LambdaSubTechnologiesInstance,
3529
+ // uicontrollerlambdasubtechnologiesinstance
3530
+ route: "/metrics/lambdas/:key/:subkey"
3531
+ }
3532
+ ]
3533
+ }
3534
+ }
3535
+ };
3239
3536
  const _ObservabilityModelUtils = class _ObservabilityModelUtils2 {
3240
3537
  static GetModelNode(data) {
3241
3538
  const fixedSize = 2;
@@ -3334,6 +3631,23 @@ const _ObservabilityModelUtils = class _ObservabilityModelUtils2 {
3334
3631
  };
3335
3632
  }
3336
3633
  }
3634
+ static GetModelData(serviceType, model, data, parseLog) {
3635
+ const fieldList = [
3636
+ ...globalServiceDefinitions.coreFieldList,
3637
+ ...globalServiceDefinitions.services[serviceType].fieldList
3638
+ ];
3639
+ fieldList.forEach((field) => {
3640
+ if (field.quantile) {
3641
+ _ObservabilityModelUtils2.ParseModelNodeWithQuantile(model, data, parseLog, field.gauge, field.fieldName, `${field.fieldName}_quantile`);
3642
+ } else if (field.histo) {
3643
+ _ObservabilityModelUtils2.ParseModelNodeHisto(model, data, parseLog, field.histoGauge, `${field.fieldName}_histo`);
3644
+ } else if (field.gaugeType.localeCompare(GaugeTypes.INSTRUMENT_OBJECT) === 0) {
3645
+ _ObservabilityModelUtils2.ParseModelNodeObject(model, data, parseLog, field.gauge, field.fieldName);
3646
+ } else {
3647
+ _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, field.gauge, field.fieldName);
3648
+ }
3649
+ });
3650
+ }
3337
3651
  static GetModelForService(id, data, subscribeToKafka, logger) {
3338
3652
  try {
3339
3653
  const parseLog = [];
@@ -3341,29 +3655,7 @@ const _ObservabilityModelUtils = class _ObservabilityModelUtils2 {
3341
3655
  id,
3342
3656
  instruments: {}
3343
3657
  };
3344
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.REQUEST_COUNT_GAUGE, "requestCount");
3345
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.ERROR_COUNT_GAUGE, "errorCount");
3346
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.RETRY_COUNT_GAUGE, "retryCount");
3347
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.AUTHENTICATION_COUNT_GAUGE, "authenticationCount");
3348
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.AUTHENTICATION_ERROR_COUNT_GAUGE, "authenticationErrorCount");
3349
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.AUTHENTICATION_RETRY_COUNT_GAUGE, "authenticationRetryCount");
3350
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.VELOCITY_GAUGE, "velocity");
3351
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.ACTIVE_REQUEST_GAUGE, "activeRequestCount");
3352
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.CONNECTION_COUNT_GAUGE, "connectionCount");
3353
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.CONNECTION_POOL_TOTAL_GAUGE, "connectionPoolCount");
3354
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.CONNECTION_POOL_IDLE_GAUGE, "connectionIdleCount");
3355
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.CONNECTION_POOL_WAITING_GAUGE, "connectionWaitingCount");
3356
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.CORE_COUNT_GAUGE, "coreCount");
3357
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.TIMER_GAUGE, "timer");
3358
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.NETWORK_RX_GAUGE, "rx");
3359
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.NETWORK_TX_GAUGE, "tx");
3360
- _ObservabilityModelUtils2.ParseModelNodeWithQuantile(model, data, parseLog, Gauge.CPU_LOAD_GAUGE, "cpu", "cpu_quantile");
3361
- _ObservabilityModelUtils2.ParseModelNodeWithQuantile(model, data, parseLog, Gauge.CPU_SYSTEM_LOAD_GAUGE, "systemcpu", "systemcpu_quantile");
3362
- _ObservabilityModelUtils2.ParseModelNodeWithQuantile(model, data, parseLog, Gauge.DURATION_GAUGE, "duration", "duration_quantile");
3363
- _ObservabilityModelUtils2.ParseModelNodeWithQuantile(model, data, parseLog, Gauge.LATENCY_GAUGE, "latency", "latency_quantile");
3364
- _ObservabilityModelUtils2.ParseModelNodeHisto(model, data, parseLog, Gauge.DURATION_HISTOGRAM_GAUGE, "duration_histo");
3365
- _ObservabilityModelUtils2.ParseModelNodeHisto(model, data, parseLog, Gauge.LATENCY_HISTOGRAM_GAUGE, "latency_histo");
3366
- _ObservabilityModelUtils2.ParseModelNodeObject(model, data, parseLog, Gauge.OBJECT_GAUGE, "memory");
3658
+ this.GetModelData("service", model, data, parseLog);
3367
3659
  if (!subscribeToKafka) {
3368
3660
  model.instruments[Gauge.LOGGER] = _ObservabilityModelUtils2.GetModelNodeRawStringArray(data["logMessages"]);
3369
3661
  }
@@ -3382,29 +3674,7 @@ const _ObservabilityModelUtils = class _ObservabilityModelUtils2 {
3382
3674
  id,
3383
3675
  instruments: {}
3384
3676
  };
3385
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.REQUEST_COUNT_GAUGE, "requestCount");
3386
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.ERROR_COUNT_GAUGE, "errorCount");
3387
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.RETRY_COUNT_GAUGE, "retryCount");
3388
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.AUTHENTICATION_COUNT_GAUGE, "authenticationCount");
3389
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.AUTHENTICATION_ERROR_COUNT_GAUGE, "authenticationErrorCount");
3390
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.AUTHENTICATION_RETRY_COUNT_GAUGE, "authenticationRetryCount");
3391
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.VELOCITY_GAUGE, "velocity");
3392
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.ACTIVE_REQUEST_GAUGE, "activeRequestCount");
3393
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.CONNECTION_COUNT_GAUGE, "connectionCount");
3394
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.CONNECTION_POOL_TOTAL_GAUGE, "connectionPoolCount");
3395
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.CONNECTION_POOL_IDLE_GAUGE, "connectionIdleCount");
3396
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.CONNECTION_POOL_WAITING_GAUGE, "connectionWaitingCount");
3397
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.CORE_COUNT_GAUGE, "coreCount");
3398
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.TIMER_GAUGE, "timer");
3399
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.NETWORK_RX_GAUGE, "rx");
3400
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.NETWORK_TX_GAUGE, "tx");
3401
- _ObservabilityModelUtils2.ParseModelNodeWithQuantile(model, data, parseLog, Gauge.CPU_LOAD_GAUGE, "cpu", "cpu_quantile");
3402
- _ObservabilityModelUtils2.ParseModelNodeWithQuantile(model, data, parseLog, Gauge.CPU_SYSTEM_LOAD_GAUGE, "systemcpu", "systemcpu_quantile");
3403
- _ObservabilityModelUtils2.ParseModelNodeWithQuantile(model, data, parseLog, Gauge.DURATION_GAUGE, "duration", "duration_quantile");
3404
- _ObservabilityModelUtils2.ParseModelNodeWithQuantile(model, data, parseLog, Gauge.LATENCY_GAUGE, "latency", "latency_quantile");
3405
- _ObservabilityModelUtils2.ParseModelNodeHisto(model, data, parseLog, Gauge.DURATION_HISTOGRAM_GAUGE, "duration_histo");
3406
- _ObservabilityModelUtils2.ParseModelNodeHisto(model, data, parseLog, Gauge.LATENCY_HISTOGRAM_GAUGE, "latency_histo");
3407
- _ObservabilityModelUtils2.ParseModelNodeObject(model, data, parseLog, Gauge.OBJECT_GAUGE, "memory");
3677
+ this.GetModelData("lambda", model, data, parseLog);
3408
3678
  if (!subscribeToKafka) {
3409
3679
  model.instruments[Gauge.LOGGER] = _ObservabilityModelUtils2.GetModelNodeRawStringArray(data["logMessages"]);
3410
3680
  }
@@ -3426,22 +3696,7 @@ const _ObservabilityModelUtils = class _ObservabilityModelUtils2 {
3426
3696
  id,
3427
3697
  instruments: {}
3428
3698
  };
3429
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.REQUEST_COUNT_GAUGE, "requestCount");
3430
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.ERROR_COUNT_GAUGE, "errorCount");
3431
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.RETRY_COUNT_GAUGE, "retryCount");
3432
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.AUTHENTICATION_COUNT_GAUGE, "authenticationCount");
3433
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.AUTHENTICATION_ERROR_COUNT_GAUGE, "authenticationErrorCount");
3434
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.AUTHENTICATION_RETRY_COUNT_GAUGE, "authenticationRetryCount");
3435
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.VELOCITY_GAUGE, "velocity");
3436
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.CORE_COUNT_GAUGE, "coreCount");
3437
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.TIMER_GAUGE, "timer");
3438
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.ACTIVE_REQUEST_GAUGE, "activeRequestCount");
3439
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.NETWORK_RX_GAUGE, "rx");
3440
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.NETWORK_TX_GAUGE, "tx");
3441
- _ObservabilityModelUtils2.ParseModelNodeWithQuantile(model, data, parseLog, Gauge.DURATION_GAUGE, "duration", "duration_quantile");
3442
- _ObservabilityModelUtils2.ParseModelNodeWithQuantile(model, data, parseLog, Gauge.LATENCY_GAUGE, "latency", "latency_quantile");
3443
- _ObservabilityModelUtils2.ParseModelNodeHisto(model, data, parseLog, Gauge.DURATION_HISTOGRAM_GAUGE, "duration_histo");
3444
- _ObservabilityModelUtils2.ParseModelNodeHisto(model, data, parseLog, Gauge.LATENCY_HISTOGRAM_GAUGE, "latency_histo");
3699
+ this.GetModelData("agent", model, data, parseLog);
3445
3700
  if (!subscribeToKafka) {
3446
3701
  model.instruments[Gauge.LOGGER] = _ObservabilityModelUtils2.GetModelNodeRawStringArray(data["logMessages"]);
3447
3702
  }
@@ -3490,431 +3745,11 @@ __publicField2(_ObservabilityModelUtils, "ParseModelNodeObject", (model, data, p
3490
3745
  model.instruments[gaugeName] = _ObservabilityModelUtils.GetModelNodeObject({});
3491
3746
  }
3492
3747
  });
3493
- debugModule(`proc:${process.pid}`);
3494
3748
  const byteToHex = [];
3495
3749
  for (let i = 0; i < 256; ++i) {
3496
3750
  byteToHex.push((i + 256).toString(16).slice(1));
3497
3751
  }
3498
3752
  typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
3499
- ({
3500
- coreFieldList: [
3501
- {
3502
- fieldName: "requestCount",
3503
- gauge: Gauge.REQUEST_COUNT_GAUGE,
3504
- instrumentProperty: "val",
3505
- dataType: "number",
3506
- influxdbDataType: "intField"
3507
- /* intField */
3508
- },
3509
- {
3510
- fieldName: "errorCount",
3511
- gauge: Gauge.ERROR_COUNT_GAUGE,
3512
- instrumentProperty: "val",
3513
- dataType: "number",
3514
- influxdbDataType: "intField"
3515
- /* intField */
3516
- },
3517
- {
3518
- fieldName: "retryCount",
3519
- gauge: Gauge.RETRY_COUNT_GAUGE,
3520
- instrumentProperty: "val",
3521
- dataType: "number",
3522
- influxdbDataType: "intField"
3523
- /* intField */
3524
- },
3525
- {
3526
- fieldName: "authenticationCount",
3527
- gauge: Gauge.AUTHENTICATION_COUNT_GAUGE,
3528
- instrumentProperty: "val",
3529
- dataType: "number",
3530
- influxdbDataType: "intField"
3531
- /* intField */
3532
- },
3533
- {
3534
- fieldName: "authenticationErrorCount",
3535
- gauge: Gauge.AUTHENTICATION_ERROR_COUNT_GAUGE,
3536
- instrumentProperty: "val",
3537
- dataType: "number",
3538
- influxdbDataType: "intField"
3539
- /* intField */
3540
- },
3541
- {
3542
- fieldName: "authenticationRetryCount",
3543
- gauge: Gauge.AUTHENTICATION_RETRY_COUNT_GAUGE,
3544
- instrumentProperty: "val",
3545
- dataType: "number",
3546
- influxdbDataType: "intField"
3547
- /* intField */
3548
- },
3549
- {
3550
- fieldName: "velocity",
3551
- gauge: Gauge.VELOCITY_GAUGE,
3552
- instrumentProperty: "va",
3553
- dataType: "number",
3554
- influxdbDataType: "floatField"
3555
- /* floatField */
3556
- },
3557
- {
3558
- fieldName: "activeRequestCount",
3559
- gauge: Gauge.ACTIVE_REQUEST_GAUGE,
3560
- instrumentProperty: "val",
3561
- dataType: "number",
3562
- timeSeriesIndex: true,
3563
- quantile: true,
3564
- influxdbDataType: "intField"
3565
- /* intField */
3566
- },
3567
- {
3568
- fieldName: "coreCount",
3569
- gauge: Gauge.CORE_COUNT_GAUGE,
3570
- instrumentProperty: "val",
3571
- dataType: "number",
3572
- influxdbDataType: "intField"
3573
- /* intField */
3574
- },
3575
- {
3576
- fieldName: "rx",
3577
- gauge: Gauge.NETWORK_RX_GAUGE,
3578
- instrumentProperty: "va",
3579
- dataType: "number",
3580
- influxdbDataType: "floatField"
3581
- /* floatField */
3582
- },
3583
- {
3584
- fieldName: "tx",
3585
- gauge: Gauge.NETWORK_TX_GAUGE,
3586
- instrumentProperty: "va",
3587
- dataType: "number",
3588
- influxdbDataType: "floatField"
3589
- /* floatField */
3590
- },
3591
- {
3592
- fieldName: "timer",
3593
- gauge: Gauge.TIMER_GAUGE,
3594
- instrumentProperty: "val",
3595
- dataType: "number",
3596
- influxdbDataType: "floatField"
3597
- /* floatField */
3598
- },
3599
- {
3600
- fieldName: "duration",
3601
- gauge: Gauge.DURATION_GAUGE,
3602
- instrumentProperty: "val",
3603
- dataType: "number",
3604
- timeSeriesIndex: true,
3605
- quantile: true,
3606
- influxdbDataType: "floatField",
3607
- histo: [
3608
- { label: "B10", bucketLimit: 10 },
3609
- { label: "B20", bucketLimit: 20 },
3610
- { label: "B50", bucketLimit: 50 },
3611
- { label: "B100", bucketLimit: 100 },
3612
- { label: "B1000", bucketLimit: 1e3 },
3613
- { label: "B50000", bucketLimit: 5e4 },
3614
- { label: "BInfinity", bucketLimit: -1 }
3615
- ]
3616
- },
3617
- {
3618
- fieldName: "latency",
3619
- gauge: Gauge.LATENCY_GAUGE,
3620
- instrumentProperty: "val",
3621
- dataType: "number",
3622
- timeSeriesIndex: true,
3623
- quantile: true,
3624
- influxdbDataType: "floatField",
3625
- histo: [
3626
- { label: "B10", bucketLimit: 10 },
3627
- { label: "B20", bucketLimit: 20 },
3628
- { label: "B50", bucketLimit: 50 },
3629
- { label: "B100", bucketLimit: 100 },
3630
- { label: "B1000", bucketLimit: 1e3 },
3631
- { label: "B50000", bucketLimit: 5e4 },
3632
- { label: "BInfinity", bucketLimit: -1 }
3633
- ]
3634
- }
3635
- ],
3636
- services: {
3637
- ["service"]: {
3638
- influxDBContextTags: [
3639
- "serviceId",
3640
- "serviceName",
3641
- "serviceVersion",
3642
- "serviceInstanceId",
3643
- "serviceInstanceProcessId",
3644
- "hostName",
3645
- "pid",
3646
- "ppid"
3647
- ],
3648
- redisIndexPrefixDefinitions: {
3649
- timeSeriesIndex: "idx:serviceIndexTimeSeries",
3650
- timeSeriesPrefix: "/serviceTimeSeries:",
3651
- instantIndex: "idx:serviceIndexInstant",
3652
- instantPrefix: "/serviceInstant:"
3653
- },
3654
- fieldList: [
3655
- {
3656
- fieldName: "cpu",
3657
- gauge: Gauge.CPU_LOAD_GAUGE,
3658
- instrumentProperty: "val",
3659
- dataType: "number",
3660
- timeSeriesIndex: true,
3661
- quantile: true,
3662
- influxdbDataType: "floatField"
3663
- /* floatField */
3664
- },
3665
- {
3666
- fieldName: "connectionCount",
3667
- gauge: Gauge.CONNECTION_COUNT_GAUGE,
3668
- instrumentProperty: "val",
3669
- dataType: "number",
3670
- timeSeriesIndex: true,
3671
- quantile: true,
3672
- influxdbDataType: "intField"
3673
- /* intField */
3674
- },
3675
- {
3676
- fieldName: "connectionPoolCount",
3677
- gauge: Gauge.CONNECTION_POOL_TOTAL_GAUGE,
3678
- instrumentProperty: "val",
3679
- dataType: "number",
3680
- influxdbDataType: "intField"
3681
- /* intField */
3682
- },
3683
- {
3684
- fieldName: "connectionIdleCount",
3685
- gauge: Gauge.CONNECTION_POOL_IDLE_GAUGE,
3686
- instrumentProperty: "val",
3687
- dataType: "number",
3688
- influxdbDataType: "intField"
3689
- /* intField */
3690
- },
3691
- {
3692
- fieldName: "connectionWaitingCount",
3693
- gauge: Gauge.CONNECTION_POOL_WAITING_GAUGE,
3694
- instrumentProperty: "val",
3695
- dataType: "number",
3696
- influxdbDataType: "intField"
3697
- /* intField */
3698
- },
3699
- {
3700
- fieldName: "systemcpu",
3701
- gauge: Gauge.CPU_SYSTEM_LOAD_GAUGE,
3702
- instrumentProperty: "val",
3703
- dataType: "number",
3704
- timeSeriesIndex: true,
3705
- quantile: true,
3706
- influxdbDataType: "floatField"
3707
- /* floatField */
3708
- },
3709
- {
3710
- fieldName: "memory",
3711
- gauge: Gauge.OBJECT_GAUGE,
3712
- instrumentProperty: "val",
3713
- dataType: "JSON",
3714
- influxdbDataType: "stringField"
3715
- /* stringField */
3716
- }
3717
- ],
3718
- GetPathFromContext(context) {
3719
- const { serviceId, serviceInstanceId, serviceInstanceProcessId } = context;
3720
- return `/${serviceId}/${serviceInstanceId}/${serviceInstanceProcessId}`;
3721
- },
3722
- redisQueryFilters: {
3723
- level1ContextField: "serviceType",
3724
- level2ContextField: "appid",
3725
- level3ContextField: "appinstanceid"
3726
- },
3727
- subscriptionTopics: [
3728
- {
3729
- subscriptionTopic: SubscriptionTopic.AllServicesCombined,
3730
- route: "/metrics"
3731
- },
3732
- {
3733
- subscriptionTopic: SubscriptionTopic.Services,
3734
- route: "/metrics/services"
3735
- },
3736
- {
3737
- subscriptionTopic: SubscriptionTopic.ServiceInstances,
3738
- route: "/metrics/services/:key"
3739
- },
3740
- {
3741
- subscriptionTopic: SubscriptionTopic.ServiceInstance,
3742
- route: "/metrics/services/:key/:subkey"
3743
- }
3744
- ]
3745
- },
3746
- ["agent"]: {
3747
- influxDBContextTags: [
3748
- "id",
3749
- "hostName",
3750
- "agentName",
3751
- "threadId",
3752
- "asyncRunnerId"
3753
- ],
3754
- redisIndexPrefixDefinitions: {
3755
- timeSeriesIndex: "idx:agentIndexTimeSeries",
3756
- timeSeriesPrefix: "/agentTimeSeries:",
3757
- instantIndex: "idx:agentIndexInstant",
3758
- instantPrefix: "/agentInstant:"
3759
- },
3760
- fieldList: [
3761
- {
3762
- fieldName: "childCount",
3763
- gauge: Gauge.CHILD_COUNT,
3764
- instrumentProperty: "val",
3765
- dataType: "number",
3766
- influxdbDataType: "intField"
3767
- /* intField */
3768
- }
3769
- ],
3770
- //@@ need type declare in appframework ?? agent does not use appframework ... perhaps stspublisher
3771
- GetPathFromContext(context) {
3772
- const { agentName, threadId, asyncRunnerId } = context;
3773
- return `/${agentName}/${threadId}/${asyncRunnerId}`;
3774
- },
3775
- redisQueryFilters: {
3776
- level1ContextField: "serviceType",
3777
- level2ContextField: "appid",
3778
- //@@ this should be named something else
3779
- level3ContextField: "appinstanceid"
3780
- //@@ this should be named something else
3781
- },
3782
- subscriptionTopics: [
3783
- {
3784
- subscriptionTopic: SubscriptionTopic.AllAgentsCombined,
3785
- route: "/metrics"
3786
- },
3787
- {
3788
- subscriptionTopic: SubscriptionTopic.Agents,
3789
- route: "/metrics/agents"
3790
- },
3791
- {
3792
- subscriptionTopic: SubscriptionTopic.AgentWorkers,
3793
- route: "/metrics/agents/:key"
3794
- },
3795
- {
3796
- subscriptionTopic: SubscriptionTopic.AgentWorker,
3797
- route: "/metrics/agents/:key/:subkey"
3798
- }
3799
- ]
3800
- },
3801
- ["lambda"]: {
3802
- influxDBContextTags: [
3803
- "technology",
3804
- "subTechnology",
3805
- "lambdaFunctionName",
3806
- "lambdaInstance",
3807
- "hostName",
3808
- "processId",
3809
- "parentProcessId",
3810
- "useCase",
3811
- "pattern"
3812
- ],
3813
- redisIndexPrefixDefinitions: {
3814
- timeSeriesIndex: "idx:lambdaIndexTimeSeries",
3815
- timeSeriesPrefix: "/lambdaTimeSeries:",
3816
- instantIndex: "idx:lambdaIndexInstant",
3817
- instantPrefix: "/lambdaInstant:"
3818
- },
3819
- fieldList: [
3820
- {
3821
- fieldName: "cpu",
3822
- gauge: Gauge.CPU_LOAD_GAUGE,
3823
- instrumentProperty: "val",
3824
- dataType: "number",
3825
- timeSeriesIndex: true,
3826
- quantile: true,
3827
- influxdbDataType: "floatField"
3828
- /* floatField */
3829
- },
3830
- {
3831
- fieldName: "connectionCount",
3832
- gauge: Gauge.CONNECTION_COUNT_GAUGE,
3833
- instrumentProperty: "val",
3834
- dataType: "number",
3835
- timeSeriesIndex: true,
3836
- quantile: true,
3837
- influxdbDataType: "intField"
3838
- /* intField */
3839
- },
3840
- {
3841
- fieldName: "connectionPoolCount",
3842
- gauge: Gauge.CONNECTION_POOL_TOTAL_GAUGE,
3843
- instrumentProperty: "val",
3844
- dataType: "number",
3845
- influxdbDataType: "intField"
3846
- /* intField */
3847
- },
3848
- {
3849
- fieldName: "connectionIdleCount",
3850
- gauge: Gauge.CONNECTION_POOL_IDLE_GAUGE,
3851
- instrumentProperty: "val",
3852
- dataType: "number",
3853
- influxdbDataType: "intField"
3854
- /* intField */
3855
- },
3856
- {
3857
- fieldName: "connectionWaitingCount",
3858
- gauge: Gauge.CONNECTION_POOL_WAITING_GAUGE,
3859
- instrumentProperty: "val",
3860
- dataType: "number",
3861
- influxdbDataType: "intField"
3862
- /* intField */
3863
- },
3864
- {
3865
- fieldName: "systemcpu",
3866
- gauge: Gauge.CPU_SYSTEM_LOAD_GAUGE,
3867
- instrumentProperty: "val",
3868
- dataType: "number",
3869
- timeSeriesIndex: true,
3870
- quantile: true,
3871
- influxdbDataType: "floatField"
3872
- /* floatField */
3873
- },
3874
- {
3875
- fieldName: "memory",
3876
- gauge: Gauge.OBJECT_GAUGE,
3877
- instrumentProperty: "val",
3878
- dataType: "JSON",
3879
- influxdbDataType: "stringField"
3880
- /* stringField */
3881
- }
3882
- ],
3883
- //@@ need type declare in appframework
3884
- GetPathFromContext(context) {
3885
- const { technology, subTechnology, lambdaInstance } = context;
3886
- return `/${technology}/${subTechnology}/${lambdaInstance}`;
3887
- },
3888
- redisQueryFilters: {
3889
- level1ContextField: "serviceType",
3890
- level2ContextField: "technology",
3891
- level3ContextField: "subTechnology"
3892
- },
3893
- subscriptionTopics: [
3894
- {
3895
- subscriptionTopic: SubscriptionTopic.AllLambdasCombined,
3896
- // uicontrollerlanding
3897
- route: "/metrics"
3898
- },
3899
- {
3900
- subscriptionTopic: SubscriptionTopic.LambdaTechnologies,
3901
- // uicontrollerlambda
3902
- route: "/metrics/lambdas"
3903
- },
3904
- {
3905
- subscriptionTopic: SubscriptionTopic.LambdaSubTechnologies,
3906
- // uicontrollerlambdasubtechnologies
3907
- route: "/metrics/lambdas/:key"
3908
- },
3909
- {
3910
- subscriptionTopic: SubscriptionTopic.LambdaSubTechnologiesInstance,
3911
- // uicontrollerlambdasubtechnologiesinstance
3912
- route: "/metrics/lambdas/:key/:subkey"
3913
- }
3914
- ]
3915
- }
3916
- }
3917
- });
3918
3753
  const TelemetryStore = defineStore("__sts__TelemetryStore", {
3919
3754
  // State
3920
3755
  // https://pinia.vuejs.org/core-concepts/state.html