From d17c016fcf350e3cd56a45afda14b49d63777900 Mon Sep 17 00:00:00 2001 From: Jamie Danielson Date: Wed, 8 Mar 2023 12:12:28 -0500 Subject: [PATCH] Show relationship between http target and route in example usage (#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 --- semantic_conventions/trace/http.yaml | 2 +- specification/trace/semantic_conventions/http.md | 10 +--------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/semantic_conventions/trace/http.yaml b/semantic_conventions/trace/http.yaml index 4c1527fece7..9698fe06617 100644 --- a/semantic_conventions/trace/http.yaml +++ b/semantic_conventions/trace/http.yaml @@ -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: diff --git a/specification/trace/semantic_conventions/http.md b/specification/trace/semantic_conventions/http.md index d48c98f245d..a8846e78a35 100644 --- a/specification/trace/semantic_conventions/http.md +++ b/specification/trace/semantic_conventions/http.md @@ -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 | @@ -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: