Skip to content

Commit

Permalink
feat(log-serializer): add latencies.receive property to log-seriali…
Browse files Browse the repository at this point in the history
…zer (#12730)
  • Loading branch information
flrgh authored Mar 17, 2024
1 parent 2ebb0e3 commit 58fc97d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions changelog/unreleased/kong/log-serializer-receive-latency.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
message: 'Add `latencies.receive` property to log serializer'
type: feature
scope: Core
1 change: 1 addition & 0 deletions kong/pdk/log.lua
Original file line number Diff line number Diff line change
Expand Up @@ -845,6 +845,7 @@ do
(ctx.KONG_RECEIVE_TIME or 0),
proxy = ctx.KONG_WAITING_TIME or -1,
request = tonumber(var.request_time) * 1000,
receive = ctx.KONG_RECEIVE_TIME or 0,
},
tries = (ctx.balancer_data or {}).tries,
authenticated_entity = build_authenticated_entity(ctx),
Expand Down
1 change: 1 addition & 0 deletions spec/01-unit/10-log_serializer_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ describe("kong.log.serialize", function()
assert.equal(0, res.latencies.kong)
assert.equal(-1, res.latencies.proxy)
assert.equal(2000, res.latencies.request)
assert.equal(0, res.latencies.receive)

-- Request
assert.is_table(res.request)
Expand Down

1 comment on commit 58fc97d

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

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

Bazel Build

Docker image available kong/kong:58fc97d47247fe76e994d7588a354af295b814b4
Artifacts available https://github.com/Kong/kong/actions/runs/8317177795

Please sign in to comment.