Skip to content

feat(trace): add node_red.flow.name span attribute#28

Merged
nioc merged 1 commit into
nioc:masterfrom
czepiec:feat-flow-name
Mar 31, 2026
Merged

feat(trace): add node_red.flow.name span attribute#28
nioc merged 1 commit into
nioc:masterfrom
czepiec:feat-flow-name

Conversation

@czepiec

@czepiec czepiec commented Mar 31, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds node_red.flow.name attribute to all spans by resolving the flow tab label from the node's _flow.flow.label reference.

Motivation

Flow name is essential for practical observability in Node-RED:

  • Typical setups have many flows, often with identically named nodes — without the flow name there's no way to tell them apart
  • Flow IDs are opaque hashes, not something you can work with visually
  • Being able to filter and group by flow name (e.g. in Grafana) makes a real difference for dashboards

Implementation notes

  • Uses nodeDefinition._flow.flow.label — an internal (non-enumerable) property on node objects, available since Node-RED 0.20 (2019)
  • Degrades to empty string if not available for any reason

The changes are tested and we are using them in our large-scale Node-RED v4.0.9 instance.

@czepiec
czepiec force-pushed the feat-flow-name branch 3 times, most recently from 8398a18 to 61ee20d Compare March 31, 2026 21:06
Resolve flow tab name from flow id using RED.nodes.getNode API
and include it in common span attributes for better observability.
@czepiec
czepiec marked this pull request as ready for review March 31, 2026 21:18
@nioc
nioc merged commit 97a6e92 into nioc:master Mar 31, 2026
1 check passed
@nioc

nioc commented Mar 31, 2026

Copy link
Copy Markdown
Owner

Thank you for this proposal. Released in 1.6.4 🚀

@nioc nioc added the enhancement New feature or request label Mar 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants