Skip to content

Commit

Permalink
Add http.version to client/server traces.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix committed Aug 26, 2024
1 parent a0f06f0 commit f340dc8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ permissions:

env:
CONSOLE_OUTPUT: XTerm
TRACES_BACKEND: traces/backend/test
METRICS_BACKEND: metrics/backend/test

jobs:
test:
Expand Down
4 changes: 4 additions & 0 deletions lib/async/http/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,10 @@ def call(request)
end

super.tap do |response|
if version = response&.version
span['http.version'] = version
end

if status = response&.status
span['http.status_code'] = status
end
Expand Down
1 change: 1 addition & 0 deletions lib/async/http/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ def call(request)
end

attributes = {
'http.version': request.version,
'http.method': request.method,
'http.authority': request.authority,
'http.scheme': request.scheme,
Expand Down

0 comments on commit f340dc8

Please sign in to comment.