-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
refactor(statsd): refactor workspace id and name retrieval #11442
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this affect the use of the plugin with non-default workspaces? Please add a test that verifies that the plugin still works correctly with default and non-default workspaces.
use the workspace created by default to avoid querying the database for workspace ID and name with every request.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add the get_workspace_name
function to EE first, referencing this PR. Also add a changelog file and a test.
@sabertobihwy pls check the comments above. |
Hi @hanshuebner, I submitted a corresponding PR to EE: https://github.com/Kong/kong-ee/pull/6375 NOTE: https://github.com/Kong/kong-ee/pull/6375 will not be merged. After this PR is merged(#11442), when cherry picking this PR to EE, it will be modified according to https://github.com/Kong/kong-ee/pull/6375, so https://github.com/Kong/kong-ee/pull/6375 is only used to demonstrate the ideas and details. |
This PR is simple, an existing test case can be considered as already covered: kong/spec/03-plugins/06-statsd/01-log_spec.lua Lines 1491 to 1507 in d4d547d
|
Please fix the PR description. |
@vm-001 are your changes addressed on this PR? |
Yes. So, approved. |
@sabertobihwy please cherry-pick the change into kong-ee |
Summary
ws.get_workspace()
function will execute database query, calling this function in the plugin for every request will lead to performance degradation.Checklist
Full changelog
ws.get_workspace_name()
that directly returns the default workspace name (default
).Issue reference
Fix FTI-5303