Skip to content
Merged
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
47 changes: 45 additions & 2 deletions javascript/sentry-conventions/src/attributes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14070,6 +14070,30 @@ export const REMIX_ACTION_FORM_DATA_KEY_BASE = 'remix.action_form_data';
*/
export type REMIX_ACTION_FORM_DATA_KEY_TYPE = string;

// Path: model/attributes/replayId.json

/**
* The id of the sentry replay. `replayId`
*
* Attribute Value Type: `string` {@link REPLAYID_TYPE}
*
* Apply Scrubbing: never
*
* Attribute defined in OTEL: No
* Visibility: public
*
* Aliases: {@link SENTRY_REPLAY_ID} `sentry.replay_id`
*
* @deprecated Use {@link SENTRY_REPLAY_ID} (sentry.replay_id) instead
* @example "123e4567e89b12d3a456426614174000"
*/
export const REPLAYID = 'replayId';

/**
* Type for {@link REPLAYID} replayId
*/
export type REPLAYID_TYPE = string;

// Path: model/attributes/replay_id.json

/**
Expand Down Expand Up @@ -15736,7 +15760,7 @@ export type SENTRY_RELEASE_TYPE = string;
* Attribute defined in OTEL: No
* Visibility: public
*
* Aliases: {@link REPLAY_ID} `replay_id`
* Aliases: {@link REPLAY_ID} `replay_id`, {@link REPLAYID} `replayId`
*
* @example "123e4567e89b12d3a456426614174000"
*/
Expand Down Expand Up @@ -19358,6 +19382,7 @@ export const ATTRIBUTE_TYPE: Record<string, AttributeType> = {
'redis.key': 'string',
release: 'string',
'remix.action_form_data.<key>': 'string',
replayId: 'string',
replay_id: 'string',
'resource.deployment.environment': 'string',
'resource.deployment.environment.name': 'string',
Expand Down Expand Up @@ -20196,6 +20221,7 @@ export type AttributeName =
| typeof REDIS_KEY
| typeof RELEASE
| typeof REMIX_ACTION_FORM_DATA_KEY
| typeof REPLAYID
| typeof REPLAY_ID
| typeof RESOURCE_DEPLOYMENT_ENVIRONMENT
| typeof RESOURCE_DEPLOYMENT_ENVIRONMENT_NAME
Expand Down Expand Up @@ -30421,6 +30447,22 @@ export const ATTRIBUTE_METADATA: Record<AttributeName, AttributeMetadata> = {
example: "http.response.header.text='test'",
changelog: [{ version: '0.1.0', prs: [103] }],
},
replayId: {
brief: 'The id of the sentry replay.',
type: 'string',
keys: ['replayId'],
applyScrubbing: {
key: 'never',
},
isInOtel: false,
visibility: 'public',
example: '123e4567e89b12d3a456426614174000',
deprecation: {
replacement: 'sentry.replay_id',
},
aliases: ['sentry.replay_id'],
changelog: [{ version: 'next' }],
},
replay_id: {
brief: 'The id of the sentry replay.',
type: 'string',
Expand Down Expand Up @@ -31567,7 +31609,7 @@ export const ATTRIBUTE_METADATA: Record<AttributeName, AttributeMetadata> = {
isInOtel: false,
visibility: 'public',
example: '123e4567e89b12d3a456426614174000',
aliases: ['replay_id'],
aliases: ['replay_id', 'replayId'],
changelog: [{ version: '0.0.0' }],
searchAlias: {
name: 'replay.id',
Expand Down Expand Up @@ -34204,6 +34246,7 @@ export type Attributes = {
[REDIS_KEY]?: REDIS_KEY_TYPE;
[RELEASE]?: RELEASE_TYPE;
[REMIX_ACTION_FORM_DATA_KEY]?: REMIX_ACTION_FORM_DATA_KEY_TYPE;
[REPLAYID]?: REPLAYID_TYPE;
[REPLAY_ID]?: REPLAY_ID_TYPE;
[RESOURCE_DEPLOYMENT_ENVIRONMENT]?: RESOURCE_DEPLOYMENT_ENVIRONMENT_TYPE;
[RESOURCE_DEPLOYMENT_ENVIRONMENT_NAME]?: RESOURCE_DEPLOYMENT_ENVIRONMENT_NAME_TYPE;
Expand Down
14 changes: 14 additions & 0 deletions javascript/sentry-conventions/src/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3602,6 +3602,13 @@ export const SEARCH_REMIX__ACTION_FORM_DATA__KEY = 'remix.action_form_data.<key>
*/
export const SEARCH_REPLAY__ID = 'replay.id';

/**
* Search name for {@link attributes.REPLAYID}. `replayId`
*
* @deprecated Use {@link SEARCH_SENTRY__REPLAY_ID} (`sentry.replay_id`) instead
*/
export const SEARCH_REPLAYID = 'replayId';

/**
* Search name for {@link attributes.SENTRY_REPLAY_ID}. `replay_id`
*
Expand Down Expand Up @@ -5453,6 +5460,7 @@ export type AttributeSearchName =
| typeof SEARCH_RELEASE
| typeof SEARCH_REMIX__ACTION_FORM_DATA__KEY
| typeof SEARCH_REPLAY__ID
| typeof SEARCH_REPLAYID
| typeof SEARCH_REPLAY_ID
| typeof SEARCH_RESOURCE__DEPLOYMENT__ENVIRONMENT
| typeof SEARCH_RESOURCE__DEPLOYMENT__ENVIRONMENT__NAME
Expand Down Expand Up @@ -9742,6 +9750,12 @@ export const ATTRIBUTE_SEARCH_METADATA: Record<string, AttributeSearchMetadata>
brief: 'The id of the sentry replay.',
deprecationChain: ['sentry.replay_id', 'replay.id', 'replay_id'],
},
replayId: {
canonicalName: 'sentry.replay_id',
type: 'string',
brief: 'The id of the sentry replay.',
deprecationChain: ['replayId'],
},
replay_id: {
canonicalName: 'sentry.replay_id',
type: 'string',
Expand Down
21 changes: 21 additions & 0 deletions model/attributes/replayId.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"key": "replayId",
"brief": "The id of the sentry replay.",
"type": "string",
"apply_scrubbing": {
"key": "never"
},
"is_in_otel": false,
"example": "123e4567e89b12d3a456426614174000",
"alias": ["sentry.replay_id"],
"deprecation": {
"_status": null,
"replacement": "sentry.replay_id"
},
Comment on lines +11 to +14

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 replayId attribute has _status: null, which prevents it from being correctly linked to the sentry.replay_id deprecation chain, leading to incomplete query results.
Severity: MEDIUM

Suggested Fix

In model/attributes/replayId.json, change the _status field from null to "normalize". This will classify it as a rewriting deprecation and ensure it is correctly linked into the sentry.replay_id deprecation chain.

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/replayId.json#L11-L14

Potential issue: The `replayId` attribute is being deprecated with `_status: null` in
`replayId.json`. The `isRewritingDeprecation` function requires a non-null status to
identify a rewriting deprecation. Because the status is null, the
`deriveAttributeKeyChains` function fails to link `replayId` to the deprecation chain of
its canonical name, `sentry.replay_id`. This results in `replayId` having an isolated
deprecation chain, which prevents queries for `sentry.replay_id` from including results
from `replayId`, contrary to the PR's goal of transparently querying either name.

Also affects:

  • javascript/sentry-conventions/src/search.ts:9753~9758

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

"visibility": "public",
"changelog": [
{
"version": "next"
Comment thread
mjq marked this conversation as resolved.
}
]
}
2 changes: 1 addition & 1 deletion model/attributes/sentry/sentry__replay_id.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
},
"is_in_otel": false,
"example": "123e4567e89b12d3a456426614174000",
"alias": ["replay_id"],
"alias": ["replay_id", "replayId"],
"visibility": "public",
"search_alias": {
"name": "replay.id"
Expand Down
33 changes: 31 additions & 2 deletions python/src/sentry_conventions/attributes.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,7 @@ class _AttributeNamesMeta(type):
"REDIS_COMMAND",
"REDIS_KEY",
"RELEASE",
"REPLAYID",
"REPLAY_ID",
"RESOURCE_DEPLOYMENT_ENVIRONMENT",
"RESOURCE_DEPLOYMENT_ENVIRONMENT_NAME",
Expand Down Expand Up @@ -8320,6 +8321,19 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta):
Example: "http.response.header.text='test'"
"""

# Path: model/attributes/replayId.json
REPLAYID: Literal["replayId"] = "replayId"
"""The id of the sentry replay.

Type: str
Apply Scrubbing: never
Defined in OTEL: No
Visibility: public
Aliases: sentry.replay_id
DEPRECATED: Use sentry.replay_id instead
Example: "123e4567e89b12d3a456426614174000"
"""

# Path: model/attributes/replay_id.json
REPLAY_ID: Literal["replay_id"] = "replay_id"
"""The id of the sentry replay.
Expand Down Expand Up @@ -9240,7 +9254,7 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta):
Apply Scrubbing: never
Defined in OTEL: No
Visibility: public
Aliases: replay_id
Aliases: replay_id, replayId
Example: "123e4567e89b12d3a456426614174000"
"""

Expand Down Expand Up @@ -22725,6 +22739,20 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta):
ChangelogEntry(version="0.1.0", prs=[103]),
],
),
"replayId": AttributeMetadata(
brief="The id of the sentry replay.",
type=AttributeType.STRING,
keys=("replayId",),
apply_scrubbing=ApplyScrubbingInfo(key=ApplyScrubbing.NEVER),
is_in_otel=False,
visibility=Visibility.PUBLIC,
example="123e4567e89b12d3a456426614174000",
deprecation=DeprecationInfo(replacement="sentry.replay_id"),
aliases=["sentry.replay_id"],
changelog=[
ChangelogEntry(version="next"),
],
),
"replay_id": AttributeMetadata(
brief="The id of the sentry replay.",
type=AttributeType.STRING,
Expand Down Expand Up @@ -23975,7 +24003,7 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta):
is_in_otel=False,
visibility=Visibility.PUBLIC,
example="123e4567e89b12d3a456426614174000",
aliases=["replay_id"],
aliases=["replay_id", "replayId"],
changelog=[
ChangelogEntry(version="0.0.0"),
],
Expand Down Expand Up @@ -26850,6 +26878,7 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta):
"redis.key": str,
"release": str,
"remix.action_form_data.<key>": str,
"replayId": str,
"replay_id": str,
"resource.deployment.environment": str,
"resource.deployment.environment.name": str,
Expand Down
Loading