Skip to content

Commit b808561

Browse files
authored
docs: align HTTP client READMEs with stable semantic conventions (#1683)
Document stable HTTP span attributes after verifying exported spans from a sample app. OkHttp3 and HttpUrlConnection instrumentations use the standard HTTP client extractors from OpenTelemetry Instrumentation. Fixes #1393 Contributed by @ashishvz on behalf of Vunet Systems (https://vunetsystems.com/). Made-with: Cursor
1 parent e0b970d commit b808561

2 files changed

Lines changed: 17 additions & 15 deletions

File tree

instrumentation/httpurlconnection/README.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,15 @@ the following occurs: the response stream is fully read, the stream is closed,
3434
- Name: Determined by the HTTP span name extractor (typically `HTTP {method}` or derived from the URL)
3535
- Description: Client-side HTTP request
3636
- Attributes (following OpenTelemetry [HTTP semantic conventions](https://opentelemetry.io/docs/specs/semconv/http/http-spans/)):
37-
- `http.method` — request method (GET, POST, etc.)
38-
- `http.url` — full URL
39-
- `http.target`, `http.host`, `http.scheme` — parts of the request URL when available
40-
- `http.status_code` — response status code
41-
- `http.flavor` — protocol (e.g. `1.1`)
42-
- `net.peer.name` — server host
43-
- `net.peer.port` — server port
44-
- Request and response headers captured according to configuration: `http.request.header.*` / `http.response.header.*`
37+
- `http.request.method` — request method (GET, POST, etc.)
38+
- `url.full` — full request URL
39+
- `url.scheme`, `url.path`, `url.query` — parts of the request URL when available
40+
- `http.response.status_code` — response status code
41+
- `network.protocol.version` — protocol version (e.g. `1.1`, `2` for HTTP/2)
42+
- `server.address` — logical server host
43+
- `server.port` — logical server port
44+
- `network.peer.address` / `network.peer.port` — connection endpoint, when available
45+
- Request and response headers captured according to configuration: `http.request.header.<name>` / `http.response.header.<name>`
4546

4647
If the request throws an IOException, the span is ended and the exception is recorded.
4748

instrumentation/okhttp3/README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,14 @@ are provided by the OkHttp attributes getter.
1818
* Name: Determined by the HTTP span name extractor (typically `HTTP {method}` or derived from the URL)
1919
* Description: Client-side HTTP request
2020
* Common attributes (following OpenTelemetry HTTP semantic conventions):
21-
* `http.method` — request method (GET, POST, etc.)
22-
* `http.url` — full URL
23-
* `http.status_code` — response status code
24-
* `http.flavor` — protocol (e.g. `1.1`)
25-
* `net.peer.name` — server host
26-
* `net.peer.port` — server port
27-
* Captured request/response headers per configuration
21+
* `http.request.method` — request method (GET, POST, etc.)
22+
* `url.full` — full request URL
23+
* `http.response.status_code` — response status code
24+
* `network.protocol.version` — protocol version (e.g. `1.1`, `2` for HTTP/2)
25+
* `server.address` — logical server host
26+
* `server.port` — logical server port
27+
* `network.peer.address` / `network.peer.port` — connection endpoint, when available
28+
* Captured request/response headers per configuration (`http.request.header.<name>` / `http.response.header.<name>`)
2829

2930
If a request fails, the span is ended and the error is recorded.
3031

0 commit comments

Comments
 (0)