@felloh-org/lambda-wrapper 1.11.39 → 1.11.40

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.
@@ -21,7 +21,6 @@ class DependencyInjection {
21
21
  constructor(configuration, event, context) {
22
22
  this.event = event;
23
23
  this.context = context;
24
- this.lumigo = null;
25
24
  this.dependencies = {};
26
25
  this.configuration = configuration;
27
26
 
@@ -130,33 +129,6 @@ class DependencyInjection {
130
129
  get definitions() {
131
130
  return this.configuration.DEFINITIONS;
132
131
  }
133
- /**
134
- * Set Lumigo
135
- * @param lumigo
136
- */
137
-
138
-
139
- setLumigo(lumigo) {
140
- this.lumigo = lumigo;
141
- }
142
- /**
143
- * Get Lumigo
144
- * @return {null}
145
- */
146
-
147
-
148
- getLumigo() {
149
- return this.lumigo;
150
- }
151
- /**
152
- * Check to see whether lumigo is enabled
153
- * @return {boolean}
154
- */
155
-
156
-
157
- lumigoIsEnabled() {
158
- return this.lumigo !== null;
159
- }
160
132
 
161
133
  }
162
134
 
@@ -17,8 +17,6 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
17
17
  class Logger extends _dependencyAware.default {
18
18
  constructor(di) {
19
19
  super(di);
20
- this.lumigo = di.getLumigo();
21
- this.lumigoIsEnabled = di.lumigoIsEnabled();
22
20
  this.winston = null;
23
21
  }
24
22
  /**
@@ -136,12 +134,6 @@ class Logger extends _dependencyAware.default {
136
134
 
137
135
 
138
136
  error(error, message = '') {
139
- if (this.lumigoIsEnabled) {
140
- this.lumigo.error('error', {
141
- err: error
142
- });
143
- }
144
-
145
137
  this.logger.log('error', message, {
146
138
  error: this.processMessage(error)
147
139
  });
@@ -156,10 +148,6 @@ class Logger extends _dependencyAware.default {
156
148
 
157
149
 
158
150
  info(message) {
159
- if (this.lumigoIsEnabled) {
160
- this.lumigo.info(message);
161
- }
162
-
163
151
  this.logger.log('info', this.processMessage(message));
164
152
  }
165
153
  /**
@@ -178,12 +166,6 @@ class Logger extends _dependencyAware.default {
178
166
  warning(error) {
179
167
  const softWarningValues = ['true', '1'];
180
168
 
181
- if (this.lumigoIsEnabled) {
182
- this.lumigo.info('warning', {
183
- err: error
184
- });
185
- }
186
-
187
169
  if (softWarningValues.includes(process.env.LOGGER_SOFT_WARNING)) {
188
170
  return this.info(error);
189
171
  }
@@ -199,10 +181,6 @@ class Logger extends _dependencyAware.default {
199
181
 
200
182
 
201
183
  label(descriptor, silent = false) {
202
- if (this.lumigoIsEnabled) {
203
- this.lumigo.addExecutionTag(descriptor);
204
- }
205
-
206
184
  if (silent === false) {
207
185
  this.logger.log('info', `label - ${descriptor}`);
208
186
  }
@@ -217,10 +195,6 @@ class Logger extends _dependencyAware.default {
217
195
 
218
196
 
219
197
  metric(descriptor, stat, silent = false) {
220
- if (this.lumigoIsEnabled) {
221
- this.lumigo.addExecutionTag(descriptor, stat);
222
- }
223
-
224
198
  if (silent === false) {
225
199
  this.logger.log('info', `metric - ${descriptor} - ${stat}`);
226
200
  }
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.handleSuccess = exports.handleError = exports.default = void 0;
7
7
 
8
- var _tracer = _interopRequireDefault(require("@lumigo/tracer"));
8
+ var _lambdaNodeOpentelemetry = _interopRequireDefault(require("@baselime/lambda-node-opentelemetry"));
9
9
 
10
10
  var _dependencies = require("../config/dependencies");
11
11
 
@@ -85,17 +85,8 @@ const handleError = (di, error) => {
85
85
  exports.handleError = handleError;
86
86
 
87
87
  const wrapper = (configuration, handler, throwError = false) => {
88
- let lumigo = null;
89
-
90
- if (typeof process.env.LUMIGO_TOKEN === 'string' && process.env.LUMIGO_TOKEN !== 'undefined') {
91
- lumigo = (0, _tracer.default)({
92
- token: process.env.LUMIGO_TOKEN
93
- });
94
- }
95
-
96
88
  let instance = (event, context, callback) => {
97
89
  const di = new _dependencyInjection.default(configuration, event, context);
98
- di.setLumigo(lumigo);
99
90
  const request = di.get(_dependencies.DEFINITIONS.REQUEST);
100
91
  const logger = di.get(_dependencies.DEFINITIONS.LOGGER);
101
92
  context.callbackWaitsForEmptyEventLoop = false; // If the event is to trigger a warm up, then don't bother returning the function.
@@ -143,11 +134,10 @@ const wrapper = (configuration, handler, throwError = false) => {
143
134
  }
144
135
 
145
136
  return outcome;
146
- }; // If the Lumigo token is enabled, then wrap the instance in the Lumigo wrapper
147
-
137
+ };
148
138
 
149
- if (lumigo !== null) {
150
- instance = lumigo.trace(instance);
139
+ if (typeof process.env.BASELIME_KEY !== 'undefined') {
140
+ instance = _lambdaNodeOpentelemetry.default.wrap(instance);
151
141
  }
152
142
 
153
143
  return instance;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@felloh-org/lambda-wrapper",
3
- "version": "1.11.39",
3
+ "version": "1.11.40",
4
4
  "description": "Lambda wrapper for all Felloh Serverless Projects",
5
5
  "main": "dist/index.js",
6
6
  "engines": {
@@ -54,7 +54,10 @@
54
54
  "aws-sdk": ">=2.831.0"
55
55
  },
56
56
  "dependencies": {
57
+ "@baselime/lambda-node-opentelemetry": "^0.2.13",
58
+ "@baselime/node-opentelemetry": "^0.1.0",
57
59
  "@lumigo/tracer": "^1.83.0",
60
+ "@opentelemetry/auto-instrumentations-node": "^0.39.2",
58
61
  "alai": "^1.0.3",
59
62
  "async": "^3.2.3",
60
63
  "axios": "^0.26.1",