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: make sure decision keep and drop is persisted in redis #1020

Merged
merged 13 commits into from
Mar 1, 2024

Conversation

VinozzZ
Copy link
Contributor

@VinozzZ VinozzZ commented Feb 29, 2024

Which problem is this PR solving?

Before this PR, decisions made for traces were not stored in redis. It also wasn't part of the state machine when transition a trace from awaiting for decision to either decision keep or drop.

Short description of the changes

  • Introduced DecisionDrop and DecisionKeep into the state machine
  • check against in-memory cache before fetching from Redis for trace status
  • run smartwrapper tests against redis in the ci
  • removed some unnecessary code

In order to persist the the decisionDrop for a given trace, this commit makes sure we are following the same state transition pattern as other state events for DecisionDrop. When a trace is marked as dropped, span information is also deleted.
Utilize SetNXHash to set KeepReason only once. This change also does proper state transition for decisionKeep.
@VinozzZ VinozzZ requested a review from a team as a code owner February 29, 2024 17:28
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.

Some nits, but otherwise cool.

@@ -330,7 +331,7 @@ func TestSetTraceStatuses(t *testing.T) {
if status.TraceID == traceids[0] {
assert.Equal(t, DecisionKeep, status.State)
// TODO: save the reason in the reason cache correctly
Copy link
Contributor

Choose a reason for hiding this comment

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

remove this TODO, please

}
}

// TODO: values is always "OK", but we should be able to get the values
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't understand what this TODO is saying?

@@ -433,14 +434,14 @@ func BenchmarkStoreGetTracesForState(b *testing.B) {
}
}

func cleanupRedisStore(store BasicStorer) error {
func cleanupRedisStore(t testing.TB, store BasicStorer) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

Given that you're logging and not returning an error, should probably remove the return parameter.

@VinozzZ VinozzZ force-pushed the yingrong.save_keep_reason_in_redis branch 4 times, most recently from abb6333 to aa3df08 Compare February 29, 2024 19:21
The score in a sorted set is a float64. Nanosecond can't fit into a
float64. That's why we are changing it to microsecond.
@VinozzZ VinozzZ force-pushed the yingrong.save_keep_reason_in_redis branch from aa3df08 to 9e63c53 Compare March 1, 2024 02:51
@VinozzZ VinozzZ merged commit 3832d1f into feat_dynamic_scaling Mar 1, 2024
3 checks passed
@VinozzZ VinozzZ deleted the yingrong.save_keep_reason_in_redis branch March 1, 2024 15:08
kentquirk pushed a commit that referenced this pull request Mar 15, 2024
<!--
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?

Before this PR, decisions made for traces were not stored in redis. It
also wasn't part of the state machine when transition a trace from
awaiting for decision to either decision keep or drop.

## Short description of the changes

- Introduced DecisionDrop and DecisionKeep into the state machine
- check against in-memory cache before fetching from Redis for trace
status
- run smartwrapper tests against redis in the ci
- removed some unnecessary code
kentquirk pushed a commit that referenced this pull request Mar 22, 2024
<!--
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?

Before this PR, decisions made for traces were not stored in redis. It
also wasn't part of the state machine when transition a trace from
awaiting for decision to either decision keep or drop.

## Short description of the changes

- Introduced DecisionDrop and DecisionKeep into the state machine
- check against in-memory cache before fetching from Redis for trace
status
- run smartwrapper tests against redis in the ci
- removed some unnecessary code
kentquirk pushed a commit that referenced this pull request Apr 4, 2024
<!--
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?

Before this PR, decisions made for traces were not stored in redis. It
also wasn't part of the state machine when transition a trace from
awaiting for decision to either decision keep or drop.

## Short description of the changes

- Introduced DecisionDrop and DecisionKeep into the state machine
- check against in-memory cache before fetching from Redis for trace
status
- run smartwrapper tests against redis in the ci
- removed some unnecessary code
VinozzZ added a commit that referenced this pull request May 6, 2024
<!--
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?

Before this PR, decisions made for traces were not stored in redis. It
also wasn't part of the state machine when transition a trace from
awaiting for decision to either decision keep or drop.

## Short description of the changes

- Introduced DecisionDrop and DecisionKeep into the state machine
- check against in-memory cache before fetching from Redis for trace
status
- run smartwrapper tests against redis in the ci
- removed some unnecessary code
VinozzZ added a commit that referenced this pull request May 6, 2024
<!--
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?

Before this PR, decisions made for traces were not stored in redis. It
also wasn't part of the state machine when transition a trace from
awaiting for decision to either decision keep or drop.

## Short description of the changes

- Introduced DecisionDrop and DecisionKeep into the state machine
- check against in-memory cache before fetching from Redis for trace
status
- run smartwrapper tests against redis in the ci
- removed some unnecessary code
tdarwin pushed a commit to tdarwin/refinery that referenced this pull request Jun 26, 2024
…bio#1020)

<!--
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 honeycombio#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?

Before this PR, decisions made for traces were not stored in redis. It
also wasn't part of the state machine when transition a trace from
awaiting for decision to either decision keep or drop.

## Short description of the changes

- Introduced DecisionDrop and DecisionKeep into the state machine
- check against in-memory cache before fetching from Redis for trace
status
- run smartwrapper tests against redis in the ci
- removed some unnecessary code
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.

2 participants