@saidsef/tracing-node 3.7.2 → 3.8.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
@@ -7,17 +7,14 @@
7
7
  ![GitHub release(latest by date)](https://img.shields.io/github/v/release/saidsef/tracing-node)
8
8
  ![Commits](https://img.shields.io/github/commits-since/saidsef/tracing-node/latest.svg)
9
9
 
10
-
11
-
12
-
13
10
  Get telemetry for your app in less than 3 minutes!
14
11
 
15
- A wrapper around opentelemetry and set of instrumentation applications. This is to make instrumentation (more) idempotent.
12
+ Effortlessly supercharge your applications with world-class distributed tracing! This OpenTelemetry wrapper delivers seamless, lightning-fast observability, empowering developers to monitor, debug, and optimise microservices with ease. Designed for modern cloud-native environments, it’s the smart choice for engineers who demand reliability, scalability, and actionable insights. Get started in minutes and unlock the full potential of your service architecture—no fuss, just results. This is to make instrumentation (more) idempotent.
16
13
 
17
14
  ## Prerequisites
18
15
  - NodeJS
19
16
  - ...
20
- - Profit!
17
+ - Profit?
21
18
 
22
19
  ## Instalation
23
20
 
@@ -30,18 +27,13 @@ npm install @saidsef/tracing-node --save
30
27
  You can set required params via env variables or function:
31
28
 
32
29
  Env vars:
33
- ```
34
- CONTAINER_NAME || HOSTNAME
35
- ENDPOINT
36
- SERVICE_NAME
37
- ```
30
+ | Environment Variable | Description | Required |
31
+ |-----------------------|----------------------------| --------- |
32
+ | CONTAINER_NAME/HOSTNAME| Container or pod hostname | No |
33
+ | ENDPOINT | Tracing collector endpoint | Yes |
34
+ | SERVICE_NAME | Service/application name | Yes |
38
35
 
39
36
  Function args
40
- ```
41
- const { setupTracing } = require('@saidsef/tracing-node');
42
- setupTracing({hostname: 'hostname', serviceName: 'service_name', url: 'endpoint'});
43
- ```
44
-
45
37
  ```
46
38
  import { setupTracing } from '@saidsef/tracing-node';
47
39
  setupTracing({hostname: 'hostname', serviceName: 'service_name', url: 'endpoint'});
@@ -49,13 +41,13 @@ setupTracing({hostname: 'hostname', serviceName: 'service_name', url: 'endpoint'
49
41
 
50
42
  ### Required Parameters are
51
43
 
52
- | Name | Type | Description|
53
- |----- | ---- | ------------- |
54
- | hostname | string | container / pod hostname |
55
- | serviceName | string | service / application name |
56
- | url | string | tracing endpoint i.e. `<schema>://<host>:<port>` |
57
- | enableFsInstrumentation | boolean | enable FS instrumentation, default `false` |
58
- | enableDnsInstrumentation | boolean | enable DNS instrumentation, default `false` |
44
+ | Name | Type | Description| Required | Default |
45
+ |----- | ---- | ------------- | ----- | ---- |
46
+ | hostname | string | container / pod hostname | No | `hostname` |
47
+ | serviceName | string | service / application name | Yes | `n/a` |
48
+ | url | string | tracing endpoint i.e. `<schema>://<host>:<port>` | Yes | `n/a` |
49
+ | enableFsInstrumentation | boolean | enable FS instrumentation | No | `false` |
50
+ | enableDnsInstrumentation | boolean | enable DNS instrumentation | No | `false` |
59
51
 
60
52
  ## Source
61
53
 
package/libs/index.mjs CHANGED
@@ -31,7 +31,7 @@ import {PinoInstrumentation} from '@opentelemetry/instrumentation-pino';
31
31
  import {IORedisInstrumentation} from '@opentelemetry/instrumentation-ioredis';
32
32
  import {registerInstrumentations} from '@opentelemetry/instrumentation';
33
33
  import {FsInstrumentation} from '@opentelemetry/instrumentation-fs';
34
- import {resourceFromAttributes, detectResources, envDetector, hostDetector, osDetector, processDetector} from '@opentelemetry/resources';
34
+ import {resourceFromAttributes, detectResources, envDetector, hostDetector, osDetector, processDetector, serviceInstanceIdDetector} from '@opentelemetry/resources';
35
35
  import {ATTR_SERVICE_NAME} from '@opentelemetry/semantic-conventions';
36
36
  import {ATTR_CONTAINER_NAME} from '@opentelemetry/semantic-conventions/incubating';
37
37
 
@@ -84,7 +84,7 @@ export function setupTracing(options = {}) {
84
84
  [ATTR_CONTAINER_NAME]: hostname,
85
85
  }).merge(
86
86
  detectResources({
87
- detectors: [envDetector, hostDetector, osDetector, processDetector],
87
+ detectors: [envDetector, hostDetector, osDetector, processDetector, serviceInstanceIdDetector],
88
88
  })
89
89
  ),
90
90
  autoDetectResources: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saidsef/tracing-node",
3
- "version": "3.7.2",
3
+ "version": "3.8.0",
4
4
  "description": "tracing NodeJS - Wrapper for OpenTelemetry instrumentation packages",
5
5
  "main": "libs/index.mjs",
6
6
  "scripts": {