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
61 changes: 54 additions & 7 deletions javascript/sentry-conventions/src/attributes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1882,6 +1882,30 @@ export const AWS_LOG_STREAM_NAMES = 'aws.log.stream.names';
*/
export type AWS_LOG_STREAM_NAMES_TYPE = Array<string>;

// Path: model/attributes/aws/aws__request__url.json

/**
* The URL of the AWS API request. `aws.request.url`
*
* Attribute Value Type: `string` {@link AWS_REQUEST_URL_TYPE}
*
* Apply Scrubbing: auto
*
* Attribute defined in OTEL: No
* Visibility: public
*
* Aliases: {@link URL_FULL} `url.full`, {@link HTTP_URL} `http.url`, {@link URL} `url`
*
* @deprecated Use {@link URL_FULL} (url.full) instead - This attribute is being deprecated in favor of url.full, which is the OTel-aligned replacement.
* @example "https://sqs.us-east-1.amazonaws.com/123456789/my-queue"
*/
export const AWS_REQUEST_URL = 'aws.request.url';

/**
* Type for {@link AWS_REQUEST_URL} aws.request.url
*/
export type AWS_REQUEST_URL_TYPE = string;

// Path: model/attributes/blocked_main_thread.json

/**
Expand Down Expand Up @@ -8058,7 +8082,7 @@ export type HTTP_TARGET_TYPE = string;
* Attribute defined in OTEL: Yes
* Visibility: public
*
* Aliases: {@link URL_FULL} `url.full`, {@link URL} `url`
* Aliases: {@link URL_FULL} `url.full`, {@link URL} `url`, {@link AWS_REQUEST_URL} `aws.request.url`
*
* @deprecated Use {@link URL_FULL} (url.full) instead
* @example "https://example.com/test?foo=bar#buzz"
Expand Down Expand Up @@ -13679,7 +13703,7 @@ export type UI_ELEMENT_WIDTH_TYPE = number;
* Attribute defined in OTEL: No
* Visibility: public
*
* Aliases: {@link URL_FULL} `url.full`, {@link HTTP_URL} `http.url`
* Aliases: {@link URL_FULL} `url.full`, {@link HTTP_URL} `http.url`, {@link AWS_REQUEST_URL} `aws.request.url`
*
* @deprecated Use {@link URL_FULL} (url.full) instead
* @example "https://example.com/test?foo=bar#buzz"
Expand Down Expand Up @@ -13745,7 +13769,7 @@ export type URL_FRAGMENT_TYPE = string;
* Attribute defined in OTEL: Yes
* Visibility: public
*
* Aliases: {@link HTTP_URL} `http.url`, {@link URL} `url`
* Aliases: {@link HTTP_URL} `http.url`, {@link URL} `url`, {@link AWS_REQUEST_URL} `aws.request.url`
*
* @example "https://example.com/test?foo=bar#buzz"
*/
Expand Down Expand Up @@ -15087,6 +15111,7 @@ export const ATTRIBUTE_TYPE: Record<string, AttributeType> = {
'aws.lambda.remaining_time_in_millis': 'double',
'aws.log.group.names': 'string[]',
'aws.log.stream.names': 'string[]',
'aws.request.url': 'string',
blocked_main_thread: 'boolean',
'browser.name': 'string',
'browser.performance.navigation.activation_start': 'double',
Expand Down Expand Up @@ -15769,6 +15794,7 @@ export type AttributeName =
| typeof AWS_LAMBDA_REMAINING_TIME_IN_MILLIS
| typeof AWS_LOG_GROUP_NAMES
| typeof AWS_LOG_STREAM_NAMES
| typeof AWS_REQUEST_URL
| typeof BLOCKED_MAIN_THREAD
| typeof BROWSER_NAME
| typeof BROWSER_PERFORMANCE_NAVIGATION_ACTIVATION_START
Expand Down Expand Up @@ -17587,6 +17613,22 @@ export const ATTRIBUTE_METADATA: Record<AttributeName, AttributeMetadata> = {
example: ['logs/main/10838bed-421f-43ef-870a-f43feacbbb5b'],
changelog: [{ version: '0.11.1', prs: [414] }],
},
'aws.request.url': {
brief: 'The URL of the AWS API request.',
type: 'string',
applyScrubbing: {
key: 'auto',
},
isInOtel: false,
visibility: 'public',
example: 'https://sqs.us-east-1.amazonaws.com/123456789/my-queue',
deprecation: {
replacement: 'url.full',
reason: 'This attribute is being deprecated in favor of url.full, which is the OTel-aligned replacement.',
},
aliases: ['url.full', 'http.url', 'url'],
changelog: [{ version: 'next', description: 'Added aws.request.url attribute, deprecated in favor of url.full' }],
},
blocked_main_thread: {
Comment on lines +17629 to 17632

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 JavaScript code generation for attribute metadata omits the deprecation._status field, unlike the Python generation, leading to incomplete deprecation information in the generated JS file.
Severity: MEDIUM

Suggested Fix

Update the generateMetadataDict function for JavaScript to handle the deprecation._status field, similar to the Python generation logic. This includes adding a status field to the TypeScript DeprecationInfo interface and then populating it in the generation script, ensuring the generated JavaScript metadata contains the complete deprecation information.

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: javascript/sentry-conventions/src/attributes.ts#L17629-L17632

Potential issue: The `generateMetadataDict` function in the code generation script does
not include the `deprecation._status` field when generating the JavaScript metadata
dictionary. This is in contrast to the Python generation logic, which correctly
processes and includes this field. As a result, the generated JavaScript
`AttributeMetadata` for deprecated attributes, such as `aws.request.url`, is missing the
`status` field within its `deprecation` object. This asymmetry means consumers of the
JavaScript metadata cannot distinguish between different deprecation types (e.g.,
'backfill'), unlike consumers of the Python metadata.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Not introduced by this PR afait

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ah yeah the bot sometimes flags this but I don't think the status has any value for the generated JS. If anyone needs it, we can adjust it but feel free to ignore for the moment.

brief: 'Whether the main thread was blocked by the span.',
type: 'boolean',
Expand Down Expand Up @@ -21375,7 +21417,7 @@ export const ATTRIBUTE_METADATA: Record<AttributeName, AttributeMetadata> = {
deprecation: {
replacement: 'url.full',
},
aliases: ['url.full', 'url'],
aliases: ['url.full', 'url', 'aws.request.url'],
changelog: [{ version: '0.1.0', prs: [61, 108] }, { version: '0.0.0' }],
},
'http.user_agent': {
Expand Down Expand Up @@ -24706,7 +24748,7 @@ export const ATTRIBUTE_METADATA: Record<AttributeName, AttributeMetadata> = {
deprecation: {
replacement: 'url.full',
},
aliases: ['url.full', 'http.url'],
aliases: ['url.full', 'http.url', 'aws.request.url'],
changelog: [{ version: '0.1.0', prs: [61] }, { version: '0.0.0' }],
},
'url.domain': {
Expand Down Expand Up @@ -24742,8 +24784,12 @@ export const ATTRIBUTE_METADATA: Record<AttributeName, AttributeMetadata> = {
isInOtel: true,
visibility: 'public',
example: 'https://example.com/test?foo=bar#buzz',
aliases: ['http.url', 'url'],
changelog: [{ version: '0.1.0', prs: [108] }, { version: '0.0.0' }],
aliases: ['http.url', 'url', 'aws.request.url'],
changelog: [
{ version: 'next', description: 'Added aws.request.url as an alias' },
{ version: '0.1.0', prs: [108] },
{ version: '0.0.0' },
],
},
'url.path': {
brief: 'The URI path component.',
Expand Down Expand Up @@ -25479,6 +25525,7 @@ export type Attributes = {
[AWS_LAMBDA_REMAINING_TIME_IN_MILLIS]?: AWS_LAMBDA_REMAINING_TIME_IN_MILLIS_TYPE;
[AWS_LOG_GROUP_NAMES]?: AWS_LOG_GROUP_NAMES_TYPE;
[AWS_LOG_STREAM_NAMES]?: AWS_LOG_STREAM_NAMES_TYPE;
[AWS_REQUEST_URL]?: AWS_REQUEST_URL_TYPE;
[BLOCKED_MAIN_THREAD]?: BLOCKED_MAIN_THREAD_TYPE;
[BROWSER_NAME]?: BROWSER_NAME_TYPE;
[BROWSER_PERFORMANCE_NAVIGATION_ACTIVATION_START]?: BROWSER_PERFORMANCE_NAVIGATION_ACTIVATION_START_TYPE;
Expand Down
23 changes: 23 additions & 0 deletions model/attributes/aws/aws__request__url.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"key": "aws.request.url",
"brief": "The URL of the AWS API request.",
"type": "string",
"apply_scrubbing": {
"key": "auto"
},
"is_in_otel": false,
"example": "https://sqs.us-east-1.amazonaws.com/123456789/my-queue",
"alias": ["url.full", "http.url", "url"],
"deprecation": {
"_status": "backfill",
"replacement": "url.full",
"reason": "This attribute is being deprecated in favor of url.full, which is the OTel-aligned replacement."
},
"visibility": "public",
"changelog": [
{
"version": "next",
"description": "Added aws.request.url attribute, deprecated in favor of url.full"
}
]
}
2 changes: 1 addition & 1 deletion model/attributes/http/http__url.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
},
"is_in_otel": true,
"example": "https://example.com/test?foo=bar#buzz",
"alias": ["url.full", "url"],
"alias": ["url.full", "url", "aws.request.url"],
"deprecation": {
"_status": null,
"replacement": "url.full"
Expand Down
2 changes: 1 addition & 1 deletion model/attributes/url.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
},
"is_in_otel": false,
"example": "https://example.com/test?foo=bar#buzz",
"alias": ["url.full", "http.url"],
"alias": ["url.full", "http.url", "aws.request.url"],
"deprecation": {
"_status": null,
"replacement": "url.full"
Expand Down
6 changes: 5 additions & 1 deletion model/attributes/url/url__full.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@
},
"is_in_otel": true,
"example": "https://example.com/test?foo=bar#buzz",
"alias": ["http.url", "url"],
"alias": ["http.url", "url", "aws.request.url"],
"visibility": "public",
"changelog": [
{
"version": "next",
"description": "Added aws.request.url as an alias"
},
{
"version": "0.1.0",
"prs": [108]
Expand Down
50 changes: 44 additions & 6 deletions python/src/sentry_conventions/attributes.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ class _AttributeNamesMeta(type):
"AWS_LAMBDA_FUNCTION_NAME",
"AWS_LAMBDA_FUNCTION_VERSION",
"AWS_LAMBDA_INVOKED_FUNCTION_ARN",
"AWS_REQUEST_URL",
"CLOUDFLARE_D1_QUERY_TYPE",
"CLS_SOURCE_KEY",
"CLS",
Expand Down Expand Up @@ -1344,6 +1345,19 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta):
Example: ["logs/main/10838bed-421f-43ef-870a-f43feacbbb5b"]
"""

# Path: model/attributes/aws/aws__request__url.json
AWS_REQUEST_URL: Literal["aws.request.url"] = "aws.request.url"
"""The URL of the AWS API request.

Type: str
Apply Scrubbing: auto
Defined in OTEL: No
Visibility: public
Aliases: url.full, http.url, url
DEPRECATED: Use url.full instead - This attribute is being deprecated in favor of url.full, which is the OTel-aligned replacement.
Example: "https://sqs.us-east-1.amazonaws.com/123456789/my-queue"
"""

# Path: model/attributes/blocked_main_thread.json
BLOCKED_MAIN_THREAD: Literal["blocked_main_thread"] = "blocked_main_thread"
"""Whether the main thread was blocked by the span.
Expand Down Expand Up @@ -4843,7 +4857,7 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta):
Apply Scrubbing: auto
Defined in OTEL: Yes
Visibility: public
Aliases: url.full, url
Aliases: url.full, url, aws.request.url
DEPRECATED: Use url.full instead
Example: "https://example.com/test?foo=bar#buzz"
"""
Expand Down Expand Up @@ -7954,7 +7968,7 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta):
Apply Scrubbing: auto
Defined in OTEL: Yes
Visibility: public
Aliases: http.url, url
Aliases: http.url, url, aws.request.url
Example: "https://example.com/test?foo=bar#buzz"
"""

Expand Down Expand Up @@ -8051,7 +8065,7 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta):
Apply Scrubbing: auto
Defined in OTEL: No
Visibility: public
Aliases: url.full, http.url
Aliases: url.full, http.url, aws.request.url
DEPRECATED: Use url.full instead
Example: "https://example.com/test?foo=bar#buzz"
"""
Expand Down Expand Up @@ -9950,6 +9964,26 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta):
ChangelogEntry(version="0.11.1", prs=[414]),
],
),
"aws.request.url": AttributeMetadata(
brief="The URL of the AWS API request.",
type=AttributeType.STRING,
apply_scrubbing=ApplyScrubbingInfo(key=ApplyScrubbing.AUTO),
is_in_otel=False,
visibility=Visibility.PUBLIC,
example="https://sqs.us-east-1.amazonaws.com/123456789/my-queue",
deprecation=DeprecationInfo(
replacement="url.full",
reason="This attribute is being deprecated in favor of url.full, which is the OTel-aligned replacement.",
status=DeprecationStatus.BACKFILL,
),
aliases=["url.full", "http.url", "url"],
changelog=[
ChangelogEntry(
version="next",
description="Added aws.request.url attribute, deprecated in favor of url.full",
),
],
),
"blocked_main_thread": AttributeMetadata(
brief="Whether the main thread was blocked by the span.",
type=AttributeType.BOOLEAN,
Expand Down Expand Up @@ -14042,7 +14076,7 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta):
visibility=Visibility.PUBLIC,
example="https://example.com/test?foo=bar#buzz",
deprecation=DeprecationInfo(replacement="url.full"),
aliases=["url.full", "url"],
aliases=["url.full", "url", "aws.request.url"],
changelog=[
ChangelogEntry(version="0.1.0", prs=[61, 108]),
ChangelogEntry(version="0.0.0"),
Expand Down Expand Up @@ -17573,8 +17607,11 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta):
is_in_otel=True,
visibility=Visibility.PUBLIC,
example="https://example.com/test?foo=bar#buzz",
aliases=["http.url", "url"],
aliases=["http.url", "url", "aws.request.url"],
changelog=[
ChangelogEntry(
version="next", description="Added aws.request.url as an alias"
),
ChangelogEntry(version="0.1.0", prs=[108]),
ChangelogEntry(version="0.0.0"),
],
Expand Down Expand Up @@ -17684,7 +17721,7 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta):
visibility=Visibility.PUBLIC,
example="https://example.com/test?foo=bar#buzz",
deprecation=DeprecationInfo(replacement="url.full"),
aliases=["url.full", "http.url"],
aliases=["url.full", "http.url", "aws.request.url"],
changelog=[
ChangelogEntry(version="0.1.0", prs=[61]),
ChangelogEntry(version="0.0.0"),
Expand Down Expand Up @@ -18327,6 +18364,7 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta):
"aws.lambda.remaining_time_in_millis": float,
"aws.log.group.names": List[str],
"aws.log.stream.names": List[str],
"aws.request.url": str,
"blocked_main_thread": bool,
"browser.name": str,
"browser.performance.navigation.activation_start": float,
Expand Down
Loading