-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: redistribute remaining traces during shutdown (#1261)
<!-- Thank you for contributing to the project! 💜 Please make sure to: - Chat with us first if this is a big change - Open a new issue (or comment on an existing one) - We want to make sure you don't spend time implementing something we might have to say No to - Add unit tests - Mention any relevant issues in the PR description (e.g. "Fixes #123") Please see our [OSS process document](https://github.com/honeycombio/home/blob/main/honeycomb-oss-lifecycle-and-practices.md#) to get an idea of how we operate. --> ## Which problem is this PR solving? When a node leaves the cluster, gossip the news and then calculate the new destination and forward traces that node was holding on to. This means that removing a node from the refinery cluster will be much less disruptive than it is today. ## Short description of the changes - During shutdown, the collector first to stop accepting new traces by existing from the `collect()` function. - Traces are distributed to three go channels based on their state - late spans - traces that have already received root span or it has expired from its TraceTimeout - traces that can't have their decisions made yet - A goroutine is created to grab items off of the three go channels. For the late spans, expired traces, or traces with root span, collector will send them to honeycomb. For traces that don't have decisions yet, collector will forward them to their new home(another refinery peer) I also added unit tests for the distribution logic as well as a counter to monitor the amount of traces that goes through each state. address #1204 --------- Co-authored-by: Yingrong Zhao <yingrongzhao@yingrongzhao.attlocal.net>
- Loading branch information
Showing
10 changed files
with
457 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.