Skip to content

Commit be60cb5

Browse files
committed
feat(trace): mark parent span in error
1 parent 4d6e346 commit be60cb5

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

lib/opentelemetry-node.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,9 @@ function endSpan (msg, error, nodeDefinition) {
387387
span.recordException(error)
388388
}
389389
span.setStatus({ code: SpanStatusCode.ERROR, message: error })
390+
if (parent.parentSpan) {
391+
parent.parentSpan.setStatus({ code: SpanStatusCode.ERROR })
392+
}
390393
}
391394
const localAttributes = parseAttribute(true, msg, nodeDefinition.z, nodeDefinition.type)
392395
if (localAttributes !== undefined) {

package-lock.json

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "node-red-contrib-opentelemetry",
3-
"version": "1.6.1",
3+
"version": "1.6.2",
44
"description": "Distributed tracing with OpenTelemetry SDK and Prometheus metrics exporter for Node-RED",
55
"scripts": {
66
"lint": "eslint . --fix"

0 commit comments

Comments
 (0)