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
13 changes: 10 additions & 3 deletions javascript/sentry-conventions/src/attributes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7128,7 +7128,7 @@ export type FRAMES_TOTAL_TYPE = number;
* Attribute defined in OTEL: No
* Visibility: public
*
* @deprecated Use {@link ERROR_TYPE} (error.type) instead - This attribute is not part of the OpenTelemetry specification and error.type fits much better.
* @deprecated Use {@link ERROR_TYPE} (error.type) instead - This attribute is not part of the OpenTelemetry specification and error.type fits much better. The value changes from the full error message to the syscall error code, so the old value cannot be copied over.
* @example "ENOENT: no such file or directory"
*/
export const FS_ERROR = 'fs_error';
Expand Down Expand Up @@ -25261,9 +25261,16 @@ export const ATTRIBUTE_METADATA: Record<AttributeName, AttributeMetadata> = {
example: 'ENOENT: no such file or directory',
deprecation: {
replacement: 'error.type',
reason: 'This attribute is not part of the OpenTelemetry specification and error.type fits much better.',
reason:
'This attribute is not part of the OpenTelemetry specification and error.type fits much better. The value changes from the full error message to the syscall error code, so the old value cannot be copied over.',
status: 'transform',
transformation: 'fs_error_to_error_type',
},
changelog: [{ version: '0.1.0', prs: [61, 127] }, { version: '0.0.0' }],
changelog: [
{ version: 'next', description: 'Transform fs_error into error.type' },
{ version: '0.1.0', prs: [61, 127] },
{ version: '0.0.0' },
],
},
'gcp.function.context.event_id': {
brief: 'The event ID from the legacy GCP Cloud Function context (1st gen)',
Expand Down
52 changes: 52 additions & 0 deletions model/attribute_transformations/fs_error_to_error_type.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"id": "fs_error_to_error_type",
"brief": "Transform deprecated fs_error values into the syscall error code that error.type holds.",
"inputs": [
{
"attribute": "fs_error",
"brief": "Deprecated file system error message to transform."
}
],
"outputs": [
{
"attribute": "error.type",
"brief": "Class of the error, given as the syscall error code."
}
],
"actions": [
"If error.type is already present, keep it and do not overwrite it.",
"Read fs_error as a string.",
"Take the text before the first colon as the syscall error code.",
"Remove the surrounding whitespace from that text.",
"If the result is empty, or if the text before the first colon is not fully uppercase letters, digits and underscores, do not write error.type.",
"Write the syscall error code to error.type.",
"Remove fs_error once the deprecated attribute is normalized."
],
"examples": [
{
"name": "error message with a path",
"input": {
"fs_error": "ENOENT: no such file or directory, open '/tmp/missing.txt'"
},
"output": {
"error.type": "ENOENT"
}
},
{
"name": "error message without a path",
"input": {
"fs_error": "EACCES: permission denied"
},
"output": {
"error.type": "EACCES"
}
},
{
"name": "message without a syscall error code",
"input": {
"fs_error": "something went wrong"
},
"output": {}
}
]
}
9 changes: 7 additions & 2 deletions model/attributes/fs_error.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,17 @@
"is_in_otel": false,
"example": "ENOENT: no such file or directory",
"deprecation": {
"_status": null,
"_status": "transform",
"replacement": "error.type",
"reason": "This attribute is not part of the OpenTelemetry specification and error.type fits much better."
"transformation": "fs_error_to_error_type",
"reason": "This attribute is not part of the OpenTelemetry specification and error.type fits much better. The value changes from the full error message to the syscall error code, so the old value cannot be copied over."
},
"visibility": "public",
"changelog": [
{
"version": "next",
"description": "Transform fs_error into error.type"
},
{
"version": "0.1.0",
"prs": [61, 127]
Expand Down
9 changes: 7 additions & 2 deletions python/src/sentry_conventions/attributes.py
Original file line number Diff line number Diff line change
Expand Up @@ -4390,7 +4390,7 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta):
Apply Scrubbing: manual
Defined in OTEL: No
Visibility: public
DEPRECATED: Use error.type instead - This attribute is not part of the OpenTelemetry specification and error.type fits much better.
DEPRECATED: Use error.type instead - This attribute is not part of the OpenTelemetry specification and error.type fits much better. The value changes from the full error message to the syscall error code, so the old value cannot be copied over.
Example: "ENOENT: no such file or directory"
"""

Expand Down Expand Up @@ -16733,9 +16733,14 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta):
example="ENOENT: no such file or directory",
deprecation=DeprecationInfo(
replacement="error.type",
reason="This attribute is not part of the OpenTelemetry specification and error.type fits much better.",
reason="This attribute is not part of the OpenTelemetry specification and error.type fits much better. The value changes from the full error message to the syscall error code, so the old value cannot be copied over.",
status=DeprecationStatus.TRANSFORM,
transformation="fs_error_to_error_type",
),
changelog=[
ChangelogEntry(
version="next", description="Transform fs_error into error.type"
),
ChangelogEntry(version="0.1.0", prs=[61, 127]),
ChangelogEntry(version="0.0.0"),
],
Expand Down
Loading