Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Don’t consider log events as root spans #1208

Merged
merged 1 commit into from
Jun 17, 2024

Conversation

MikeGoldsmith
Copy link
Contributor

@MikeGoldsmith MikeGoldsmith commented Jun 17, 2024

Which problem is this PR solving?

Log events should never be considered root spans even though they do not contain a trace.parent_id. A log event that is part of a trace would mark the trace complete as if it's considered a root span.

This change updates the check for whether a span is considered a root span to also check for the meta field meta.signal_type. If the field exists and is set to "log", we return false.

Short description of the changes

  • Update InMemoryCollector.isRootSpan to check if meta.signal_type and has a value of "log"
  • Add unit tests for InMemoryCollector to verify expected behaviour for isRootSpan

@MikeGoldsmith MikeGoldsmith added type: bug Something isn't working version: bump patch A PR with release-worthy changes and is backwards-compatible. labels Jun 17, 2024
@MikeGoldsmith MikeGoldsmith self-assigned this Jun 17, 2024
@MikeGoldsmith MikeGoldsmith requested a review from a team as a code owner June 17, 2024 20:03
Copy link
Contributor

@kentquirk kentquirk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is good.

@MikeGoldsmith MikeGoldsmith merged commit eb76cf4 into main Jun 17, 2024
5 checks passed
@MikeGoldsmith MikeGoldsmith deleted the mike/logs-not-root-spans branch June 17, 2024 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working version: bump patch A PR with release-worthy changes and is backwards-compatible.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants