@saidsef/tracing-node 1.9.8 → 1.10.0

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.
package/README.md CHANGED
@@ -23,12 +23,12 @@ npm install @saidsef/tracing-node --save
23
23
  ## Usage
24
24
 
25
25
  ```
26
- const setupTracing = require('@saidsef/tracing-node');
26
+ const { setupTracing } = require('@saidsef/tracing-node');
27
27
  setupTracing('hostname', 'application_name', 'endpoint');
28
28
  ```
29
29
 
30
30
  ```
31
- import setupTracing from '@saidsef/tracing-node';
31
+ import { setupTracing } from '@saidsef/tracing-node';
32
32
  setupTracing('hostname', 'application_name', 'endpoint');
33
33
  ```
34
34
 
package/libs/index.mjs CHANGED
@@ -55,7 +55,7 @@ diag.setLogger(new DiagConsoleLogger(), DiagLogLevel.INFO);
55
55
  * be used to create and export spans for tracing various operations within
56
56
  * the service.
57
57
  */
58
- export default function setupTracing (serviceName, appName="application", endpoint=null) {
58
+ export async function setupTracing (serviceName, appName="application", endpoint=null) {
59
59
  const provider = new NodeTracerProvider({
60
60
  resource: new Resource({
61
61
  [SemanticResourceAttributes.SERVICE_NAME]: serviceName,
@@ -112,5 +112,5 @@ export default function setupTracing (serviceName, appName="application", endpoi
112
112
  })});
113
113
 
114
114
  // Return the tracer for the service
115
- return provider.getTracer(serviceName);
115
+ return await provider.getTracer(serviceName);
116
116
  }
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@saidsef/tracing-node",
3
- "version": "1.9.8",
3
+ "version": "1.10.0",
4
4
  "description": "tracing NodeJS - This is a wrapper for OpenTelemetry instrumentation packages",
5
5
  "main": "libs/index.mjs",
6
6
  "scripts": {
7
7
  "test": "node --trace-warnings --test --report-uncaught-exception --heap-prof --cpu-prof --track-heap-objects --report-dir=test/ --diagnostic-dir=test/ --heap-prof-dir=test/ libs/index.mjs",
8
8
  "lint": "eslint libs -c .eslintrc.yml ",
9
- "rebuild": "rm -rfv node_modules/ package-lock.json && NODE_ENV=production npm install"
9
+ "rebuild": "rm -rfv node_modules/ package-lock.json && npm install --prod --omit=dev"
10
10
  },
11
11
  "type": "module",
12
12
  "private": false,
@@ -31,7 +31,7 @@
31
31
  "author": "Said Sef <saidsef@gmail.com>",
32
32
  "license": "Apache-2.0",
33
33
  "engines": {
34
- "node": ">= 19"
34
+ "node": ">= 20"
35
35
  },
36
36
  "bugs": {
37
37
  "url": "https://github.com/saidsef/tracing-nodejs/issues"