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

feat(spans): Route spans according to trace_id #3387

Merged
merged 5 commits into from
Apr 9, 2024

Conversation

phacops
Copy link
Contributor

@phacops phacops commented Apr 7, 2024

We're in need of buffering spans later in the pipeline and it helps to have them on the same partition. We only need them routed per segment_id but since it's not a Uuid, using trace_id is simpler. An alternative would be to properly transform the segment_id into a u64 and then call Uuid::from_u64_pair(segment_id, 0) but that seems unnecessary.

@phacops phacops self-assigned this Apr 7, 2024
@phacops phacops requested a review from a team as a code owner April 7, 2024 15:55
@phacops phacops changed the title Pierre/spans partition by segment feat(spans): Route spans according to trace_id Apr 7, 2024
@@ -1378,16 +1378,15 @@ struct SpanKafkaMessage<'a> {
/// Number of days until these data should be deleted.
#[serde(default)]
retention_days: u16,
#[serde(default, skip_serializing_if = "Option::is_none")]
segment_id: Option<&'a str>,
segment_id: &'a str,
Copy link
Member

Choose a reason for hiding this comment

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

We deserialize a SpanKafkaMessage from a Span, right? Can we be sure that it has a segment_id?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Reverted since we're using trace_id and not segment_id for routing.

@phacops phacops requested a review from jjbayer April 8, 2024 19:03
Copy link
Contributor

@iker-barriocanal iker-barriocanal left a comment

Choose a reason for hiding this comment

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

Thanks for the PR description!

@phacops phacops merged commit 6bc0988 into master Apr 9, 2024
21 checks passed
@phacops phacops deleted the pierre/spans-partition-by-segment_id branch April 9, 2024 13:24
This pull request was closed.
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