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: store trace kept record with pipelining instead of lua script #1188

Merged
merged 1 commit into from
Jun 5, 2024

Conversation

VinozzZ
Copy link
Contributor

@VinozzZ VinozzZ commented Jun 5, 2024

Which problem is this PR solving?

We found the keep trace lua script in redis' slow query log. Turns out, we actually don't need to store those fields separately since they don't change once they are set. By storing them together, we can eliminate the need for using lua script.

Short description of the changes

  • Define a KeepRecord field in the data structure we use to store trace status in redis
  • encode centralTraceStatusReason into one json blob
  • change redis to allow easier pipelining commands

TODO:
Since we have changed most of our redis_store code to use pipelining when communicating with redis, I will make another PR to clean up the redis.go code that enables a easier interface for using pipelining

@VinozzZ VinozzZ requested a review from a team as a code owner June 5, 2024 16:01
@VinozzZ VinozzZ requested a review from kentquirk June 5, 2024 16:02
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.

We talked about changing the interface this uses, but that can be a separate PR.

@VinozzZ VinozzZ merged commit e11b175 into main Jun 5, 2024
5 checks passed
@VinozzZ VinozzZ deleted the yingrong.keep_record branch June 5, 2024 18:31
tdarwin pushed a commit to tdarwin/refinery that referenced this pull request Jun 26, 2024
…oneycombio#1188)

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

We found the keep trace lua script in redis' slow query log. Turns out,
we actually don't need to store those fields separately since they don't
change once they are set. By storing them together, we can eliminate the
need for using lua script.

## Short description of the changes

- Define a `KeepRecord` field in the data structure we use to store
trace status in redis
- encode `centralTraceStatusReason` into one json blob
- change redis to allow easier pipelining commands

TODO:
Since we have changed most of our redis_store code to use pipelining
when communicating with redis, I will make another PR to clean up the
redis.go code that enables a easier interface for using pipelining
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