@fastify/otel
Advanced tools
+7
-0
@@ -5,2 +5,9 @@ # Changelog | ||
| ## [0.14.0](https://github.com/fastify/otel/compare/v0.13.1...v0.14.0) (2025-11-14) | ||
| ### Features | ||
| * upgrade @opentelemetry/sdk-trace-node ([#109](https://github.com/fastify/otel/issues/109)) ([0aada51](https://github.com/fastify/otel/commit/0aada51dce6b33cf4281cf568915379aa79e56a5)) | ||
| ### [0.13.1](https://github.com/fastify/otel/compare/v0.13.0...v0.13.1) (2025-11-07) | ||
@@ -7,0 +14,0 @@ |
+2
-2
| { | ||
| "name": "@fastify/otel", | ||
| "version": "0.13.1", | ||
| "version": "0.14.0", | ||
| "description": "Official Fastify OpenTelemetry Instrumentation", | ||
@@ -54,3 +54,3 @@ "main": "index.js", | ||
| "@opentelemetry/sdk-trace-base": "^2.0.0", | ||
| "@opentelemetry/sdk-trace-node": "^1.29.0", | ||
| "@opentelemetry/sdk-trace-node": "^2.2.0", | ||
| "@types/node": "^24.0.8", | ||
@@ -57,0 +57,0 @@ "c8": "^10.1.2", |
@@ -37,6 +37,7 @@ 'use strict' | ||
| const memoryExporter = new InMemorySpanExporter() | ||
| const provider = new NodeTracerProvider() | ||
| const spanProcessor = new SimpleSpanProcessor(memoryExporter) | ||
| const provider = new NodeTracerProvider({ | ||
| spanProcessors: [spanProcessor] | ||
| }) | ||
| provider.addSpanProcessor(spanProcessor) | ||
| context.setGlobalContextManager(contextManager) | ||
@@ -79,3 +80,3 @@ httpInstrumentation.setTracerProvider(provider) | ||
| .getFinishedSpans() | ||
| .filter(span => span.instrumentationLibrary.name === '@fastify/otel') | ||
| .filter(span => span.instrumentationScope.name === '@fastify/otel') | ||
@@ -82,0 +83,0 @@ const [end, start] = spans |
+52
-52
@@ -87,3 +87,3 @@ 'use strict' | ||
| .getFinishedSpans() | ||
| .find(span => span.instrumentationLibrary.name === '@fastify/otel') | ||
| .find(span => span.instrumentationScope.name === '@fastify/otel') | ||
@@ -126,3 +126,3 @@ assert.ok(spans == null) | ||
| .getFinishedSpans() | ||
| .find(span => span.instrumentationLibrary.name === '@fastify/otel') | ||
| .find(span => span.instrumentationScope.name === '@fastify/otel') | ||
@@ -165,3 +165,3 @@ assert.ok(spans == null) | ||
| .getFinishedSpans() | ||
| .find(span => span.instrumentationLibrary.name === '@fastify/otel') | ||
| .find(span => span.instrumentationScope.name === '@fastify/otel') | ||
@@ -200,3 +200,3 @@ assert.ok(spans == null) | ||
| .getFinishedSpans() | ||
| .find(span => span.instrumentationLibrary.name === '@fastify/otel') | ||
| .find(span => span.instrumentationScope.name === '@fastify/otel') | ||
@@ -272,3 +272,3 @@ assert.ok(spans == null) | ||
| .getFinishedSpans() | ||
| .filter(span => span.instrumentationLibrary.name === '@fastify/otel') | ||
| .filter(span => span.instrumentationScope.name === '@fastify/otel') | ||
@@ -305,3 +305,3 @@ assert.equal(spans.length, 0) | ||
| .getFinishedSpans() | ||
| .filter(span => span.instrumentationLibrary.name === '@fastify/otel') | ||
| .filter(span => span.instrumentationScope.name === '@fastify/otel') | ||
@@ -331,3 +331,3 @@ assert.equal(spans.length, 0) | ||
| .getFinishedSpans() | ||
| .filter(span => span.instrumentationLibrary.name === '@fastify/otel') | ||
| .filter(span => span.instrumentationScope.name === '@fastify/otel') | ||
@@ -391,3 +391,3 @@ const [end, start] = spans | ||
| .getFinishedSpans() | ||
| .filter(span => span.instrumentationLibrary.name === '@fastify/otel') | ||
| .filter(span => span.instrumentationScope.name === '@fastify/otel') | ||
| const [httpSpan] = memoryExporter | ||
@@ -397,3 +397,3 @@ .getFinishedSpans() | ||
| span => | ||
| span.instrumentationLibrary.name === | ||
| span.instrumentationScope.name === | ||
| '@opentelemetry/instrumentation-http' | ||
@@ -420,5 +420,5 @@ ) | ||
| }) | ||
| assert.equal(end.parentSpanId, start.spanContext().spanId) | ||
| assert.equal(start.parentSpanId, httpSpan.spanContext().spanId) | ||
| assert.equal(httpSpan.parentSpanId, span.spanContext().spanId) | ||
| assert.equal(end.parentSpanContext.spanId, start.spanContext().spanId) | ||
| assert.equal(start.parentSpanContext.spanId, httpSpan.spanContext().spanId) | ||
| assert.equal(httpSpan.parentSpanContext.spanId, span.spanContext().spanId) | ||
| assert.equal(start.spanContext().traceId, span.spanContext().traceId) | ||
@@ -449,3 +449,3 @@ assert.equal(response.status, 200) | ||
| .getFinishedSpans() | ||
| .filter(span => span.instrumentationLibrary.name === '@fastify/otel') | ||
| .filter(span => span.instrumentationScope.name === '@fastify/otel') | ||
@@ -470,3 +470,3 @@ const [end, start] = spans | ||
| }) | ||
| assert.equal(end.parentSpanId, start.spanContext().spanId) | ||
| assert.equal(end.parentSpanContext.spanId, start.spanContext().spanId) | ||
| assert.equal(response.status, 200) | ||
@@ -496,3 +496,3 @@ assert.equal(await response.text(), 'hello world') | ||
| .getFinishedSpans() | ||
| .filter(span => span.instrumentationLibrary.name === '@fastify/otel') | ||
| .filter(span => span.instrumentationScope.name === '@fastify/otel') | ||
@@ -518,3 +518,3 @@ const [end, start] = spans | ||
| }) | ||
| assert.equal(end.parentSpanId, start.spanContext().spanId) | ||
| assert.equal(end.parentSpanContext.spanId, start.spanContext().spanId) | ||
| assert.equal(response.status, 200) | ||
@@ -549,3 +549,3 @@ assert.deepStrictEqual(await response.json(), { userId: '123' }) | ||
| .getFinishedSpans() | ||
| .filter(span => span.instrumentationLibrary.name === '@fastify/otel') | ||
| .filter(span => span.instrumentationScope.name === '@fastify/otel') | ||
@@ -571,3 +571,3 @@ const [end, start] = spans | ||
| }) | ||
| assert.equal(end.parentSpanId, start.spanContext().spanId) | ||
| assert.equal(end.parentSpanContext.spanId, start.spanContext().spanId) | ||
| assert.equal(response.status, 200) | ||
@@ -613,3 +613,3 @@ assert.equal(await response.text(), 'hello world') | ||
| .getFinishedSpans() | ||
| .filter(span => span.instrumentationLibrary.name === '@fastify/otel') | ||
| .filter(span => span.instrumentationScope.name === '@fastify/otel') | ||
@@ -655,3 +655,3 @@ const [preHandler, onReq2, onReq1, end, start] = spans | ||
| }) | ||
| assert.equal(end.parentSpanId, start.spanContext().spanId) | ||
| assert.equal(end.parentSpanContext.spanId, start.spanContext().spanId) | ||
| assert.equal(response.status, 200) | ||
@@ -698,3 +698,3 @@ assert.equal(await response.text(), 'hello world') | ||
| .getFinishedSpans() | ||
| .filter(span => span.instrumentationLibrary.name === '@fastify/otel') | ||
| .filter(span => span.instrumentationScope.name === '@fastify/otel') | ||
@@ -731,3 +731,3 @@ const [preValidation, end, start, onReq1] = spans | ||
| }) | ||
| assert.equal(end.parentSpanId, start.spanContext().spanId) | ||
| assert.equal(end.parentSpanContext.spanId, start.spanContext().spanId) | ||
| assert.equal(response.status, 200) | ||
@@ -761,3 +761,3 @@ assert.equal(await response.text(), 'hello world') | ||
| .getFinishedSpans() | ||
| .filter(span => span.instrumentationLibrary.name === '@fastify/otel') | ||
| .filter(span => span.instrumentationScope.name === '@fastify/otel') | ||
@@ -781,3 +781,3 @@ const [preHandler, start] = spans | ||
| assert.equal(preHandler.status.code, SpanStatusCode.ERROR) | ||
| assert.equal(preHandler.parentSpanId, start.spanContext().spanId) | ||
| assert.equal(preHandler.parentSpanContext.spanId, start.spanContext().spanId) | ||
| assert.equal(response.status, 500) | ||
@@ -807,3 +807,3 @@ }) | ||
| .getFinishedSpans() | ||
| .filter(span => span.instrumentationLibrary.name === '@fastify/otel') | ||
| .filter(span => span.instrumentationScope.name === '@fastify/otel') | ||
@@ -847,3 +847,3 @@ const [start] = spans | ||
| .getFinishedSpans() | ||
| .filter(span => span.instrumentationLibrary.name === '@fastify/otel') | ||
| .filter(span => span.instrumentationScope.name === '@fastify/otel') | ||
@@ -916,3 +916,3 @@ const [start, fof] = spans | ||
| .getFinishedSpans() | ||
| .filter(span => span.instrumentationLibrary.name === '@fastify/otel') | ||
| .filter(span => span.instrumentationScope.name === '@fastify/otel') | ||
@@ -946,5 +946,5 @@ const [preHandler, preValidation, start, fof] = spans | ||
| }) | ||
| assert.equal(fof.parentSpanId, start.spanContext().spanId) | ||
| assert.equal(preValidation.parentSpanId, start.spanContext().spanId) | ||
| assert.equal(preHandler.parentSpanId, start.spanContext().spanId) | ||
| assert.equal(fof.parentSpanContext.spanId, start.spanContext().spanId) | ||
| assert.equal(preValidation.parentSpanContext.spanId, start.spanContext().spanId) | ||
| assert.equal(preHandler.parentSpanContext.spanId, start.spanContext().spanId) | ||
| }) | ||
@@ -1000,3 +1000,3 @@ | ||
| .getFinishedSpans() | ||
| .filter(span => span.instrumentationLibrary.name === '@fastify/otel') | ||
| .filter(span => span.instrumentationScope.name === '@fastify/otel') | ||
@@ -1030,5 +1030,5 @@ const [preHandler, preValidation, start, fof] = spans | ||
| }) | ||
| assert.equal(fof.parentSpanId, start.spanContext().spanId) | ||
| assert.equal(preValidation.parentSpanId, start.spanContext().spanId) | ||
| assert.equal(preHandler.parentSpanId, start.spanContext().spanId) | ||
| assert.equal(fof.parentSpanContext.spanId, start.spanContext().spanId) | ||
| assert.equal(preValidation.parentSpanContext.spanId, start.spanContext().spanId) | ||
| assert.equal(preHandler.parentSpanContext.spanId, start.spanContext().spanId) | ||
| }) | ||
@@ -1064,3 +1064,3 @@ | ||
| .getFinishedSpans() | ||
| .filter(span => span.instrumentationLibrary.name === '@fastify/otel') | ||
| .filter(span => span.instrumentationScope.name === '@fastify/otel') | ||
@@ -1082,3 +1082,3 @@ const [end, start] = spans | ||
| }) | ||
| assert.equal(end.parentSpanId, start.spanContext().spanId) | ||
| assert.equal(end.parentSpanContext.spanId, start.spanContext().spanId) | ||
| assert.equal(response.status, 200) | ||
@@ -1116,3 +1116,3 @@ assert.equal(await response.text(), 'hello world') | ||
| .getFinishedSpans() | ||
| .filter(span => span.instrumentationLibrary.name === '@fastify/otel') | ||
| .filter(span => span.instrumentationScope.name === '@fastify/otel') | ||
@@ -1135,3 +1135,3 @@ const [end, start] = spans | ||
| }) | ||
| assert.equal(end.parentSpanId, start.spanContext().spanId) | ||
| assert.equal(end.parentSpanContext.spanId, start.spanContext().spanId) | ||
| assert.equal(response.status, 500) | ||
@@ -1176,3 +1176,3 @@ assert.deepStrictEqual(await response.json(), { | ||
| .getFinishedSpans() | ||
| .filter(span => span.instrumentationLibrary.name === '@fastify/otel') | ||
| .filter(span => span.instrumentationScope.name === '@fastify/otel') | ||
@@ -1201,3 +1201,3 @@ const [end, start, error] = spans | ||
| }) | ||
| assert.equal(end.parentSpanId, start.spanContext().spanId) | ||
| assert.equal(end.parentSpanContext.spanId, start.spanContext().spanId) | ||
| assert.equal(response.status, 500) | ||
@@ -1247,3 +1247,3 @@ assert.deepStrictEqual(await response.json(), { | ||
| .getFinishedSpans() | ||
| .filter(span => span.instrumentationLibrary.name === '@fastify/otel') | ||
| .filter(span => span.instrumentationScope.name === '@fastify/otel') | ||
@@ -1278,3 +1278,3 @@ const [end, start, error2, error] = spans | ||
| }) | ||
| assert.equal(end.parentSpanId, start.spanContext().spanId) | ||
| assert.equal(end.parentSpanContext.spanId, start.spanContext().spanId) | ||
| assert.equal(response.status, 500) | ||
@@ -1334,3 +1334,3 @@ assert.deepStrictEqual(await response.json(), { | ||
| .getFinishedSpans() | ||
| .find(span => span.instrumentationLibrary.name === '@fastify/otel') | ||
| .find(span => span.instrumentationScope.name === '@fastify/otel') | ||
@@ -1379,3 +1379,3 @@ assert.ok(spans == null) | ||
| .getFinishedSpans() | ||
| .filter(span => span.instrumentationLibrary.name === '@fastify/otel') | ||
| .filter(span => span.instrumentationScope.name === '@fastify/otel') | ||
@@ -1425,3 +1425,3 @@ const [end, start] = spans | ||
| .getFinishedSpans() | ||
| .filter(span => span.instrumentationLibrary.name === '@fastify/otel') | ||
| .filter(span => span.instrumentationScope.name === '@fastify/otel') | ||
@@ -1445,3 +1445,3 @@ const [end, start] = spans | ||
| }) | ||
| assert.equal(end.parentSpanId, start.spanContext().spanId) | ||
| assert.equal(end.parentSpanContext.spanId, start.spanContext().spanId) | ||
| assert.equal(response.status, 200) | ||
@@ -1492,3 +1492,3 @@ assert.equal(await response.text(), 'hello world') | ||
| .getFinishedSpans() | ||
| .filter(span => span.instrumentationLibrary.name === '@fastify/otel') | ||
| .filter(span => span.instrumentationScope.name === '@fastify/otel') | ||
@@ -1525,3 +1525,3 @@ const [preValidation, end, start, onReq1] = spans | ||
| }) | ||
| assert.equal(end.parentSpanId, start.spanContext().spanId) | ||
| assert.equal(end.parentSpanContext.spanId, start.spanContext().spanId) | ||
| assert.equal(response.status, 200) | ||
@@ -1558,3 +1558,3 @@ assert.equal(await response.text(), 'hello world') | ||
| .getFinishedSpans() | ||
| .filter(span => span.instrumentationLibrary.name === '@fastify/otel') | ||
| .filter(span => span.instrumentationScope.name === '@fastify/otel') | ||
@@ -1627,3 +1627,3 @@ const [start] = spans | ||
| .getFinishedSpans() | ||
| .filter(span => span.instrumentationLibrary.name === '@fastify/otel') | ||
| .filter(span => span.instrumentationScope.name === '@fastify/otel') | ||
@@ -1670,3 +1670,3 @@ const [preValidation, start, end, preHandler2, end2, preValidation2] = | ||
| assert.equal(start.parentSpanId, end.spanContext().spanId) | ||
| assert.equal(start.parentSpanContext.spanId, end.spanContext().spanId) | ||
| assert.equal(response.status, 200) | ||
@@ -1705,3 +1705,3 @@ assert.equal(await response.text(), 'hello world') | ||
| .getFinishedSpans() | ||
| .filter(span => span.instrumentationLibrary.name === '@fastify/otel') | ||
| .filter(span => span.instrumentationScope.name === '@fastify/otel') | ||
@@ -1708,0 +1708,0 @@ const [start] = spans |
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 3 instances in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 3 instances in 1 package
107938
0.45%2379
0.04%