@saidsef/tracing-node 2.1.0 → 2.2.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 +17 -3
- package/deployment/base/job.yml +1 -1
- package/libs/index.mjs +1 -1
- package/package.json +14 -14
package/README.md
CHANGED
|
@@ -22,14 +22,28 @@ npm install @saidsef/tracing-node --save
|
|
|
22
22
|
|
|
23
23
|
## Usage
|
|
24
24
|
|
|
25
|
+
You can set required params via env variables or function:
|
|
26
|
+
|
|
27
|
+
Env vars:
|
|
28
|
+
```
|
|
29
|
+
CONTAINER_NAME
|
|
30
|
+
NODE_ENV
|
|
31
|
+
HOSTNAME
|
|
32
|
+
SERVICE_NAME
|
|
33
|
+
NAME_SPACE
|
|
34
|
+
SERVICE_VERSION
|
|
35
|
+
ENDPOINT
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Function args
|
|
25
39
|
```
|
|
26
40
|
const { setupTracing } = require('@saidsef/tracing-node');
|
|
27
|
-
setupTracing('hostname', '
|
|
41
|
+
setupTracing({hostname: 'hostname', serviceName: 'service_name', endpoint: 'endpoint'});
|
|
28
42
|
```
|
|
29
43
|
|
|
30
44
|
```
|
|
31
45
|
import { setupTracing } from '@saidsef/tracing-node';
|
|
32
|
-
setupTracing('hostname', '
|
|
46
|
+
setupTracing({hostname: 'hostname', serviceName: 'service_name', endpoint: 'endpoint'});
|
|
33
47
|
```
|
|
34
48
|
|
|
35
49
|
### Required Parameters are
|
|
@@ -37,7 +51,7 @@ setupTracing('hostname', 'application_name', 'endpoint');
|
|
|
37
51
|
| Name | Type | Description|
|
|
38
52
|
|----- | ---- | ------------- |
|
|
39
53
|
| hostname | string | container / pod hostname |
|
|
40
|
-
|
|
|
54
|
+
| service_name | string | service / application name |
|
|
41
55
|
| endpoint | string | tracing endpoint i.e. `<schema>://<host>:<port>` |
|
|
42
56
|
|
|
43
57
|
## Source
|
package/deployment/base/job.yml
CHANGED
package/libs/index.mjs
CHANGED
|
@@ -66,7 +66,7 @@ export function setupTracing (options={}) {
|
|
|
66
66
|
|
|
67
67
|
const provider = new NodeTracerProvider({
|
|
68
68
|
resource: new Resource({
|
|
69
|
-
[SemanticResourceAttributes.CONTAINER_NAME]: containerName,
|
|
69
|
+
[SemanticResourceAttributes.CONTAINER_NAME]: containerName || serviceName,
|
|
70
70
|
[SemanticResourceAttributes.DEPLOYMENT_ENVIRONMENT]: deploymentEnvironment,
|
|
71
71
|
[SemanticResourceAttributes.HOSTNAME]: hostname,
|
|
72
72
|
[SemanticResourceAttributes.SERVICE_NAME]: serviceName,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@saidsef/tracing-node",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"description": "tracing NodeJS - This is a wrapper for OpenTelemetry instrumentation packages",
|
|
5
5
|
"main": "libs/index.mjs",
|
|
6
6
|
"scripts": {
|
|
@@ -38,19 +38,19 @@
|
|
|
38
38
|
},
|
|
39
39
|
"homepage": "https://github.com/saidsef/tracing-nodejs#readme",
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@opentelemetry/api": "^1.
|
|
42
|
-
"@opentelemetry/exporter-trace-otlp-grpc": "^0.
|
|
43
|
-
"@opentelemetry/instrumentation": "^0.
|
|
44
|
-
"@opentelemetry/instrumentation-aws-sdk": "^0.
|
|
45
|
-
"@opentelemetry/instrumentation-dns": "^0.
|
|
46
|
-
"@opentelemetry/instrumentation-express": "^0.
|
|
47
|
-
"@opentelemetry/instrumentation-http": "^0.
|
|
48
|
-
"@opentelemetry/instrumentation-pino": "^0.
|
|
49
|
-
"@opentelemetry/propagator-b3": "^1.
|
|
50
|
-
"@opentelemetry/resources": "^1.
|
|
51
|
-
"@opentelemetry/sdk-trace-base": "^1.
|
|
52
|
-
"@opentelemetry/sdk-trace-node": "^1.
|
|
53
|
-
"@opentelemetry/semantic-conventions": "^1.
|
|
41
|
+
"@opentelemetry/api": "^1.9.0",
|
|
42
|
+
"@opentelemetry/exporter-trace-otlp-grpc": "^0.52.0",
|
|
43
|
+
"@opentelemetry/instrumentation": "^0.52.0",
|
|
44
|
+
"@opentelemetry/instrumentation-aws-sdk": "^0.42.0",
|
|
45
|
+
"@opentelemetry/instrumentation-dns": "^0.37.0",
|
|
46
|
+
"@opentelemetry/instrumentation-express": "^0.40.1",
|
|
47
|
+
"@opentelemetry/instrumentation-http": "^0.52.0",
|
|
48
|
+
"@opentelemetry/instrumentation-pino": "^0.40.0",
|
|
49
|
+
"@opentelemetry/propagator-b3": "^1.25.0",
|
|
50
|
+
"@opentelemetry/resources": "^1.25.0",
|
|
51
|
+
"@opentelemetry/sdk-trace-base": "^1.25.0",
|
|
52
|
+
"@opentelemetry/sdk-trace-node": "^1.25.0",
|
|
53
|
+
"@opentelemetry/semantic-conventions": "^1.25.0"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"eslint": "^8.57.0",
|