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

maint: rename sent_reason_cache to kept_reason_cache #1346

Merged
merged 1 commit into from
Sep 20, 2024

Conversation

VinozzZ
Copy link
Contributor

@VinozzZ VinozzZ commented Sep 19, 2024

Which problem is this PR solving?

In the collector, we use sendReason to describe why a trace is moved into the decision-making process. Additionally, we have sentReason, which indicates the reason behind a trace receiving a “kept” decision.

To avoid confusion between these terms when sharing this information from the decider node to the rest of the cluster, I propose renaming sentReasonCache to keptReasonCache to better reflect its purpose.

Short description of the changes

  • rename all sentReasonCache to keptReasonCache

@VinozzZ VinozzZ added the type: maintenance The necessary chores to keep the dust off. label Sep 19, 2024
@VinozzZ VinozzZ added this to the v2.9 milestone Sep 19, 2024
@VinozzZ VinozzZ self-assigned this Sep 19, 2024
@VinozzZ VinozzZ requested a review from a team as a code owner September 19, 2024 22:05
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.

Generally OK, but maybe there's more? Did you search for "send" as well as "sent"?

@@ -480,12 +480,12 @@ func (i *InMemCollector) processSpan(sp *types.Span) {
trace := i.cache.Get(sp.TraceID)
if trace == nil {
// if the trace has already been sent, just pass along the span
if sr, sentReason, found := i.sampleTraceCache.CheckSpan(sp); found {
if sr, keptReason, found := i.sampleTraceCache.CheckSpan(sp); found {
i.Metrics.Increment("trace_sent_cache_hit")
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe change the name of this metric? And are there other ones?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this one is ok. This metric is for the TraceSentCache, not the keptReasonCache. Hopefully with this rename, things will be a bit more clear

collect/collect.go Show resolved Hide resolved
@VinozzZ
Copy link
Contributor Author

VinozzZ commented Sep 20, 2024

Generally OK, but maybe there's more? Did you search for "send" as well as "sent"?

My apology that the PR description wasn't specific enough. I just updated it. This PR is only renaming things that are related to the SentReasonCache to KeptReasonCache. The TraceSentCache is left untouched

@VinozzZ VinozzZ merged commit ae42aaf into main Sep 20, 2024
8 checks passed
@VinozzZ VinozzZ deleted the yingrong.rename_sent_reason_cache branch September 20, 2024 18:13
TylerHelmuth pushed a commit that referenced this pull request Oct 16, 2024
## Which problem is this PR solving?

In the `collector`, we use `sendReason` to describe why a trace is moved
into the decision-making process. Additionally, we have `sentReason`,
which indicates the reason behind a trace receiving a “kept” decision.

To avoid confusion between these terms when sharing this information
from the decider node to the rest of the cluster, I propose renaming
`sentReasonCache` to `keptReasonCache` to better reflect its purpose.

## Short description of the changes

- rename all `sentReasonCache` to `keptReasonCache`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: maintenance The necessary chores to keep the dust off.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants