@nsshunt/stsoauth2plugin 1.0.71 → 1.0.73

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.
@@ -1,6 +1,6 @@
1
1
  (function(global2, factory) {
2
- typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("vue"), require("node:worker_threads"), require("@nsshunt/stsutils"), require("@nsshunt/stsvueutils"), require("pinia"), require("node:https"), require("axios"), require("debug"), require("socket.io-client"), require("colors")) : typeof define === "function" && define.amd ? define(["exports", "vue", "node:worker_threads", "@nsshunt/stsutils", "@nsshunt/stsvueutils", "pinia", "node:https", "axios", "debug", "socket.io-client", "colors"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory(global2["@nsshunt/stsoauth2plugin"] = {}, global2.vue, global2.worker_threads, global2.stsutils, global2.stsvueutils, global2.pinia, global2.https, global2.axios, global2.debug));
3
- })(this, function(exports2, vue, wt, stsutils, stsvueutils, pinia, https, axios, debugModule) {
2
+ typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("vue"), require("node:worker_threads"), require("@nsshunt/stsutils"), require("@nsshunt/stsvueutils"), require("pinia"), require("node:https"), require("axios"), require("socket.io-client"), require("colors")) : typeof define === "function" && define.amd ? define(["exports", "vue", "node:worker_threads", "@nsshunt/stsutils", "@nsshunt/stsvueutils", "pinia", "node:https", "axios", "socket.io-client", "colors"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory(global2["@nsshunt/stsoauth2plugin"] = {}, global2.vue, global2.worker_threads, global2.stsutils, global2.stsvueutils, global2.pinia, global2.https, global2.axios));
3
+ })(this, function(exports2, vue, wt, stsutils, stsvueutils, pinia, https, axios) {
4
4
  "use strict";var __defProp = Object.defineProperty;
5
5
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
6
  var __publicField = (obj, key, value) => {
@@ -5472,6 +5472,303 @@ var __privateMethod = (obj, member, method) => {
5472
5472
  SubscriptionTopic2["LogProcessing"] = "LogProcessing";
5473
5473
  return SubscriptionTopic2;
5474
5474
  })(SubscriptionTopic || {});
5475
+ const instrumentationObservationInterval = 1e3;
5476
+ const instrumentationTimeWindow = 600;
5477
+ const consoleLogging = true;
5478
+ const instrumentLogging = true;
5479
+ const globalServiceDefinitions = {
5480
+ coreFieldList: [
5481
+ { fieldName: "requestCount", gauge: Gauge.REQUEST_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
5482
+ { fieldName: "errorCount", gauge: Gauge.ERROR_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
5483
+ { fieldName: "retryCount", gauge: Gauge.RETRY_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
5484
+ { fieldName: "authenticationCount", gauge: Gauge.AUTHENTICATION_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
5485
+ { fieldName: "authenticationErrorCount", gauge: Gauge.AUTHENTICATION_ERROR_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
5486
+ { fieldName: "authenticationRetryCount", gauge: Gauge.AUTHENTICATION_RETRY_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
5487
+ { fieldName: "velocity", gauge: Gauge.VELOCITY_GAUGE, instrumentProperty: "va", dataType: "number", influxdbDataType: "floatField", gaugeType: GaugeTypes.INSTRUMENT_VELOCITY },
5488
+ {
5489
+ fieldName: "activeRequestCount",
5490
+ gauge: Gauge.ACTIVE_REQUEST_GAUGE,
5491
+ instrumentProperty: "val",
5492
+ dataType: "number",
5493
+ timeSeriesIndex: true,
5494
+ quantile: true,
5495
+ influxdbDataType: "intField",
5496
+ gaugeType: GaugeTypes.INSTRUMENT_GAUGE,
5497
+ instrumentOptions: {
5498
+ interval: instrumentationObservationInterval,
5499
+ sampleSize: instrumentationTimeWindow
5500
+ }
5501
+ },
5502
+ { fieldName: "coreCount", gauge: Gauge.CORE_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
5503
+ { fieldName: "rx", gauge: Gauge.NETWORK_RX_GAUGE, instrumentProperty: "va", dataType: "number", influxdbDataType: "floatField", gaugeType: GaugeTypes.INSTRUMENT_VELOCITY },
5504
+ { fieldName: "tx", gauge: Gauge.NETWORK_TX_GAUGE, instrumentProperty: "va", dataType: "number", influxdbDataType: "floatField", gaugeType: GaugeTypes.INSTRUMENT_VELOCITY },
5505
+ { fieldName: "timer", gauge: Gauge.TIMER_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "floatField", gaugeType: GaugeTypes.INSTRUMENT_TIMER },
5506
+ {
5507
+ fieldName: "duration",
5508
+ gauge: Gauge.DURATION_GAUGE,
5509
+ instrumentProperty: "val",
5510
+ dataType: "number",
5511
+ timeSeriesIndex: true,
5512
+ quantile: true,
5513
+ influxdbDataType: "floatField",
5514
+ gaugeType: GaugeTypes.INSTRUMENT_GAUGE,
5515
+ instrumentOptions: {
5516
+ interval: instrumentationObservationInterval,
5517
+ sampleSize: instrumentationTimeWindow
5518
+ },
5519
+ histo: [
5520
+ { label: "B10", bucketLimit: 10 },
5521
+ { label: "B20", bucketLimit: 20 },
5522
+ { label: "B50", bucketLimit: 50 },
5523
+ { label: "B100", bucketLimit: 100 },
5524
+ { label: "B1000", bucketLimit: 1e3 },
5525
+ { label: "B50000", bucketLimit: 5e4 },
5526
+ { label: "BInfinity", bucketLimit: -1 }
5527
+ ],
5528
+ histoGauge: Gauge.DURATION_HISTOGRAM_GAUGE
5529
+ },
5530
+ {
5531
+ fieldName: "latency",
5532
+ gauge: Gauge.LATENCY_GAUGE,
5533
+ instrumentProperty: "val",
5534
+ dataType: "number",
5535
+ timeSeriesIndex: true,
5536
+ quantile: true,
5537
+ influxdbDataType: "floatField",
5538
+ gaugeType: GaugeTypes.INSTRUMENT_GAUGE,
5539
+ instrumentOptions: {
5540
+ interval: instrumentationObservationInterval,
5541
+ sampleSize: instrumentationTimeWindow
5542
+ },
5543
+ histo: [
5544
+ { label: "B10", bucketLimit: 10 },
5545
+ { label: "B20", bucketLimit: 20 },
5546
+ { label: "B50", bucketLimit: 50 },
5547
+ { label: "B100", bucketLimit: 100 },
5548
+ { label: "B1000", bucketLimit: 1e3 },
5549
+ { label: "B50000", bucketLimit: 5e4 },
5550
+ { label: "BInfinity", bucketLimit: -1 }
5551
+ ],
5552
+ histoGauge: Gauge.LATENCY_HISTOGRAM_GAUGE
5553
+ }
5554
+ ],
5555
+ logFieldList: [
5556
+ {
5557
+ fieldName: "log",
5558
+ gauge: Gauge.LOGGER,
5559
+ instrumentProperty: "val",
5560
+ dataType: "string",
5561
+ timeSeriesIndex: false,
5562
+ quantile: false,
5563
+ influxdbDataType: "stringField",
5564
+ gaugeType: GaugeTypes.INSTRUMENT_LOG,
5565
+ instrumentOptions: {
5566
+ consoleLogging,
5567
+ instrumentLogging
5568
+ }
5569
+ }
5570
+ ],
5571
+ services: {
5572
+ ["service"]: {
5573
+ influxDBContextTags: [
5574
+ "serviceId",
5575
+ "serviceName",
5576
+ "serviceVersion",
5577
+ "serviceInstanceId",
5578
+ "serviceInstanceProcessId",
5579
+ "hostName",
5580
+ "pid",
5581
+ "ppid"
5582
+ ],
5583
+ redisIndexPrefixDefinitions: {
5584
+ timeSeriesIndex: "idx:serviceIndexTimeSeries",
5585
+ timeSeriesPrefix: "/serviceTimeSeries:",
5586
+ instantIndex: "idx:serviceIndexInstant",
5587
+ instantPrefix: "/serviceInstant:"
5588
+ },
5589
+ fieldList: [
5590
+ {
5591
+ fieldName: "cpu",
5592
+ gauge: Gauge.CPU_LOAD_GAUGE,
5593
+ instrumentProperty: "val",
5594
+ dataType: "number",
5595
+ timeSeriesIndex: true,
5596
+ quantile: true,
5597
+ influxdbDataType: "floatField",
5598
+ gaugeType: GaugeTypes.INSTRUMENT_GAUGE,
5599
+ instrumentOptions: {
5600
+ interval: instrumentationObservationInterval,
5601
+ sampleSize: instrumentationTimeWindow
5602
+ }
5603
+ },
5604
+ {
5605
+ fieldName: "connectionCount",
5606
+ gauge: Gauge.CONNECTION_COUNT_GAUGE,
5607
+ instrumentProperty: "val",
5608
+ dataType: "number",
5609
+ timeSeriesIndex: true,
5610
+ quantile: true,
5611
+ influxdbDataType: "intField",
5612
+ gaugeType: GaugeTypes.INSTRUMENT_GAUGE,
5613
+ instrumentOptions: {
5614
+ interval: instrumentationObservationInterval,
5615
+ sampleSize: instrumentationTimeWindow
5616
+ }
5617
+ },
5618
+ { fieldName: "connectionPoolCount", gauge: Gauge.CONNECTION_POOL_TOTAL_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
5619
+ { fieldName: "connectionIdleCount", gauge: Gauge.CONNECTION_POOL_IDLE_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
5620
+ { fieldName: "connectionWaitingCount", gauge: Gauge.CONNECTION_POOL_WAITING_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
5621
+ { fieldName: "systemcpu", gauge: Gauge.CPU_SYSTEM_LOAD_GAUGE, instrumentProperty: "val", dataType: "number", timeSeriesIndex: true, quantile: true, influxdbDataType: "floatField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
5622
+ {
5623
+ fieldName: "memory",
5624
+ gauge: Gauge.OBJECT_GAUGE,
5625
+ instrumentProperty: "val",
5626
+ dataType: "JSON",
5627
+ influxdbDataType: "stringField",
5628
+ gaugeType: GaugeTypes.INSTRUMENT_OBJECT,
5629
+ instrumentOptions: {
5630
+ label: "InstrumentObjectMaster"
5631
+ }
5632
+ }
5633
+ ],
5634
+ GetPathFromContext(context) {
5635
+ const { serviceId, serviceInstanceId, serviceInstanceProcessId } = context;
5636
+ return `/${serviceId}/${serviceInstanceId}/${serviceInstanceProcessId}`;
5637
+ },
5638
+ redisQueryFilters: {
5639
+ level1ContextField: "serviceType",
5640
+ level2ContextField: "appid",
5641
+ level3ContextField: "appinstanceid"
5642
+ },
5643
+ subscriptionTopics: [
5644
+ {
5645
+ subscriptionTopic: SubscriptionTopic.AllServicesCombined,
5646
+ route: "/metrics"
5647
+ },
5648
+ {
5649
+ subscriptionTopic: SubscriptionTopic.Services,
5650
+ route: "/metrics/services"
5651
+ },
5652
+ {
5653
+ subscriptionTopic: SubscriptionTopic.ServiceInstances,
5654
+ route: "/metrics/services/:key"
5655
+ },
5656
+ {
5657
+ subscriptionTopic: SubscriptionTopic.ServiceInstance,
5658
+ route: "/metrics/services/:key/:subkey"
5659
+ }
5660
+ ]
5661
+ },
5662
+ ["agent"]: {
5663
+ influxDBContextTags: [
5664
+ "id",
5665
+ "hostName",
5666
+ "agentName",
5667
+ "threadId",
5668
+ "asyncRunnerId"
5669
+ ],
5670
+ redisIndexPrefixDefinitions: {
5671
+ timeSeriesIndex: "idx:agentIndexTimeSeries",
5672
+ timeSeriesPrefix: "/agentTimeSeries:",
5673
+ instantIndex: "idx:agentIndexInstant",
5674
+ instantPrefix: "/agentInstant:"
5675
+ },
5676
+ fieldList: [
5677
+ { fieldName: "childCount", gauge: Gauge.CHILD_COUNT, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE }
5678
+ ],
5679
+ //@@ need type declare in appframework ?? agent does not use appframework ... perhaps stspublisher
5680
+ GetPathFromContext(context) {
5681
+ const { agentName, threadId, asyncRunnerId } = context;
5682
+ return `/${agentName}/${threadId}/${asyncRunnerId}`;
5683
+ },
5684
+ redisQueryFilters: {
5685
+ level1ContextField: "serviceType",
5686
+ level2ContextField: "appid",
5687
+ //@@ this should be named something else
5688
+ level3ContextField: "appinstanceid"
5689
+ //@@ this should be named something else
5690
+ },
5691
+ subscriptionTopics: [
5692
+ {
5693
+ subscriptionTopic: SubscriptionTopic.AllAgentsCombined,
5694
+ route: "/metrics"
5695
+ },
5696
+ {
5697
+ subscriptionTopic: SubscriptionTopic.Agents,
5698
+ route: "/metrics/agents"
5699
+ },
5700
+ {
5701
+ subscriptionTopic: SubscriptionTopic.AgentWorkers,
5702
+ route: "/metrics/agents/:key"
5703
+ },
5704
+ {
5705
+ subscriptionTopic: SubscriptionTopic.AgentWorker,
5706
+ route: "/metrics/agents/:key/:subkey"
5707
+ }
5708
+ ]
5709
+ },
5710
+ ["lambda"]: {
5711
+ influxDBContextTags: [
5712
+ "technology",
5713
+ "subTechnology",
5714
+ "lambdaFunctionName",
5715
+ "lambdaInstance",
5716
+ "hostName",
5717
+ "processId",
5718
+ "parentProcessId",
5719
+ "useCase",
5720
+ "pattern"
5721
+ ],
5722
+ redisIndexPrefixDefinitions: {
5723
+ timeSeriesIndex: "idx:lambdaIndexTimeSeries",
5724
+ timeSeriesPrefix: "/lambdaTimeSeries:",
5725
+ instantIndex: "idx:lambdaIndexInstant",
5726
+ instantPrefix: "/lambdaInstant:"
5727
+ },
5728
+ fieldList: [
5729
+ { fieldName: "cpu", gauge: Gauge.CPU_LOAD_GAUGE, instrumentProperty: "val", dataType: "number", timeSeriesIndex: true, quantile: true, influxdbDataType: "floatField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
5730
+ { fieldName: "connectionCount", gauge: Gauge.CONNECTION_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", timeSeriesIndex: true, quantile: true, influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
5731
+ { fieldName: "connectionPoolCount", gauge: Gauge.CONNECTION_POOL_TOTAL_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
5732
+ { fieldName: "connectionIdleCount", gauge: Gauge.CONNECTION_POOL_IDLE_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
5733
+ { fieldName: "connectionWaitingCount", gauge: Gauge.CONNECTION_POOL_WAITING_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
5734
+ { fieldName: "systemcpu", gauge: Gauge.CPU_SYSTEM_LOAD_GAUGE, instrumentProperty: "val", dataType: "number", timeSeriesIndex: true, quantile: true, influxdbDataType: "floatField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
5735
+ { fieldName: "memory", gauge: Gauge.OBJECT_GAUGE, instrumentProperty: "val", dataType: "JSON", influxdbDataType: "stringField", gaugeType: GaugeTypes.INSTRUMENT_OBJECT }
5736
+ ],
5737
+ //@@ need type declare in appframework
5738
+ GetPathFromContext(context) {
5739
+ const { technology, subTechnology, lambdaInstance } = context;
5740
+ return `/${technology}/${subTechnology}/${lambdaInstance}`;
5741
+ },
5742
+ redisQueryFilters: {
5743
+ level1ContextField: "serviceType",
5744
+ level2ContextField: "technology",
5745
+ level3ContextField: "subTechnology"
5746
+ },
5747
+ subscriptionTopics: [
5748
+ {
5749
+ subscriptionTopic: SubscriptionTopic.AllLambdasCombined,
5750
+ // uicontrollerlanding
5751
+ route: "/metrics"
5752
+ },
5753
+ {
5754
+ subscriptionTopic: SubscriptionTopic.LambdaTechnologies,
5755
+ // uicontrollerlambda
5756
+ route: "/metrics/lambdas"
5757
+ },
5758
+ {
5759
+ subscriptionTopic: SubscriptionTopic.LambdaSubTechnologies,
5760
+ // uicontrollerlambdasubtechnologies
5761
+ route: "/metrics/lambdas/:key"
5762
+ },
5763
+ {
5764
+ subscriptionTopic: SubscriptionTopic.LambdaSubTechnologiesInstance,
5765
+ // uicontrollerlambdasubtechnologiesinstance
5766
+ route: "/metrics/lambdas/:key/:subkey"
5767
+ }
5768
+ ]
5769
+ }
5770
+ }
5771
+ };
5475
5772
  const _ObservabilityModelUtils = class _ObservabilityModelUtils2 {
5476
5773
  static GetModelNode(data) {
5477
5774
  const fixedSize = 2;
@@ -5570,6 +5867,24 @@ var __privateMethod = (obj, member, method) => {
5570
5867
  };
5571
5868
  }
5572
5869
  }
5870
+ static GetModelData(serviceType, model, data, parseLog) {
5871
+ const fieldList = [
5872
+ ...globalServiceDefinitions.coreFieldList,
5873
+ ...globalServiceDefinitions.services[serviceType].fieldList
5874
+ ];
5875
+ fieldList.forEach((field) => {
5876
+ if (field.quantile) {
5877
+ _ObservabilityModelUtils2.ParseModelNodeWithQuantile(model, data, parseLog, field.gauge, field.fieldName, `${field.fieldName}_quantile`);
5878
+ } else if (field.gaugeType.localeCompare(GaugeTypes.INSTRUMENT_OBJECT) === 0) {
5879
+ _ObservabilityModelUtils2.ParseModelNodeObject(model, data, parseLog, field.gauge, field.fieldName);
5880
+ } else {
5881
+ _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, field.gauge, field.fieldName);
5882
+ }
5883
+ if (field.histo) {
5884
+ _ObservabilityModelUtils2.ParseModelNodeHisto(model, data, parseLog, field.histoGauge, `${field.fieldName}_histo`);
5885
+ }
5886
+ });
5887
+ }
5573
5888
  static GetModelForService(id, data, subscribeToKafka, logger) {
5574
5889
  try {
5575
5890
  const parseLog = [];
@@ -5577,29 +5892,7 @@ var __privateMethod = (obj, member, method) => {
5577
5892
  id,
5578
5893
  instruments: {}
5579
5894
  };
5580
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.REQUEST_COUNT_GAUGE, "requestCount");
5581
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.ERROR_COUNT_GAUGE, "errorCount");
5582
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.RETRY_COUNT_GAUGE, "retryCount");
5583
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.AUTHENTICATION_COUNT_GAUGE, "authenticationCount");
5584
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.AUTHENTICATION_ERROR_COUNT_GAUGE, "authenticationErrorCount");
5585
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.AUTHENTICATION_RETRY_COUNT_GAUGE, "authenticationRetryCount");
5586
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.VELOCITY_GAUGE, "velocity");
5587
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.ACTIVE_REQUEST_GAUGE, "activeRequestCount");
5588
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.CONNECTION_COUNT_GAUGE, "connectionCount");
5589
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.CONNECTION_POOL_TOTAL_GAUGE, "connectionPoolCount");
5590
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.CONNECTION_POOL_IDLE_GAUGE, "connectionIdleCount");
5591
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.CONNECTION_POOL_WAITING_GAUGE, "connectionWaitingCount");
5592
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.CORE_COUNT_GAUGE, "coreCount");
5593
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.TIMER_GAUGE, "timer");
5594
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.NETWORK_RX_GAUGE, "rx");
5595
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.NETWORK_TX_GAUGE, "tx");
5596
- _ObservabilityModelUtils2.ParseModelNodeWithQuantile(model, data, parseLog, Gauge.CPU_LOAD_GAUGE, "cpu", "cpu_quantile");
5597
- _ObservabilityModelUtils2.ParseModelNodeWithQuantile(model, data, parseLog, Gauge.CPU_SYSTEM_LOAD_GAUGE, "systemcpu", "systemcpu_quantile");
5598
- _ObservabilityModelUtils2.ParseModelNodeWithQuantile(model, data, parseLog, Gauge.DURATION_GAUGE, "duration", "duration_quantile");
5599
- _ObservabilityModelUtils2.ParseModelNodeWithQuantile(model, data, parseLog, Gauge.LATENCY_GAUGE, "latency", "latency_quantile");
5600
- _ObservabilityModelUtils2.ParseModelNodeHisto(model, data, parseLog, Gauge.DURATION_HISTOGRAM_GAUGE, "duration_histo");
5601
- _ObservabilityModelUtils2.ParseModelNodeHisto(model, data, parseLog, Gauge.LATENCY_HISTOGRAM_GAUGE, "latency_histo");
5602
- _ObservabilityModelUtils2.ParseModelNodeObject(model, data, parseLog, Gauge.OBJECT_GAUGE, "memory");
5895
+ this.GetModelData("service", model, data, parseLog);
5603
5896
  if (!subscribeToKafka) {
5604
5897
  model.instruments[Gauge.LOGGER] = _ObservabilityModelUtils2.GetModelNodeRawStringArray(data["logMessages"]);
5605
5898
  }
@@ -5618,29 +5911,7 @@ var __privateMethod = (obj, member, method) => {
5618
5911
  id,
5619
5912
  instruments: {}
5620
5913
  };
5621
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.REQUEST_COUNT_GAUGE, "requestCount");
5622
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.ERROR_COUNT_GAUGE, "errorCount");
5623
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.RETRY_COUNT_GAUGE, "retryCount");
5624
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.AUTHENTICATION_COUNT_GAUGE, "authenticationCount");
5625
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.AUTHENTICATION_ERROR_COUNT_GAUGE, "authenticationErrorCount");
5626
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.AUTHENTICATION_RETRY_COUNT_GAUGE, "authenticationRetryCount");
5627
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.VELOCITY_GAUGE, "velocity");
5628
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.ACTIVE_REQUEST_GAUGE, "activeRequestCount");
5629
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.CONNECTION_COUNT_GAUGE, "connectionCount");
5630
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.CONNECTION_POOL_TOTAL_GAUGE, "connectionPoolCount");
5631
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.CONNECTION_POOL_IDLE_GAUGE, "connectionIdleCount");
5632
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.CONNECTION_POOL_WAITING_GAUGE, "connectionWaitingCount");
5633
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.CORE_COUNT_GAUGE, "coreCount");
5634
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.TIMER_GAUGE, "timer");
5635
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.NETWORK_RX_GAUGE, "rx");
5636
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.NETWORK_TX_GAUGE, "tx");
5637
- _ObservabilityModelUtils2.ParseModelNodeWithQuantile(model, data, parseLog, Gauge.CPU_LOAD_GAUGE, "cpu", "cpu_quantile");
5638
- _ObservabilityModelUtils2.ParseModelNodeWithQuantile(model, data, parseLog, Gauge.CPU_SYSTEM_LOAD_GAUGE, "systemcpu", "systemcpu_quantile");
5639
- _ObservabilityModelUtils2.ParseModelNodeWithQuantile(model, data, parseLog, Gauge.DURATION_GAUGE, "duration", "duration_quantile");
5640
- _ObservabilityModelUtils2.ParseModelNodeWithQuantile(model, data, parseLog, Gauge.LATENCY_GAUGE, "latency", "latency_quantile");
5641
- _ObservabilityModelUtils2.ParseModelNodeHisto(model, data, parseLog, Gauge.DURATION_HISTOGRAM_GAUGE, "duration_histo");
5642
- _ObservabilityModelUtils2.ParseModelNodeHisto(model, data, parseLog, Gauge.LATENCY_HISTOGRAM_GAUGE, "latency_histo");
5643
- _ObservabilityModelUtils2.ParseModelNodeObject(model, data, parseLog, Gauge.OBJECT_GAUGE, "memory");
5914
+ this.GetModelData("lambda", model, data, parseLog);
5644
5915
  if (!subscribeToKafka) {
5645
5916
  model.instruments[Gauge.LOGGER] = _ObservabilityModelUtils2.GetModelNodeRawStringArray(data["logMessages"]);
5646
5917
  }
@@ -5662,22 +5933,7 @@ var __privateMethod = (obj, member, method) => {
5662
5933
  id,
5663
5934
  instruments: {}
5664
5935
  };
5665
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.REQUEST_COUNT_GAUGE, "requestCount");
5666
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.ERROR_COUNT_GAUGE, "errorCount");
5667
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.RETRY_COUNT_GAUGE, "retryCount");
5668
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.AUTHENTICATION_COUNT_GAUGE, "authenticationCount");
5669
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.AUTHENTICATION_ERROR_COUNT_GAUGE, "authenticationErrorCount");
5670
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.AUTHENTICATION_RETRY_COUNT_GAUGE, "authenticationRetryCount");
5671
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.VELOCITY_GAUGE, "velocity");
5672
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.CORE_COUNT_GAUGE, "coreCount");
5673
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.TIMER_GAUGE, "timer");
5674
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.ACTIVE_REQUEST_GAUGE, "activeRequestCount");
5675
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.NETWORK_RX_GAUGE, "rx");
5676
- _ObservabilityModelUtils2.ParseModelNode(model, data, parseLog, Gauge.NETWORK_TX_GAUGE, "tx");
5677
- _ObservabilityModelUtils2.ParseModelNodeWithQuantile(model, data, parseLog, Gauge.DURATION_GAUGE, "duration", "duration_quantile");
5678
- _ObservabilityModelUtils2.ParseModelNodeWithQuantile(model, data, parseLog, Gauge.LATENCY_GAUGE, "latency", "latency_quantile");
5679
- _ObservabilityModelUtils2.ParseModelNodeHisto(model, data, parseLog, Gauge.DURATION_HISTOGRAM_GAUGE, "duration_histo");
5680
- _ObservabilityModelUtils2.ParseModelNodeHisto(model, data, parseLog, Gauge.LATENCY_HISTOGRAM_GAUGE, "latency_histo");
5936
+ this.GetModelData("agent", model, data, parseLog);
5681
5937
  if (!subscribeToKafka) {
5682
5938
  model.instruments[Gauge.LOGGER] = _ObservabilityModelUtils2.GetModelNodeRawStringArray(data["logMessages"]);
5683
5939
  }
@@ -5726,431 +5982,11 @@ var __privateMethod = (obj, member, method) => {
5726
5982
  model.instruments[gaugeName] = _ObservabilityModelUtils.GetModelNodeObject({});
5727
5983
  }
5728
5984
  });
5729
- debugModule(`proc:${process.pid}`);
5730
5985
  const byteToHex = [];
5731
5986
  for (let i = 0; i < 256; ++i) {
5732
5987
  byteToHex.push((i + 256).toString(16).slice(1));
5733
5988
  }
5734
5989
  typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
5735
- ({
5736
- coreFieldList: [
5737
- {
5738
- fieldName: "requestCount",
5739
- gauge: Gauge.REQUEST_COUNT_GAUGE,
5740
- instrumentProperty: "val",
5741
- dataType: "number",
5742
- influxdbDataType: "intField"
5743
- /* intField */
5744
- },
5745
- {
5746
- fieldName: "errorCount",
5747
- gauge: Gauge.ERROR_COUNT_GAUGE,
5748
- instrumentProperty: "val",
5749
- dataType: "number",
5750
- influxdbDataType: "intField"
5751
- /* intField */
5752
- },
5753
- {
5754
- fieldName: "retryCount",
5755
- gauge: Gauge.RETRY_COUNT_GAUGE,
5756
- instrumentProperty: "val",
5757
- dataType: "number",
5758
- influxdbDataType: "intField"
5759
- /* intField */
5760
- },
5761
- {
5762
- fieldName: "authenticationCount",
5763
- gauge: Gauge.AUTHENTICATION_COUNT_GAUGE,
5764
- instrumentProperty: "val",
5765
- dataType: "number",
5766
- influxdbDataType: "intField"
5767
- /* intField */
5768
- },
5769
- {
5770
- fieldName: "authenticationErrorCount",
5771
- gauge: Gauge.AUTHENTICATION_ERROR_COUNT_GAUGE,
5772
- instrumentProperty: "val",
5773
- dataType: "number",
5774
- influxdbDataType: "intField"
5775
- /* intField */
5776
- },
5777
- {
5778
- fieldName: "authenticationRetryCount",
5779
- gauge: Gauge.AUTHENTICATION_RETRY_COUNT_GAUGE,
5780
- instrumentProperty: "val",
5781
- dataType: "number",
5782
- influxdbDataType: "intField"
5783
- /* intField */
5784
- },
5785
- {
5786
- fieldName: "velocity",
5787
- gauge: Gauge.VELOCITY_GAUGE,
5788
- instrumentProperty: "va",
5789
- dataType: "number",
5790
- influxdbDataType: "floatField"
5791
- /* floatField */
5792
- },
5793
- {
5794
- fieldName: "activeRequestCount",
5795
- gauge: Gauge.ACTIVE_REQUEST_GAUGE,
5796
- instrumentProperty: "val",
5797
- dataType: "number",
5798
- timeSeriesIndex: true,
5799
- quantile: true,
5800
- influxdbDataType: "intField"
5801
- /* intField */
5802
- },
5803
- {
5804
- fieldName: "coreCount",
5805
- gauge: Gauge.CORE_COUNT_GAUGE,
5806
- instrumentProperty: "val",
5807
- dataType: "number",
5808
- influxdbDataType: "intField"
5809
- /* intField */
5810
- },
5811
- {
5812
- fieldName: "rx",
5813
- gauge: Gauge.NETWORK_RX_GAUGE,
5814
- instrumentProperty: "va",
5815
- dataType: "number",
5816
- influxdbDataType: "floatField"
5817
- /* floatField */
5818
- },
5819
- {
5820
- fieldName: "tx",
5821
- gauge: Gauge.NETWORK_TX_GAUGE,
5822
- instrumentProperty: "va",
5823
- dataType: "number",
5824
- influxdbDataType: "floatField"
5825
- /* floatField */
5826
- },
5827
- {
5828
- fieldName: "timer",
5829
- gauge: Gauge.TIMER_GAUGE,
5830
- instrumentProperty: "val",
5831
- dataType: "number",
5832
- influxdbDataType: "floatField"
5833
- /* floatField */
5834
- },
5835
- {
5836
- fieldName: "duration",
5837
- gauge: Gauge.DURATION_GAUGE,
5838
- instrumentProperty: "val",
5839
- dataType: "number",
5840
- timeSeriesIndex: true,
5841
- quantile: true,
5842
- influxdbDataType: "floatField",
5843
- histo: [
5844
- { label: "B10", bucketLimit: 10 },
5845
- { label: "B20", bucketLimit: 20 },
5846
- { label: "B50", bucketLimit: 50 },
5847
- { label: "B100", bucketLimit: 100 },
5848
- { label: "B1000", bucketLimit: 1e3 },
5849
- { label: "B50000", bucketLimit: 5e4 },
5850
- { label: "BInfinity", bucketLimit: -1 }
5851
- ]
5852
- },
5853
- {
5854
- fieldName: "latency",
5855
- gauge: Gauge.LATENCY_GAUGE,
5856
- instrumentProperty: "val",
5857
- dataType: "number",
5858
- timeSeriesIndex: true,
5859
- quantile: true,
5860
- influxdbDataType: "floatField",
5861
- histo: [
5862
- { label: "B10", bucketLimit: 10 },
5863
- { label: "B20", bucketLimit: 20 },
5864
- { label: "B50", bucketLimit: 50 },
5865
- { label: "B100", bucketLimit: 100 },
5866
- { label: "B1000", bucketLimit: 1e3 },
5867
- { label: "B50000", bucketLimit: 5e4 },
5868
- { label: "BInfinity", bucketLimit: -1 }
5869
- ]
5870
- }
5871
- ],
5872
- services: {
5873
- ["service"]: {
5874
- influxDBContextTags: [
5875
- "serviceId",
5876
- "serviceName",
5877
- "serviceVersion",
5878
- "serviceInstanceId",
5879
- "serviceInstanceProcessId",
5880
- "hostName",
5881
- "pid",
5882
- "ppid"
5883
- ],
5884
- redisIndexPrefixDefinitions: {
5885
- timeSeriesIndex: "idx:serviceIndexTimeSeries",
5886
- timeSeriesPrefix: "/serviceTimeSeries:",
5887
- instantIndex: "idx:serviceIndexInstant",
5888
- instantPrefix: "/serviceInstant:"
5889
- },
5890
- fieldList: [
5891
- {
5892
- fieldName: "cpu",
5893
- gauge: Gauge.CPU_LOAD_GAUGE,
5894
- instrumentProperty: "val",
5895
- dataType: "number",
5896
- timeSeriesIndex: true,
5897
- quantile: true,
5898
- influxdbDataType: "floatField"
5899
- /* floatField */
5900
- },
5901
- {
5902
- fieldName: "connectionCount",
5903
- gauge: Gauge.CONNECTION_COUNT_GAUGE,
5904
- instrumentProperty: "val",
5905
- dataType: "number",
5906
- timeSeriesIndex: true,
5907
- quantile: true,
5908
- influxdbDataType: "intField"
5909
- /* intField */
5910
- },
5911
- {
5912
- fieldName: "connectionPoolCount",
5913
- gauge: Gauge.CONNECTION_POOL_TOTAL_GAUGE,
5914
- instrumentProperty: "val",
5915
- dataType: "number",
5916
- influxdbDataType: "intField"
5917
- /* intField */
5918
- },
5919
- {
5920
- fieldName: "connectionIdleCount",
5921
- gauge: Gauge.CONNECTION_POOL_IDLE_GAUGE,
5922
- instrumentProperty: "val",
5923
- dataType: "number",
5924
- influxdbDataType: "intField"
5925
- /* intField */
5926
- },
5927
- {
5928
- fieldName: "connectionWaitingCount",
5929
- gauge: Gauge.CONNECTION_POOL_WAITING_GAUGE,
5930
- instrumentProperty: "val",
5931
- dataType: "number",
5932
- influxdbDataType: "intField"
5933
- /* intField */
5934
- },
5935
- {
5936
- fieldName: "systemcpu",
5937
- gauge: Gauge.CPU_SYSTEM_LOAD_GAUGE,
5938
- instrumentProperty: "val",
5939
- dataType: "number",
5940
- timeSeriesIndex: true,
5941
- quantile: true,
5942
- influxdbDataType: "floatField"
5943
- /* floatField */
5944
- },
5945
- {
5946
- fieldName: "memory",
5947
- gauge: Gauge.OBJECT_GAUGE,
5948
- instrumentProperty: "val",
5949
- dataType: "JSON",
5950
- influxdbDataType: "stringField"
5951
- /* stringField */
5952
- }
5953
- ],
5954
- GetPathFromContext(context) {
5955
- const { serviceId, serviceInstanceId, serviceInstanceProcessId } = context;
5956
- return `/${serviceId}/${serviceInstanceId}/${serviceInstanceProcessId}`;
5957
- },
5958
- redisQueryFilters: {
5959
- level1ContextField: "serviceType",
5960
- level2ContextField: "appid",
5961
- level3ContextField: "appinstanceid"
5962
- },
5963
- subscriptionTopics: [
5964
- {
5965
- subscriptionTopic: SubscriptionTopic.AllServicesCombined,
5966
- route: "/metrics"
5967
- },
5968
- {
5969
- subscriptionTopic: SubscriptionTopic.Services,
5970
- route: "/metrics/services"
5971
- },
5972
- {
5973
- subscriptionTopic: SubscriptionTopic.ServiceInstances,
5974
- route: "/metrics/services/:key"
5975
- },
5976
- {
5977
- subscriptionTopic: SubscriptionTopic.ServiceInstance,
5978
- route: "/metrics/services/:key/:subkey"
5979
- }
5980
- ]
5981
- },
5982
- ["agent"]: {
5983
- influxDBContextTags: [
5984
- "id",
5985
- "hostName",
5986
- "agentName",
5987
- "threadId",
5988
- "asyncRunnerId"
5989
- ],
5990
- redisIndexPrefixDefinitions: {
5991
- timeSeriesIndex: "idx:agentIndexTimeSeries",
5992
- timeSeriesPrefix: "/agentTimeSeries:",
5993
- instantIndex: "idx:agentIndexInstant",
5994
- instantPrefix: "/agentInstant:"
5995
- },
5996
- fieldList: [
5997
- {
5998
- fieldName: "childCount",
5999
- gauge: Gauge.CHILD_COUNT,
6000
- instrumentProperty: "val",
6001
- dataType: "number",
6002
- influxdbDataType: "intField"
6003
- /* intField */
6004
- }
6005
- ],
6006
- //@@ need type declare in appframework ?? agent does not use appframework ... perhaps stspublisher
6007
- GetPathFromContext(context) {
6008
- const { agentName, threadId, asyncRunnerId } = context;
6009
- return `/${agentName}/${threadId}/${asyncRunnerId}`;
6010
- },
6011
- redisQueryFilters: {
6012
- level1ContextField: "serviceType",
6013
- level2ContextField: "appid",
6014
- //@@ this should be named something else
6015
- level3ContextField: "appinstanceid"
6016
- //@@ this should be named something else
6017
- },
6018
- subscriptionTopics: [
6019
- {
6020
- subscriptionTopic: SubscriptionTopic.AllAgentsCombined,
6021
- route: "/metrics"
6022
- },
6023
- {
6024
- subscriptionTopic: SubscriptionTopic.Agents,
6025
- route: "/metrics/agents"
6026
- },
6027
- {
6028
- subscriptionTopic: SubscriptionTopic.AgentWorkers,
6029
- route: "/metrics/agents/:key"
6030
- },
6031
- {
6032
- subscriptionTopic: SubscriptionTopic.AgentWorker,
6033
- route: "/metrics/agents/:key/:subkey"
6034
- }
6035
- ]
6036
- },
6037
- ["lambda"]: {
6038
- influxDBContextTags: [
6039
- "technology",
6040
- "subTechnology",
6041
- "lambdaFunctionName",
6042
- "lambdaInstance",
6043
- "hostName",
6044
- "processId",
6045
- "parentProcessId",
6046
- "useCase",
6047
- "pattern"
6048
- ],
6049
- redisIndexPrefixDefinitions: {
6050
- timeSeriesIndex: "idx:lambdaIndexTimeSeries",
6051
- timeSeriesPrefix: "/lambdaTimeSeries:",
6052
- instantIndex: "idx:lambdaIndexInstant",
6053
- instantPrefix: "/lambdaInstant:"
6054
- },
6055
- fieldList: [
6056
- {
6057
- fieldName: "cpu",
6058
- gauge: Gauge.CPU_LOAD_GAUGE,
6059
- instrumentProperty: "val",
6060
- dataType: "number",
6061
- timeSeriesIndex: true,
6062
- quantile: true,
6063
- influxdbDataType: "floatField"
6064
- /* floatField */
6065
- },
6066
- {
6067
- fieldName: "connectionCount",
6068
- gauge: Gauge.CONNECTION_COUNT_GAUGE,
6069
- instrumentProperty: "val",
6070
- dataType: "number",
6071
- timeSeriesIndex: true,
6072
- quantile: true,
6073
- influxdbDataType: "intField"
6074
- /* intField */
6075
- },
6076
- {
6077
- fieldName: "connectionPoolCount",
6078
- gauge: Gauge.CONNECTION_POOL_TOTAL_GAUGE,
6079
- instrumentProperty: "val",
6080
- dataType: "number",
6081
- influxdbDataType: "intField"
6082
- /* intField */
6083
- },
6084
- {
6085
- fieldName: "connectionIdleCount",
6086
- gauge: Gauge.CONNECTION_POOL_IDLE_GAUGE,
6087
- instrumentProperty: "val",
6088
- dataType: "number",
6089
- influxdbDataType: "intField"
6090
- /* intField */
6091
- },
6092
- {
6093
- fieldName: "connectionWaitingCount",
6094
- gauge: Gauge.CONNECTION_POOL_WAITING_GAUGE,
6095
- instrumentProperty: "val",
6096
- dataType: "number",
6097
- influxdbDataType: "intField"
6098
- /* intField */
6099
- },
6100
- {
6101
- fieldName: "systemcpu",
6102
- gauge: Gauge.CPU_SYSTEM_LOAD_GAUGE,
6103
- instrumentProperty: "val",
6104
- dataType: "number",
6105
- timeSeriesIndex: true,
6106
- quantile: true,
6107
- influxdbDataType: "floatField"
6108
- /* floatField */
6109
- },
6110
- {
6111
- fieldName: "memory",
6112
- gauge: Gauge.OBJECT_GAUGE,
6113
- instrumentProperty: "val",
6114
- dataType: "JSON",
6115
- influxdbDataType: "stringField"
6116
- /* stringField */
6117
- }
6118
- ],
6119
- //@@ need type declare in appframework
6120
- GetPathFromContext(context) {
6121
- const { technology, subTechnology, lambdaInstance } = context;
6122
- return `/${technology}/${subTechnology}/${lambdaInstance}`;
6123
- },
6124
- redisQueryFilters: {
6125
- level1ContextField: "serviceType",
6126
- level2ContextField: "technology",
6127
- level3ContextField: "subTechnology"
6128
- },
6129
- subscriptionTopics: [
6130
- {
6131
- subscriptionTopic: SubscriptionTopic.AllLambdasCombined,
6132
- // uicontrollerlanding
6133
- route: "/metrics"
6134
- },
6135
- {
6136
- subscriptionTopic: SubscriptionTopic.LambdaTechnologies,
6137
- // uicontrollerlambda
6138
- route: "/metrics/lambdas"
6139
- },
6140
- {
6141
- subscriptionTopic: SubscriptionTopic.LambdaSubTechnologies,
6142
- // uicontrollerlambdasubtechnologies
6143
- route: "/metrics/lambdas/:key"
6144
- },
6145
- {
6146
- subscriptionTopic: SubscriptionTopic.LambdaSubTechnologiesInstance,
6147
- // uicontrollerlambdasubtechnologiesinstance
6148
- route: "/metrics/lambdas/:key/:subkey"
6149
- }
6150
- ]
6151
- }
6152
- }
6153
- });
6154
5990
  class STSOAuth2Manager {
6155
5991
  // ms
6156
5992
  constructor(app, options) {