@ogcio/o11y-sdk-node 0.7.0 → 0.7.1

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,13 +7,13 @@ The NodeJS observability sdk is a npm package used to setup and implement opente
7
7
  pnpm
8
8
 
9
9
  ```bash
10
- pnpm i --save @ogcio/o11y-sdk-node
10
+ pnpm i --save @ogcio/o11y-sdk-node
11
11
  ```
12
12
 
13
13
  npm
14
14
 
15
15
  ```bash
16
- npm i @ogcio/o11y-sdk-node
16
+ npm i @ogcio/o11y-sdk-node
17
17
  ```
18
18
 
19
19
  ## Usage
@@ -9,6 +9,7 @@ export default function buildConsoleExporters(config) {
9
9
  ..._spansProcessorConfig(config),
10
10
  ],
11
11
  metrics: new metrics.PeriodicExportingMetricReader({
12
+ exportIntervalMillis: config.metrics?.exportIntervalMs,
12
13
  exporter: new metrics.ConsoleMetricExporter(),
13
14
  }),
14
15
  logs: [
@@ -24,6 +24,7 @@ export default async function buildGrpcExporters(config) {
24
24
  ..._spansProcessorConfig(config),
25
25
  ],
26
26
  metrics: new metrics.PeriodicExportingMetricReader({
27
+ exportIntervalMillis: config.metrics?.exportIntervalMs,
27
28
  exporter: new PIIExporterDecorator(new OTLPMetricExporter({
28
29
  url: `${config.collectorUrl}`,
29
30
  compression: CompressionAlgorithm.GZIP,
@@ -20,6 +20,7 @@ export default function buildHttpExporters(config) {
20
20
  ..._spansProcessorConfig(config),
21
21
  ],
22
22
  metrics: new metrics.PeriodicExportingMetricReader({
23
+ exportIntervalMillis: config.metrics?.exportIntervalMs,
23
24
  exporter: new PIIExporterDecorator(new OTLPMetricExporter({
24
25
  url: `${config.collectorUrl}/v1/metrics`,
25
26
  compression: CompressionAlgorithm.GZIP,
@@ -54,6 +54,14 @@ export interface NodeSDKConfig {
54
54
  * @default 1
55
55
  */
56
56
  traceRatio?: number;
57
+ metrics?: {
58
+ /**
59
+ * Delay in milliseconds for the metric reader to initiate metric collection.
60
+ *
61
+ * @default 60_000
62
+ */
63
+ exportIntervalMs?: number;
64
+ };
57
65
  /**
58
66
  * Flag to enable or disable the tracing for node:fs module
59
67
  *
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ogcio/o11y-sdk-node",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "description": "Opentelemetry standard instrumentation SDK for NodeJS based project",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -9,8 +9,11 @@
9
9
  "test": "vitest",
10
10
  "prepublishOnly": "pnpm i && rm -rf dist && tsc -p tsconfig.json",
11
11
  "test:unit": "vitest --project unit",
12
- "test:integration": "pnpm --filter @ogcio/o11y run prepare:integration && vitest --project integration",
13
- "test:integration:dryrun": "vitest --project integration"
12
+ "test:integration": "pnpm test:integration:setup && pnpm test:integration:run && pnpm test:integration:assert && pnpm test:integration:teardown",
13
+ "test:integration:setup": "sh ./test/integration/setup.sh integration",
14
+ "test:integration:run": "pnpm --filter @ogcio/o11y run prepare:integration",
15
+ "test:integration:assert": "vitest --project integration",
16
+ "test:integration:teardown": "sh ./test/integration/teardown.sh integration"
14
17
  },
15
18
  "exports": {
16
19
  ".": "./dist/sdk-node/index.js",
@@ -30,7 +33,7 @@
30
33
  "author": "team:ogcio/observability",
31
34
  "license": "ISC",
32
35
  "dependencies": {
33
- "@grpc/grpc-js": "1.14.2",
36
+ "@grpc/grpc-js": "1.14.3",
34
37
  "@opentelemetry/api": "1.9.0",
35
38
  "@opentelemetry/api-logs": "0.208.0",
36
39
  "@opentelemetry/auto-instrumentations-node": "0.67.2",
@@ -50,7 +53,7 @@
50
53
  "@opentelemetry/sdk-trace-base": "2.2.0"
51
54
  },
52
55
  "devDependencies": {
53
- "@types/node": "24.10.1",
56
+ "@types/node": "25.0.2",
54
57
  "@vitest/coverage-v8": "4.0.15",
55
58
  "tsx": "4.21.0",
56
59
  "typescript": "5.9.3",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ogcio/o11y-sdk-node",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "description": "Opentelemetry standard instrumentation SDK for NodeJS based project",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -22,7 +22,7 @@
22
22
  "author": "team:ogcio/observability",
23
23
  "license": "ISC",
24
24
  "dependencies": {
25
- "@grpc/grpc-js": "1.14.2",
25
+ "@grpc/grpc-js": "1.14.3",
26
26
  "@opentelemetry/api": "1.9.0",
27
27
  "@opentelemetry/api-logs": "0.208.0",
28
28
  "@opentelemetry/auto-instrumentations-node": "0.67.2",
@@ -42,7 +42,7 @@
42
42
  "@opentelemetry/sdk-trace-base": "2.2.0"
43
43
  },
44
44
  "devDependencies": {
45
- "@types/node": "24.10.1",
45
+ "@types/node": "25.0.2",
46
46
  "@vitest/coverage-v8": "4.0.15",
47
47
  "tsx": "4.21.0",
48
48
  "typescript": "5.9.3",
@@ -55,7 +55,10 @@
55
55
  "build": "rm -rf dist && tsc -p tsconfig.json",
56
56
  "test": "vitest",
57
57
  "test:unit": "vitest --project unit",
58
- "test:integration": "pnpm --filter @ogcio/o11y run prepare:integration && vitest --project integration",
59
- "test:integration:dryrun": "vitest --project integration"
58
+ "test:integration": "pnpm test:integration:setup && pnpm test:integration:run && pnpm test:integration:assert && pnpm test:integration:teardown",
59
+ "test:integration:setup": "sh ./test/integration/setup.sh integration",
60
+ "test:integration:run": "pnpm --filter @ogcio/o11y run prepare:integration",
61
+ "test:integration:assert": "vitest --project integration",
62
+ "test:integration:teardown": "sh ./test/integration/teardown.sh integration"
60
63
  }
61
64
  }