Skip to content
This repository was archived by the owner on Oct 3, 2023. It is now read-only.

Commit d03fd18

Browse files
author
JBD
authored
Add HTTP Attributes spec (#49)
Add HTTP Attributes spec This document summarizes the attributes to be collected on the HTTP spans. Collected attributes need to be mapped to backend-specific known tags/labels when exporting. Zipkin tags: https://zipkin.io/public/thrift/v1/zipkinCore.html#Const_HTTP_HOST Jaeger tags: https://github.com/opentracing/specification/blob/master/semantic_conventions.md Stackdriver attributes Stackdriver labels: https://godoc.org/cloud.google.com/go/trace#pkg-constants
1 parent ab0d940 commit d03fd18

1 file changed

Lines changed: 39 additions & 0 deletions

File tree

trace/HTTPAttributes.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# HTTP Attributes
2+
3+
This document summarizes HTTP attributes recorded from HTTP
4+
requests and responses.
5+
6+
HTTP integrations should set the following attributes on the client
7+
and server spans. For a server, request represents the incoming request.
8+
For a client, request represents the outgoing request.
9+
10+
All attributes are optional.
11+
12+
| Attribute name | Description | Example value |
13+
|---------------------------|-----------------------------|---------------------------------|
14+
| "http.host" | Request URL host | "example.com" |
15+
| "http.method" | Request URL method | "GET" |
16+
| "http.path" | Request URL path | "/users/25f4c31d" |
17+
| "http.route" | Matched request URL route | "/users/:userID" |
18+
| "http.user_agent" | Request user-agent | "HTTPClient/1.2" |
19+
| "http.status_code" | Response status code | 200 |
20+
21+
Exporters should always export the collected attributes.
22+
Exporters should map the collected attributes to backend's
23+
known attributes/labels.
24+
25+
The following table summarizes how OpenCensus attributes maps to the
26+
known attributes/labels on supported tracing backends.
27+
28+
| OpenCensus attribute | Zipkin | Jaeger | Stackdriver Trace label |
29+
|---------------------------|--------------------|--------------------|--------------------------------------------|
30+
| "http.host" | "http.host" | | "trace.cloud.google.com/http/host" |
31+
| "http.method" | "http.method" | "http.method" | "trace.cloud.google.com/http/method" |
32+
| "http.path" | "http.path" | | |
33+
| "http.route" | "http.route" | | |
34+
| "http.user_agent" | | | "trace.cloud.google.com/http/user_agent" |
35+
| "http.status_code" | "http.status_code" | "http.status_code" | "trace.cloud.google.com/http/status_code" |
36+
37+
Request body and response size of incoming and outgoing requests should be
38+
represented as message events. Each redirect should be represented as a
39+
message event.

0 commit comments

Comments
 (0)