Skip to content

Commit

Permalink
More extensive proxy trace attributes.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix committed Sep 24, 2024
1 parent 19fe8ec commit 67a40ae
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion lib/falcon/middleware/proxy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,20 @@ def call(request)

Traces::Provider(self) do
def call(request)
Traces.trace('falcon.middleware.proxy.call', attributes: {authority: request.authority}) do
attributes = {
authority: request.authority,
}

if host = lookup(request)
attributes[:endpoint] = host.endpoint.inspect

if client = @clients[host.endpoint]
attributes[:client] = client.as_json
attributes[:pool] = client.pool.as_json
end
end

Traces.trace('falcon.middleware.proxy.call', attributes: attributes) do
super
end
end
Expand Down

0 comments on commit 67a40ae

Please sign in to comment.