@nsshunt/stsobservability 1.0.2 → 1.0.4

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.
@@ -993,12 +993,12 @@ class InstrumentLog extends InstrumentBase {
993
993
  __privateSet(this, _useLatestMessages, useLatestMessages);
994
994
  return this;
995
995
  }
996
- WithConsoleLogging(consoleLogging) {
997
- __privateSet(this, _consoleLogging, consoleLogging);
996
+ WithConsoleLogging(consoleLogging2) {
997
+ __privateSet(this, _consoleLogging, consoleLogging2);
998
998
  return this;
999
999
  }
1000
- WithInstrumentLogging(instrumentLogging) {
1001
- __privateSet(this, _instrumentLogging, instrumentLogging);
1000
+ WithInstrumentLogging(instrumentLogging2) {
1001
+ __privateSet(this, _instrumentLogging, instrumentLogging2);
1002
1002
  return this;
1003
1003
  }
1004
1004
  get MaxSize() {
@@ -6542,64 +6542,19 @@ var influxDBDataType = /* @__PURE__ */ ((influxDBDataType2) => {
6542
6542
  influxDBDataType2["stringField"] = "stringField";
6543
6543
  return influxDBDataType2;
6544
6544
  })(influxDBDataType || {});
6545
+ const instrumentationObservationInterval = 1e3;
6546
+ const instrumentationTimeWindow = 600;
6547
+ const consoleLogging = true;
6548
+ const instrumentLogging = true;
6545
6549
  const globalServiceDefinitions = {
6546
6550
  coreFieldList: [
6547
- {
6548
- fieldName: "requestCount",
6549
- gauge: Gauge.REQUEST_COUNT_GAUGE,
6550
- instrumentProperty: "val",
6551
- dataType: "number",
6552
- influxdbDataType: "intField"
6553
- /* intField */
6554
- },
6555
- {
6556
- fieldName: "errorCount",
6557
- gauge: Gauge.ERROR_COUNT_GAUGE,
6558
- instrumentProperty: "val",
6559
- dataType: "number",
6560
- influxdbDataType: "intField"
6561
- /* intField */
6562
- },
6563
- {
6564
- fieldName: "retryCount",
6565
- gauge: Gauge.RETRY_COUNT_GAUGE,
6566
- instrumentProperty: "val",
6567
- dataType: "number",
6568
- influxdbDataType: "intField"
6569
- /* intField */
6570
- },
6571
- {
6572
- fieldName: "authenticationCount",
6573
- gauge: Gauge.AUTHENTICATION_COUNT_GAUGE,
6574
- instrumentProperty: "val",
6575
- dataType: "number",
6576
- influxdbDataType: "intField"
6577
- /* intField */
6578
- },
6579
- {
6580
- fieldName: "authenticationErrorCount",
6581
- gauge: Gauge.AUTHENTICATION_ERROR_COUNT_GAUGE,
6582
- instrumentProperty: "val",
6583
- dataType: "number",
6584
- influxdbDataType: "intField"
6585
- /* intField */
6586
- },
6587
- {
6588
- fieldName: "authenticationRetryCount",
6589
- gauge: Gauge.AUTHENTICATION_RETRY_COUNT_GAUGE,
6590
- instrumentProperty: "val",
6591
- dataType: "number",
6592
- influxdbDataType: "intField"
6593
- /* intField */
6594
- },
6595
- {
6596
- fieldName: "velocity",
6597
- gauge: Gauge.VELOCITY_GAUGE,
6598
- instrumentProperty: "va",
6599
- dataType: "number",
6600
- influxdbDataType: "floatField"
6601
- /* floatField */
6602
- },
6551
+ { fieldName: "requestCount", gauge: Gauge.REQUEST_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
6552
+ { fieldName: "errorCount", gauge: Gauge.ERROR_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
6553
+ { fieldName: "retryCount", gauge: Gauge.RETRY_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
6554
+ { fieldName: "authenticationCount", gauge: Gauge.AUTHENTICATION_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
6555
+ { fieldName: "authenticationErrorCount", gauge: Gauge.AUTHENTICATION_ERROR_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
6556
+ { fieldName: "authenticationRetryCount", gauge: Gauge.AUTHENTICATION_RETRY_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
6557
+ { fieldName: "velocity", gauge: Gauge.VELOCITY_GAUGE, instrumentProperty: "va", dataType: "number", influxdbDataType: "floatField", gaugeType: GaugeTypes.INSTRUMENT_VELOCITY },
6603
6558
  {
6604
6559
  fieldName: "activeRequestCount",
6605
6560
  gauge: Gauge.ACTIVE_REQUEST_GAUGE,
@@ -6607,41 +6562,17 @@ const globalServiceDefinitions = {
6607
6562
  dataType: "number",
6608
6563
  timeSeriesIndex: true,
6609
6564
  quantile: true,
6610
- influxdbDataType: "intField"
6611
- /* intField */
6612
- },
6613
- {
6614
- fieldName: "coreCount",
6615
- gauge: Gauge.CORE_COUNT_GAUGE,
6616
- instrumentProperty: "val",
6617
- dataType: "number",
6618
- influxdbDataType: "intField"
6619
- /* intField */
6620
- },
6621
- {
6622
- fieldName: "rx",
6623
- gauge: Gauge.NETWORK_RX_GAUGE,
6624
- instrumentProperty: "va",
6625
- dataType: "number",
6626
- influxdbDataType: "floatField"
6627
- /* floatField */
6628
- },
6629
- {
6630
- fieldName: "tx",
6631
- gauge: Gauge.NETWORK_TX_GAUGE,
6632
- instrumentProperty: "va",
6633
- dataType: "number",
6634
- influxdbDataType: "floatField"
6635
- /* floatField */
6636
- },
6637
- {
6638
- fieldName: "timer",
6639
- gauge: Gauge.TIMER_GAUGE,
6640
- instrumentProperty: "val",
6641
- dataType: "number",
6642
- influxdbDataType: "floatField"
6643
- /* floatField */
6565
+ influxdbDataType: "intField",
6566
+ gaugeType: GaugeTypes.INSTRUMENT_GAUGE,
6567
+ instrumentOptions: {
6568
+ interval: instrumentationObservationInterval,
6569
+ sampleSize: instrumentationTimeWindow
6570
+ }
6644
6571
  },
6572
+ { fieldName: "coreCount", gauge: Gauge.CORE_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
6573
+ { fieldName: "rx", gauge: Gauge.NETWORK_RX_GAUGE, instrumentProperty: "va", dataType: "number", influxdbDataType: "floatField", gaugeType: GaugeTypes.INSTRUMENT_VELOCITY },
6574
+ { fieldName: "tx", gauge: Gauge.NETWORK_TX_GAUGE, instrumentProperty: "va", dataType: "number", influxdbDataType: "floatField", gaugeType: GaugeTypes.INSTRUMENT_VELOCITY },
6575
+ { fieldName: "timer", gauge: Gauge.TIMER_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "floatField", gaugeType: GaugeTypes.INSTRUMENT_TIMER },
6645
6576
  {
6646
6577
  fieldName: "duration",
6647
6578
  gauge: Gauge.DURATION_GAUGE,
@@ -6650,6 +6581,11 @@ const globalServiceDefinitions = {
6650
6581
  timeSeriesIndex: true,
6651
6582
  quantile: true,
6652
6583
  influxdbDataType: "floatField",
6584
+ gaugeType: GaugeTypes.INSTRUMENT_GAUGE,
6585
+ instrumentOptions: {
6586
+ interval: instrumentationObservationInterval,
6587
+ sampleSize: instrumentationTimeWindow
6588
+ },
6653
6589
  histo: [
6654
6590
  { label: "B10", bucketLimit: 10 },
6655
6591
  { label: "B20", bucketLimit: 20 },
@@ -6658,7 +6594,8 @@ const globalServiceDefinitions = {
6658
6594
  { label: "B1000", bucketLimit: 1e3 },
6659
6595
  { label: "B50000", bucketLimit: 5e4 },
6660
6596
  { label: "BInfinity", bucketLimit: -1 }
6661
- ]
6597
+ ],
6598
+ histoGaugeType: Gauge.DURATION_HISTOGRAM_GAUGE
6662
6599
  },
6663
6600
  {
6664
6601
  fieldName: "latency",
@@ -6668,6 +6605,11 @@ const globalServiceDefinitions = {
6668
6605
  timeSeriesIndex: true,
6669
6606
  quantile: true,
6670
6607
  influxdbDataType: "floatField",
6608
+ gaugeType: GaugeTypes.INSTRUMENT_GAUGE,
6609
+ instrumentOptions: {
6610
+ interval: instrumentationObservationInterval,
6611
+ sampleSize: instrumentationTimeWindow
6612
+ },
6671
6613
  histo: [
6672
6614
  { label: "B10", bucketLimit: 10 },
6673
6615
  { label: "B20", bucketLimit: 20 },
@@ -6676,7 +6618,24 @@ const globalServiceDefinitions = {
6676
6618
  { label: "B1000", bucketLimit: 1e3 },
6677
6619
  { label: "B50000", bucketLimit: 5e4 },
6678
6620
  { label: "BInfinity", bucketLimit: -1 }
6679
- ]
6621
+ ],
6622
+ histoGaugeType: Gauge.LATENCY_HISTOGRAM_GAUGE
6623
+ }
6624
+ ],
6625
+ logFieldList: [
6626
+ {
6627
+ fieldName: "log",
6628
+ gauge: Gauge.LOGGER,
6629
+ instrumentProperty: "val",
6630
+ dataType: "string",
6631
+ timeSeriesIndex: false,
6632
+ quantile: false,
6633
+ influxdbDataType: "stringField",
6634
+ gaugeType: GaugeTypes.INSTRUMENT_LOG,
6635
+ instrumentOptions: {
6636
+ consoleLogging,
6637
+ instrumentLogging
6638
+ }
6680
6639
  }
6681
6640
  ],
6682
6641
  services: {
@@ -6705,8 +6664,12 @@ const globalServiceDefinitions = {
6705
6664
  dataType: "number",
6706
6665
  timeSeriesIndex: true,
6707
6666
  quantile: true,
6708
- influxdbDataType: "floatField"
6709
- /* floatField */
6667
+ influxdbDataType: "floatField",
6668
+ gaugeType: GaugeTypes.INSTRUMENT_GAUGE,
6669
+ instrumentOptions: {
6670
+ interval: instrumentationObservationInterval,
6671
+ sampleSize: instrumentationTimeWindow
6672
+ }
6710
6673
  },
6711
6674
  {
6712
6675
  fieldName: "connectionCount",
@@ -6715,50 +6678,27 @@ const globalServiceDefinitions = {
6715
6678
  dataType: "number",
6716
6679
  timeSeriesIndex: true,
6717
6680
  quantile: true,
6718
- influxdbDataType: "intField"
6719
- /* intField */
6720
- },
6721
- {
6722
- fieldName: "connectionPoolCount",
6723
- gauge: Gauge.CONNECTION_POOL_TOTAL_GAUGE,
6724
- instrumentProperty: "val",
6725
- dataType: "number",
6726
- influxdbDataType: "intField"
6727
- /* intField */
6728
- },
6729
- {
6730
- fieldName: "connectionIdleCount",
6731
- gauge: Gauge.CONNECTION_POOL_IDLE_GAUGE,
6732
- instrumentProperty: "val",
6733
- dataType: "number",
6734
- influxdbDataType: "intField"
6735
- /* intField */
6736
- },
6737
- {
6738
- fieldName: "connectionWaitingCount",
6739
- gauge: Gauge.CONNECTION_POOL_WAITING_GAUGE,
6740
- instrumentProperty: "val",
6741
- dataType: "number",
6742
- influxdbDataType: "intField"
6743
- /* intField */
6744
- },
6745
- {
6746
- fieldName: "systemcpu",
6747
- gauge: Gauge.CPU_SYSTEM_LOAD_GAUGE,
6748
- instrumentProperty: "val",
6749
- dataType: "number",
6750
- timeSeriesIndex: true,
6751
- quantile: true,
6752
- influxdbDataType: "floatField"
6753
- /* floatField */
6681
+ influxdbDataType: "intField",
6682
+ gaugeType: GaugeTypes.INSTRUMENT_GAUGE,
6683
+ instrumentOptions: {
6684
+ interval: instrumentationObservationInterval,
6685
+ sampleSize: instrumentationTimeWindow
6686
+ }
6754
6687
  },
6688
+ { fieldName: "connectionPoolCount", gauge: Gauge.CONNECTION_POOL_TOTAL_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
6689
+ { fieldName: "connectionIdleCount", gauge: Gauge.CONNECTION_POOL_IDLE_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
6690
+ { fieldName: "connectionWaitingCount", gauge: Gauge.CONNECTION_POOL_WAITING_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
6691
+ { fieldName: "systemcpu", gauge: Gauge.CPU_SYSTEM_LOAD_GAUGE, instrumentProperty: "val", dataType: "number", timeSeriesIndex: true, quantile: true, influxdbDataType: "floatField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
6755
6692
  {
6756
6693
  fieldName: "memory",
6757
6694
  gauge: Gauge.OBJECT_GAUGE,
6758
6695
  instrumentProperty: "val",
6759
6696
  dataType: "JSON",
6760
- influxdbDataType: "stringField"
6761
- /* stringField */
6697
+ influxdbDataType: "stringField",
6698
+ gaugeType: GaugeTypes.INSTRUMENT_OBJECT,
6699
+ instrumentOptions: {
6700
+ label: "InstrumentObjectMaster"
6701
+ }
6762
6702
  }
6763
6703
  ],
6764
6704
  GetPathFromContext(context) {
@@ -6804,14 +6744,7 @@ const globalServiceDefinitions = {
6804
6744
  instantPrefix: "/agentInstant:"
6805
6745
  },
6806
6746
  fieldList: [
6807
- {
6808
- fieldName: "childCount",
6809
- gauge: Gauge.CHILD_COUNT,
6810
- instrumentProperty: "val",
6811
- dataType: "number",
6812
- influxdbDataType: "intField"
6813
- /* intField */
6814
- }
6747
+ { fieldName: "childCount", gauge: Gauge.CHILD_COUNT, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE }
6815
6748
  ],
6816
6749
  //@@ need type declare in appframework ?? agent does not use appframework ... perhaps stspublisher
6817
6750
  GetPathFromContext(context) {
@@ -6863,68 +6796,13 @@ const globalServiceDefinitions = {
6863
6796
  instantPrefix: "/lambdaInstant:"
6864
6797
  },
6865
6798
  fieldList: [
6866
- {
6867
- fieldName: "cpu",
6868
- gauge: Gauge.CPU_LOAD_GAUGE,
6869
- instrumentProperty: "val",
6870
- dataType: "number",
6871
- timeSeriesIndex: true,
6872
- quantile: true,
6873
- influxdbDataType: "floatField"
6874
- /* floatField */
6875
- },
6876
- {
6877
- fieldName: "connectionCount",
6878
- gauge: Gauge.CONNECTION_COUNT_GAUGE,
6879
- instrumentProperty: "val",
6880
- dataType: "number",
6881
- timeSeriesIndex: true,
6882
- quantile: true,
6883
- influxdbDataType: "intField"
6884
- /* intField */
6885
- },
6886
- {
6887
- fieldName: "connectionPoolCount",
6888
- gauge: Gauge.CONNECTION_POOL_TOTAL_GAUGE,
6889
- instrumentProperty: "val",
6890
- dataType: "number",
6891
- influxdbDataType: "intField"
6892
- /* intField */
6893
- },
6894
- {
6895
- fieldName: "connectionIdleCount",
6896
- gauge: Gauge.CONNECTION_POOL_IDLE_GAUGE,
6897
- instrumentProperty: "val",
6898
- dataType: "number",
6899
- influxdbDataType: "intField"
6900
- /* intField */
6901
- },
6902
- {
6903
- fieldName: "connectionWaitingCount",
6904
- gauge: Gauge.CONNECTION_POOL_WAITING_GAUGE,
6905
- instrumentProperty: "val",
6906
- dataType: "number",
6907
- influxdbDataType: "intField"
6908
- /* intField */
6909
- },
6910
- {
6911
- fieldName: "systemcpu",
6912
- gauge: Gauge.CPU_SYSTEM_LOAD_GAUGE,
6913
- instrumentProperty: "val",
6914
- dataType: "number",
6915
- timeSeriesIndex: true,
6916
- quantile: true,
6917
- influxdbDataType: "floatField"
6918
- /* floatField */
6919
- },
6920
- {
6921
- fieldName: "memory",
6922
- gauge: Gauge.OBJECT_GAUGE,
6923
- instrumentProperty: "val",
6924
- dataType: "JSON",
6925
- influxdbDataType: "stringField"
6926
- /* stringField */
6927
- }
6799
+ { fieldName: "cpu", gauge: Gauge.CPU_LOAD_GAUGE, instrumentProperty: "val", dataType: "number", timeSeriesIndex: true, quantile: true, influxdbDataType: "floatField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
6800
+ { fieldName: "connectionCount", gauge: Gauge.CONNECTION_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", timeSeriesIndex: true, quantile: true, influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
6801
+ { fieldName: "connectionPoolCount", gauge: Gauge.CONNECTION_POOL_TOTAL_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
6802
+ { fieldName: "connectionIdleCount", gauge: Gauge.CONNECTION_POOL_IDLE_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
6803
+ { fieldName: "connectionWaitingCount", gauge: Gauge.CONNECTION_POOL_WAITING_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
6804
+ { fieldName: "systemcpu", gauge: Gauge.CPU_SYSTEM_LOAD_GAUGE, instrumentProperty: "val", dataType: "number", timeSeriesIndex: true, quantile: true, influxdbDataType: "floatField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
6805
+ { fieldName: "memory", gauge: Gauge.OBJECT_GAUGE, instrumentProperty: "val", dataType: "JSON", influxdbDataType: "stringField", gaugeType: GaugeTypes.INSTRUMENT_OBJECT }
6928
6806
  ],
6929
6807
  //@@ need type declare in appframework
6930
6808
  GetPathFromContext(context) {
@@ -6961,6 +6839,25 @@ const globalServiceDefinitions = {
6961
6839
  }
6962
6840
  }
6963
6841
  };
6842
+ const GetInstruments = (service) => {
6843
+ const fieldList = [
6844
+ ...globalServiceDefinitions.coreFieldList,
6845
+ ...globalServiceDefinitions.logFieldList,
6846
+ ...globalServiceDefinitions.services[service].fieldList
6847
+ ];
6848
+ const retVal = [];
6849
+ fieldList.forEach((v) => {
6850
+ if (v.instrumentOptions) {
6851
+ retVal.push([v.gauge, v.gaugeType, v.instrumentOptions]);
6852
+ } else {
6853
+ retVal.push([v.gauge, v.gaugeType]);
6854
+ }
6855
+ if (v.histo) {
6856
+ retVal.push([v.histoGaugeType, GaugeTypes.INSTRUMENT_HISTOGRAM]);
6857
+ }
6858
+ });
6859
+ return retVal;
6860
+ };
6964
6861
  export {
6965
6862
  AgentInstrumentController,
6966
6863
  CompareSTSInstrumentControllerPluginKey,
@@ -6968,6 +6865,7 @@ export {
6968
6865
  Gauge,
6969
6866
  GaugeTypes,
6970
6867
  GetInstrumentName,
6868
+ GetInstruments,
6971
6869
  GetSTSInstrumentController,
6972
6870
  GetSTSInstrumentControllerPluginKey,
6973
6871
  GetSocketIOSubscriptionKey,