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

add instrumentation file #1056

Merged
merged 3 commits into from
Nov 27, 2024
Merged

add instrumentation file #1056

merged 3 commits into from
Nov 27, 2024

Conversation

igorosip0v
Copy link
Contributor

This PR adds redis client usage with instrumentation file.

Instrumentation file docs:
https://nextjs.org/docs/app/api-reference/file-conventions/instrumentation

Shortly (but read the doc), we use register() inside the instrumentation file to execute Redis client creation only once on the application starting after the build. Then, we store the Redis client instance globally to access it everywhere.

TODO

  • PR is not finished. We should apply global client everywhere where we are using redis client.

@andy-t-wang
Copy link
Contributor

Will add to ratings soon, after a slight refactor on calculation

@andy-t-wang
Copy link
Contributor

Updated to use Redis globally and for tests

@andy-t-wang andy-t-wang merged commit 5ba5a9e into main Nov 27, 2024
12 checks passed
@andy-t-wang andy-t-wang deleted the redis branch November 27, 2024 00:12
andy-t-wang added a commit that referenced this pull request Nov 27, 2024
andy-t-wang added a commit that referenced this pull request Nov 27, 2024
andy-t-wang added a commit that referenced this pull request Nov 27, 2024
andy-t-wang added a commit that referenced this pull request Nov 27, 2024
* Revert "Revert "add instrumentation file (#1056)" (#1070)"

This reverts commit 797b906.

* remove redis quit

* add comment
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