Skip to content

Add closing support to otel metrics instrumentation #3444

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

Merged
merged 1 commit into from
Jul 24, 2025

Conversation

rokn
Copy link
Contributor

@rokn rokn commented Jul 23, 2025

Hey there, I'm opening this PR to try to address the problem from #3424.

This adds a new option when setting up the OpenTelemetry metric hooks which would allow the users to pass a close channel so they can notify us when we need to stop the metrics reporting and unregister all the needed callbacks.

The approach with a close channel through an option was chosen as to not introduce any breaking changes. Another possibility is to introduce a new function which receives a context as first param and waits for the context to close. I think both can work so it's up to you guys to decide what would be best.

I'll add some tests if you think this approach is fine

@ndyakov
Copy link
Member

ndyakov commented Jul 23, 2025

Hello @rokn, thank you for the contribution. Will review the PR shortly. Pinging @monkey92t if he has interest to check this one as well.

Copy link
Member

@ndyakov ndyakov left a comment

Choose a reason for hiding this comment

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

Overall LGTM

@ndyakov ndyakov merged commit 23a87a2 into redis:master Jul 24, 2025
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants