Skip to content

Conversation

@NickLarsenNZ
Copy link
Member

@NickLarsenNZ NickLarsenNZ commented May 23, 2025

Description

Before, the span lived as long as the app ran which is discouraged for (subjectively) long-running apps. This change moves the span to inside the loop, and move existing init stuff into a separate span (so that output is still distinguishable).

Also replace stackable_operator::utils::print_startup_string with tracing::info! to get the correct call-site displayed.

image

Why are long spans discouraged?

Two problems arise when troubleshooting an application via tracing:

  1. Long spans just have too much detail to sift through. The parent span (which is basically the trace) ends up with too much detail. It should be scoped down to useful "start" and "stop" points, eg:
  • The app starting up, and
  • Each iteration of the loop (there is not much value in covering the time in between runs).
  1. Large traces will get rejected by having too many child spans, or just too much data (depending on the receivers configuration).

Definition of Done Checklist

  • Not all of these items are applicable to all PRs, the author should update this template to only leave the boxes in that are relevant
  • Please make sure all these things are done and tick the boxes

Author

  • Changes are OpenShift compatible
  • Integration tests passed (for non trivial changes)

Reviewer

  • Code contains useful comments
  • (Integration-)Test cases added
  • Documentation added or updated
  • Changelog updated
  • Cargo.toml only contains references to git tags (not specific commits or branches)

Acceptance

  • Feature Tracker has been updated
  • Proper release label has been added

Note: this has the added benefit of displaying the correct tracing target (or call-site), instead of displaying stackable_operator
@NickLarsenNZ NickLarsenNZ self-assigned this May 23, 2025
@NickLarsenNZ NickLarsenNZ added this pull request to the merge queue May 26, 2025
Merged via the queue into main with commit bc5ac2d May 26, 2025
10 checks passed
@NickLarsenNZ NickLarsenNZ deleted the fix/shorter-spans branch May 26, 2025 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants