Skip to content

Commit

Permalink
feat(trace): mark parent span in error
Browse files Browse the repository at this point in the history
  • Loading branch information
nioc committed Jan 22, 2025
1 parent 4d6e346 commit be60cb5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
3 changes: 3 additions & 0 deletions lib/opentelemetry-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,9 @@ function endSpan (msg, error, nodeDefinition) {
span.recordException(error)
}
span.setStatus({ code: SpanStatusCode.ERROR, message: error })
if (parent.parentSpan) {
parent.parentSpan.setStatus({ code: SpanStatusCode.ERROR })
}
}
const localAttributes = parseAttribute(true, msg, nodeDefinition.z, nodeDefinition.type)
if (localAttributes !== undefined) {
Expand Down
10 changes: 5 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "node-red-contrib-opentelemetry",
"version": "1.6.1",
"version": "1.6.2",
"description": "Distributed tracing with OpenTelemetry SDK and Prometheus metrics exporter for Node-RED",
"scripts": {
"lint": "eslint . --fix"
Expand Down

0 comments on commit be60cb5

Please # to comment.