@mhubcloud/tms_core 3.7.1 → 3.7.2

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.
Files changed (2) hide show
  1. package/dist/index.js +22 -18
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -107,26 +107,30 @@ function logEvent(publisher2, event, region, status, payload, id) {
107
107
  let message = "";
108
108
  if (status || status === 0) {
109
109
  if (status >= 200 && status < 300) {
110
- aiClient?.trackMetric({
111
- name: `DispatchSuccess`,
112
- value: 1,
113
- properties: {
114
- publisher: publisher2,
115
- event,
116
- region
117
- }
118
- });
110
+ if (!process.env["DisableMetrics"]) {
111
+ aiClient?.trackMetric({
112
+ name: `DispatchSuccess`,
113
+ value: 1,
114
+ properties: {
115
+ publisher: publisher2,
116
+ event,
117
+ region
118
+ }
119
+ });
120
+ }
119
121
  message = "Event dispatched to platform";
120
122
  } else {
121
- aiClient?.trackMetric({
122
- name: `DispatchFail`,
123
- value: 1,
124
- properties: {
125
- publisher: publisher2,
126
- event,
127
- region
128
- }
129
- });
123
+ if (!process.env["DisableMetrics"]) {
124
+ aiClient?.trackMetric({
125
+ name: `DispatchFail`,
126
+ value: 1,
127
+ properties: {
128
+ publisher: publisher2,
129
+ event,
130
+ region
131
+ }
132
+ });
133
+ }
130
134
  message = "Event dispatch failed";
131
135
  }
132
136
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mhubcloud/tms_core",
3
- "version": "3.7.1",
3
+ "version": "3.7.2",
4
4
  "description": "Core function for mHub Cloud TMS publishers",
5
5
  "homepage": "https://mhubcloud.com/",
6
6
  "license": "Apache 2.0",