Skip to content

Commit

Permalink
Show relationship between http target and route in example usage (ope…
Browse files Browse the repository at this point in the history
…n-telemetry#3292)

Clarify relationship between `http.target` and `http.route` by using the
same pattern in the example usage. Having different patterns for the
attribute values distorts the relationship between the two attributes.

A similar pattern is seen in the docs for
[`aws-lambda.md`](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/instrumentation/aws-lambda.md#api-gateway-request-proxy-lambda-tracing-passive),
where `http.target` is `/pets/10` and `http.route` is `/pets/{petId}`.
It's a minor adjustment but should help provide clarity for new users.

---------

Co-authored-by: Joshua MacDonald <jmacd@users.noreply.github.com>
  • Loading branch information
2 people authored and lmolkova committed Mar 8, 2023
1 parent 0909ee0 commit d17c016
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
2 changes: 1 addition & 1 deletion semantic_conventions/trace/http.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ groups:
brief: 'The full request target as passed in a HTTP request line or equivalent.'
requirement_level: required
sampling_relevant: true
examples: ['/path/12314/?q=ddds']
examples: ['/users/12314/?q=ddds']
- id: forwarded.for
type: string
requirement_level:
Expand Down
10 changes: 1 addition & 9 deletions specification/trace/semantic_conventions/http.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ If the route cannot be determined, the `name` attribute MUST be set as defined i
| Attribute | Type | Description | Examples | Requirement Level |
|---|---|---|---|---|
| `http.route` | string | The matched route (path template in the format used by the respective server framework). See note below [1] | `/users/:userID?`; `{controller}/{action}/{id?}` | Conditionally Required: If and only if it's available |
| `http.target` | string | The full request target as passed in a HTTP request line or equivalent. | `/path/12314/?q=ddds` | Required |
| `http.target` | string | The full request target as passed in a HTTP request line or equivalent. | `/users/12314/?q=ddds` | Required |
| `http.forwarded.for` | string | The address of the original client behind all proxies. [2] | `2001:db8:cafe::17`; `83.164.160.102:65534`; `_hidden` | Recommended: if and only if it's available. |
| `http.forwarded.proto` | string | The original protocol client used to connect to the proxy (e.g. from the `proto` component of [Forwarded](https://www.rfc-editor.org/rfc/rfc7239.html) header) | `https`; `http` | Recommended: if known and only if it's available. |
| `http.scheme` | string | The URI scheme identifying the used protocol. | `http`; `https` | Required |
Expand Down Expand Up @@ -286,15 +286,7 @@ SHOULD NOT be set if only IP address is available and capturing name would requi

**[5]:** If not default (`80` for `http` scheme, `443` for `https`).

<<<<<<< HEAD
<<<<<<< HEAD
**[6]:** If defined for the address family and if different than `net.host.port` and if `net.sock.host.addr` is set. In other cases, it is still recommended to set this.
=======
**[7]:** If defined for the address family and if different than `net.host.port` and if `net.sock.host.addr` is set.
>>>>>>> 48d5eea (Add http.forwarded attributes)
=======
**[6]:** If defined for the address family and if different than `net.host.port` and if `net.sock.host.addr` is set.
>>>>>>> 8052c21 (update forwarded.for description)

Following attributes MUST be provided **at span creation time** (when provided at all), so they can be considered for sampling decisions:

Expand Down

0 comments on commit d17c016

Please sign in to comment.