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

refactor(statsd): refactor workspace id and name retrieval #11442

Merged
merged 10 commits into from
Sep 19, 2023
7 changes: 7 additions & 0 deletions CHANGELOG/unreleased/kong/11442.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
message: refactor workspace id and name retrieval
type: performance
scope: Core
prs:
- 11442
jiras:
- "FTI-5303"
3 changes: 1 addition & 2 deletions kong/plugins/statsd/log.lua
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,7 @@ local get_workspace_id = {
return ws.get_workspace_id()
end,
workspace_name = function()
local workspace = ws.get_workspace()
return workspace.name
return ws.get_workspace_name()
end
}

Expand Down
5 changes: 5 additions & 0 deletions kong/workspaces/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ function workspaces.get_workspace()
end


function workspaces.get_workspace_name()
return "default"
end


function workspaces.set_workspace(ws)
ngx.ctx.workspace = ws and ws.id
end
Expand Down