Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add user_agent.synthetic.type attribute #1523

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
e579479
Add synthetic source.
JacksonWeber Oct 28, 2024
984fbee
Update model/http/registry.yaml
JacksonWeber Oct 29, 2024
4d1b110
Update model/http/registry.yaml
JacksonWeber Oct 29, 2024
f925b65
Begin refactoring.
JacksonWeber Oct 31, 2024
6b48773
Update md files.
JacksonWeber Oct 31, 2024
5837106
Clarify synthetic meaning.
JacksonWeber Nov 1, 2024
b4686ff
Shorten id value.
JacksonWeber Nov 1, 2024
568cefc
Update user_agent synthetic value.
JacksonWeber Nov 1, 2024
d52bde9
Merge branch 'jacksonweber-sythetic-source' of https://github.com/Jac…
JacksonWeber Nov 1, 2024
40a7d3b
Update docs.
JacksonWeber Nov 1, 2024
48668f3
Add info regarding self-id.
JacksonWeber Nov 19, 2024
b2020f8
Merge branch 'main' into jacksonweber-sythetic-source
JacksonWeber Nov 19, 2024
c4bdf85
Merge branch 'main' into jacksonweber-sythetic-source
JacksonWeber Nov 19, 2024
91ef4ba
Update md files.
JacksonWeber Nov 19, 2024
2d64e96
Generalize about what components could possibly set the synthetic att…
JacksonWeber Nov 19, 2024
ac73e97
Update description wording.
JacksonWeber Nov 19, 2024
c870957
Update docs and add synthetic to client spans.
JacksonWeber Nov 19, 2024
7dac0c5
Update wording on user-agent registry.
JacksonWeber Nov 19, 2024
1b804df
Update requirement level of synthetic.type for client spans.
JacksonWeber Nov 21, 2024
86f3396
Update requirement level of client spans.
JacksonWeber Nov 21, 2024
03c8ea8
Specify the types of synthetic traffic possible.
JacksonWeber Nov 21, 2024
54dcdd3
Make the enum values more clear.
JacksonWeber Nov 21, 2024
5e0bb16
Merge branch 'main' into jacksonweber-sythetic-source
JacksonWeber Nov 21, 2024
a136fbd
Update markdown.
JacksonWeber Nov 21, 2024
48cca0b
Add formatting.
JacksonWeber Nov 21, 2024
8ce8320
Wording update.
JacksonWeber Nov 21, 2024
101e662
Update should vs. may wording.
JacksonWeber Nov 21, 2024
80ae0a6
Merge branch 'main' into jacksonweber-sythetic-source
JacksonWeber Nov 21, 2024
87e6c4e
Update markdown.
JacksonWeber Nov 21, 2024
25cc8f4
Add new line.
JacksonWeber Nov 21, 2024
6c21f04
Update attribute on client spans to opt_in.
JacksonWeber Nov 21, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .chloggen/add-synthetic-source.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Use this changelog template to create an entry for release notes.
#
# If your change doesn't affect end users you should instead start
# your pull request title with [chore] or use the "Skip Changelog" label.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: enhancement

# The name of the area of concern in the attributes-registry, (e.g. http, cloud, db)
component: http
JacksonWeber marked this conversation as resolved.
Show resolved Hide resolved

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Add the http.request.synthetic attribute to track if spans and metrics are the result of real users, synthetic testing, or bots.
JacksonWeber marked this conversation as resolved.
Show resolved Hide resolved

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
# The values here must be integers.
issues: [1127]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:

Check failure on line 22 in .chloggen/add-synthetic-source.yaml

View workflow job for this annotation

GitHub Actions / yamllint

[new-line-at-end-of-file] no new line character at the end of file
18 changes: 14 additions & 4 deletions docs/attributes-registry/http.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@ This document defines semantic convention attributes in the HTTP namespace.
| <a id="http-request-method-original" href="#http-request-method-original">`http.request.method_original`</a> | string | Original HTTP method sent by the client in the request line. | `GeT`; `ACL`; `foo` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| <a id="http-request-resend-count" href="#http-request-resend-count">`http.request.resend_count`</a> | int | The ordinal number of request resending attempt (for any reason, including redirects). [3] | `3` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| <a id="http-request-size" href="#http-request-size">`http.request.size`</a> | int | The total size of the request in bytes. This should be the total number of bytes sent over the wire, including the request line (HTTP/1.1), framing (HTTP/2 and HTTP/3), headers, and request body if any. | `1437` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="http-request-synthetic" href="#http-request-synthetic">`http.request.synthetic`</a> | string | A flag indicating that the request was synthetically created and did not originate from genuine client traffic. [4] | `bot`; `synthetic test` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="http-response-body-size" href="#http-response-body-size">`http.response.body.size`</a> | int | The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. | `3495` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="http-response-header" href="#http-response-header">`http.response.header.<key>`</a> | string[] | HTTP response headers, `<key>` being the normalized HTTP Header name (lowercase), the value being the header values. [4] | `http.response.header.content-type=["application/json"]`; `http.response.header.my-custom-header=["abc", "def"]` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| <a id="http-response-header" href="#http-response-header">`http.response.header.<key>`</a> | string[] | HTTP response headers, `<key>` being the normalized HTTP Header name (lowercase), the value being the header values. [5] | `http.response.header.content-type=["application/json"]`; `http.response.header.my-custom-header=["abc", "def"]` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| <a id="http-response-size" href="#http-response-size">`http.response.size`</a> | int | The total size of the response in bytes. This should be the total number of bytes sent over the wire, including the status line (HTTP/1.1), framing (HTTP/2 and HTTP/3), headers, and response body and trailers if any. | `1437` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="http-response-status-code" href="#http-response-status-code">`http.response.status_code`</a> | int | [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). | `200` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| <a id="http-route" href="#http-route">`http.route`</a> | string | The matched route, that is, the path template in the format used by the respective server framework. [5] | `/users/:userID?`; `{controller}/{action}/{id?}` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| <a id="http-route" href="#http-route">`http.route`</a> | string | The matched route, that is, the path template in the format used by the respective server framework. [6] | `/users/:userID?`; `{controller}/{action}/{id?}` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |

**[1]:** Instrumentations SHOULD require an explicit configuration of which headers are to be captured. Including all request headers can be a security risk - explicit configuration helps avoid leaking sensitive information.
The `User-Agent` header is already captured in the `user_agent.original` attribute. Users MAY explicitly configure instrumentations to capture them even though it is not recommended.
Expand All @@ -49,11 +50,13 @@ Tracing instrumentations that do so, MUST also set `http.request.method_original

**[3]:** The resend count SHOULD be updated each time an HTTP request gets resent by the client, regardless of what was the cause of the resending (e.g. redirection, authorization failure, 503 Server Unavailable, network issues, or any other).

**[4]:** Instrumentations SHOULD require an explicit configuration of which headers are to be captured. Including all response headers can be a security risk - explicit configuration helps avoid leaking sensitive information.
**[4]:** This flag can primarily be determined by the contents of the `user_agent.original` attribute. Instrumentations should determine what they consider synthetic or bot traffic, and set this attribute accordingly. This attribute is useful for distinguishing between genuine client traffic and synthetic traffic generated by bots or tests.

**[5]:** Instrumentations SHOULD require an explicit configuration of which headers are to be captured. Including all response headers can be a security risk - explicit configuration helps avoid leaking sensitive information.
Users MAY explicitly configure instrumentations to capture them even though it is not recommended.
The attribute value MUST consist of either multiple header values as an array of strings or a single-item array containing a possibly comma-concatenated string, depending on the way the HTTP library provides access to headers.

**[5]:** MUST NOT be populated when this is not supported by the HTTP server framework as the route attribute should have low-cardinality and the URI path can NOT substitute it.
**[6]:** MUST NOT be populated when this is not supported by the HTTP server framework as the route attribute should have low-cardinality and the URI path can NOT substitute it.
SHOULD include the [application root](/docs/http/http-spans.md#http-server-definitions) if there is one.

`http.connection.state` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.
Expand All @@ -78,6 +81,13 @@ SHOULD include the [application root](/docs/http/http-spans.md#http-server-defin
| `PUT` | PUT method. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| `TRACE` | TRACE method. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |

`http.request.synthetic` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.

| Value | Description | Stability |
|---|---|---|
| `bot` | bot source. | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `synthetic test` | synthetic test source. | ![Experimental](https://img.shields.io/badge/-experimental-blue) |

## Deprecated HTTP Attributes

Describes deprecated HTTP attributes.
Expand Down
Loading
Loading