Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
24 changes: 24 additions & 0 deletions javascript/sentry-conventions/src/attributes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8723,6 +8723,9 @@ export type HTTP_FLAVOR_TYPE = string;
* Attribute defined in OTEL: No
* Visibility: public
*
* Aliases: {@link URL_FRAGMENT} `url.fragment`
*
* @deprecated Use {@link URL_FRAGMENT} (url.fragment) instead - `url.fragment` is supported by OTel and conceptually more fitting.
* @example "#details"
*/
export const HTTP_FRAGMENT = 'http.fragment';
Expand Down Expand Up @@ -8792,6 +8795,9 @@ export type HTTP_METHOD_TYPE = string;
* Attribute defined in OTEL: No
* Visibility: public
*
* Aliases: {@link URL_QUERY} `url.query`
*
* @deprecated Use {@link URL_QUERY} (url.query) instead - `url.query` is supported by OTel and conceptually more fitting.
* @example "?foo=bar&bar=baz"
*/
export const HTTP_QUERY = 'http.query';
Expand Down Expand Up @@ -15940,6 +15946,8 @@ export type URL_DOMAIN_TYPE = string;
* Attribute defined in OTEL: Yes
* Visibility: public
*
* Aliases: {@link HTTP_FRAGMENT} `http.fragment`
*
* @example "details"
*/
export const URL_FRAGMENT = 'url.fragment';
Expand Down Expand Up @@ -16056,6 +16064,8 @@ export type URL_PORT_TYPE = number;
* Attribute defined in OTEL: Yes
* Visibility: public
*
* Aliases: {@link HTTP_QUERY} `http.query`
*
* @example "foo=bar&bar=baz"
*/
export const URL_QUERY = 'url.query';
Expand Down Expand Up @@ -24320,6 +24330,12 @@ export const ATTRIBUTE_METADATA: Record<AttributeName, AttributeMetadata> = {
isInOtel: false,
visibility: 'public',
example: '#details',
deprecation: {
replacement: 'url.fragment',
reason: '`url.fragment` is supported by OTel and conceptually more fitting.',
status: 'backfill',
},
aliases: ['url.fragment'],
changelog: [{ version: '0.0.0' }],
},
'http.host': {
Expand Down Expand Up @@ -24366,6 +24382,12 @@ export const ATTRIBUTE_METADATA: Record<AttributeName, AttributeMetadata> = {
isInOtel: false,
visibility: 'public',
example: '?foo=bar&bar=baz',
deprecation: {
replacement: 'url.query',
reason: '`url.query` is supported by OTel and conceptually more fitting.',
status: 'backfill',
},
aliases: ['url.query'],
changelog: [{ version: '0.0.0' }],
},
'http.request.body.data': {
Expand Down Expand Up @@ -28755,6 +28777,7 @@ export const ATTRIBUTE_METADATA: Record<AttributeName, AttributeMetadata> = {
isInOtel: true,
visibility: 'public',
example: 'details',
aliases: ['http.fragment'],
changelog: [{ version: '0.0.0' }],
},
'url.full': {
Expand Down Expand Up @@ -28821,6 +28844,7 @@ export const ATTRIBUTE_METADATA: Record<AttributeName, AttributeMetadata> = {
isInOtel: true,
visibility: 'public',
example: 'foo=bar&bar=baz',
aliases: ['http.query'],
changelog: [{ version: '0.0.0' }],
},
'url.same_origin': {
Expand Down
6 changes: 6 additions & 0 deletions model/attributes/http/http__fragment.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
"apply_scrubbing": {
"key": "auto"
},
"deprecation": {
"_status": "backfill",
"replacement": "url.fragment",
"reason": "`url.fragment` is supported by OTel and conceptually more fitting."
},
"alias": ["url.fragment"],
"is_in_otel": false,
"example": "#details",
"visibility": "public",
Expand Down
6 changes: 6 additions & 0 deletions model/attributes/http/http__query.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
"key": "auto",
"reason": "Query string values can contain sensitive information. Clients should attempt to scrub parameters that might contain sensitive information."
},
"deprecation": {
"_status": "backfill",
"replacement": "url.query",
"reason": "`url.query` is supported by OTel and conceptually more fitting."
},

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Backfill ignores value format mismatch

High Severity

deprecation._status is set to backfill for http.query and http.fragment, but those values include a leading ?/# while url.query and url.fragment must not. Backfill copies values as-is, so ingest would write OTel-invalid replacements. Per CONTRIBUTING, incompatible values need transform or _status: null.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit b25bbcc. Configure here.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines +9 to +13

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: The deprecation status for http.query and http.fragment should be "transform" instead of "backfill" to handle semantic differences with their url.* replacements.
Severity: MEDIUM

Suggested Fix

Change the _status from "backfill" to "transform" for http.query and http.fragment. Create a corresponding transformation document to strip the leading ? and # characters from the values before assigning them to url.query and url.fragment.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: model/attributes/http/http__query.json#L9-L13

Potential issue: The deprecation status for `http.query` and `http.fragment` is
incorrectly set to `"backfill"`. This status implies a direct copy of the value to the
new attributes, `url.query` and `url.fragment`. However, the old attributes contain a
leading `?` or `#` character, while the new attributes should not. This direct copy will
result in semantically incorrect data for the new attributes. The contribution
guidelines state that a `"transform"` status should be used when a value cannot be
copied directly, which is the case here.

Also affects:

  • model/attributes/http/http__fragment.json:8~12

Did we get this right? 👍 / 👎 to inform future reviews.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"alias": ["url.query"],
"is_in_otel": false,
"example": "?foo=bar&bar=baz",
"visibility": "public",
Expand Down
1 change: 1 addition & 0 deletions model/attributes/url/url__fragment.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"apply_scrubbing": {
"key": "auto"
},
"alias": ["http.fragment"],
"is_in_otel": true,
"example": "details",
"visibility": "public",
Expand Down
1 change: 1 addition & 0 deletions model/attributes/url/url__query.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"key": "auto",
"reason": "Query string values can contain sensitive information. Clients should attempt to scrub parameters that might contain sensitive information."
},
"alias": ["http.query"],
"is_in_otel": true,
"example": "foo=bar&bar=baz",
"visibility": "public",
Expand Down
22 changes: 22 additions & 0 deletions python/src/sentry_conventions/attributes.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,10 @@ class _AttributeNamesMeta(type):
"HARDWARECONCURRENCY",
"HTTP_CLIENT_IP",
"HTTP_FLAVOR",
"HTTP_FRAGMENT",
"HTTP_HOST",
"HTTP_METHOD",
"HTTP_QUERY",
"_HTTP_REQUEST_METHOD",
"HTTP_RESPONSE_CONTENT_LENGTH",
"HTTP_RESPONSE_TRANSFER_SIZE",
Expand Down Expand Up @@ -5260,6 +5262,8 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta):
Apply Scrubbing: auto
Defined in OTEL: No
Visibility: public
Aliases: url.fragment
DEPRECATED: Use url.fragment instead - `url.fragment` is supported by OTel and conceptually more fitting.
Example: "#details"
"""

Expand Down Expand Up @@ -5297,6 +5301,8 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta):
Apply Scrubbing: auto - Query string values can contain sensitive information. Clients should attempt to scrub parameters that might contain sensitive information.
Defined in OTEL: No
Visibility: public
Aliases: url.query
DEPRECATED: Use url.query instead - `url.query` is supported by OTel and conceptually more fitting.
Example: "?foo=bar&bar=baz"
"""

Expand Down Expand Up @@ -9229,6 +9235,7 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta):
Apply Scrubbing: auto
Defined in OTEL: Yes
Visibility: public
Aliases: http.fragment
Example: "details"
"""

Expand Down Expand Up @@ -9289,6 +9296,7 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta):
Apply Scrubbing: auto - Query string values can contain sensitive information. Clients should attempt to scrub parameters that might contain sensitive information.
Defined in OTEL: Yes
Visibility: public
Aliases: http.query
Example: "foo=bar&bar=baz"
"""

Expand Down Expand Up @@ -15976,6 +15984,12 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta):
is_in_otel=False,
visibility=Visibility.PUBLIC,
example="#details",
deprecation=DeprecationInfo(
replacement="url.fragment",
reason="`url.fragment` is supported by OTel and conceptually more fitting.",
status=DeprecationStatus.BACKFILL,
),
aliases=["url.fragment"],
changelog=[
ChangelogEntry(version="0.0.0"),
],
Expand Down Expand Up @@ -16029,6 +16043,12 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta):
is_in_otel=False,
visibility=Visibility.PUBLIC,
example="?foo=bar&bar=baz",
deprecation=DeprecationInfo(
replacement="url.query",
reason="`url.query` is supported by OTel and conceptually more fitting.",
status=DeprecationStatus.BACKFILL,
),
aliases=["url.query"],
changelog=[
ChangelogEntry(version="0.0.0"),
],
Expand Down Expand Up @@ -20634,6 +20654,7 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta):
is_in_otel=True,
visibility=Visibility.PUBLIC,
example="details",
aliases=["http.fragment"],
changelog=[
ChangelogEntry(version="0.0.0"),
],
Expand Down Expand Up @@ -20700,6 +20721,7 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta):
is_in_otel=True,
visibility=Visibility.PUBLIC,
example="foo=bar&bar=baz",
aliases=["http.query"],
changelog=[
ChangelogEntry(version="0.0.0"),
],
Expand Down
Loading