Skip to content

Commit

Permalink
fix(*): use kong.ctx.plugin
Browse files Browse the repository at this point in the history
Co-authored-by: Aapo Talvensaari <[email protected]>
  • Loading branch information
windmgc and bungle authored Apr 25, 2024
1 parent 87ebb84 commit 7619bca
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kong/plugins/aws-lambda/handler.lua
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ function AWSLambdaHandler:access(conf)
-- setting the latency here is a bit tricky, but because we are not
-- actually proxying, it will not be overwritten
ctx.KONG_WAITING_TIME = lambda_wait_time_total
ctx.AWS_LAMBDA_WAIT_TIME = lambda_wait_time_total
kong.ctx.plugin.waiting_time = lambda_wait_time_total

if err then
return error(err)
Expand Down Expand Up @@ -248,7 +248,7 @@ function AWSLambdaHandler:header_filter(conf)
-- TRACING: remove the latency of requesting AWS Lambda service from the KONG_RESPONSE_LATENCY
local ctx = ngx.ctx
if ctx.KONG_RESPONSE_LATENCY then
ctx.KONG_RESPONSE_LATENCY = ctx.KONG_RESPONSE_LATENCY - (ctx.AWS_LAMBDA_WAIT_TIME or 0)
ctx.KONG_RESPONSE_LATENCY = ctx.KONG_RESPONSE_LATENCY - (kong.ctx.plugin.waiting_time or 0)
end
end

Expand Down

0 comments on commit 7619bca

Please sign in to comment.