From 2e9727895ee2f2f837c5f1cd4370c8cb59be53f2 Mon Sep 17 00:00:00 2001 From: Matt Quinn Date: Fri, 9 Oct 2026 10:21:56 -0400 Subject: [PATCH] fix(attributes): Apply consistent scrubbing across deprecations --- .../sentry-conventions/src/attributes.ts | 52 +++++++++---------- model/attributes/ai/ai__function_call.json | 2 +- model/attributes/ai/ai__preamble.json | 2 +- model/attributes/ai/ai__texts.json | 2 +- model/attributes/ai/ai__tool_calls.json | 2 +- model/attributes/environment.json | 2 +- .../gen_ai/gen_ai__system__message.json | 2 +- .../gen_ai/gen_ai__tool__message.json | 2 +- .../mcp/mcp__tool__result__content.json | 2 +- model/attributes/net/net__peer__name.json | 2 +- .../resource__deployment__environment.json | 2 +- ...source__deployment__environment__name.json | 2 +- .../sentry/sentry__transaction.json | 2 +- model/attributes/server_name.json | 2 +- python/src/sentry_conventions/attributes.py | 52 +++++++++---------- test/attributes.test.ts | 17 ++++++ test/mcp-result-attributes.test.ts | 12 ----- 17 files changed, 82 insertions(+), 77 deletions(-) diff --git a/javascript/sentry-conventions/src/attributes.ts b/javascript/sentry-conventions/src/attributes.ts index 995b46e53..044ae975f 100644 --- a/javascript/sentry-conventions/src/attributes.ts +++ b/javascript/sentry-conventions/src/attributes.ts @@ -147,7 +147,7 @@ export type AI_FREQUENCY_PENALTY_TYPE = number; * * Attribute Value Type: `string` {@link AI_FUNCTION_CALL_TYPE} * - * Apply Scrubbing: auto + * Apply Scrubbing: manual * * Attribute defined in OTEL: No * Visibility: public @@ -359,7 +359,7 @@ export type AI_PIPELINE_NAME_TYPE = string; * * Attribute Value Type: `string` {@link AI_PREAMBLE_TYPE} * - * Apply Scrubbing: auto + * Apply Scrubbing: manual * * Attribute defined in OTEL: No * Visibility: public @@ -867,7 +867,7 @@ export type AI_TEMPERATURE_TYPE = number; * * Attribute Value Type: `Array` {@link AI_TEXTS_TYPE} * - * Apply Scrubbing: auto + * Apply Scrubbing: manual * * Attribute defined in OTEL: No * Visibility: public @@ -961,7 +961,7 @@ export type AI_TOOLS_TYPE = Array; * * Attribute Value Type: `Array` {@link AI_TOOL_CALLS_TYPE} * - * Apply Scrubbing: auto + * Apply Scrubbing: manual * * Attribute defined in OTEL: No * Visibility: public @@ -6678,7 +6678,7 @@ export type EFFECTIVECONNECTIONTYPE_TYPE = string; * * Attribute Value Type: `string` {@link ENVIRONMENT_TYPE} * - * Apply Scrubbing: manual + * Apply Scrubbing: never * * Attribute defined in OTEL: No * Visibility: public @@ -8880,7 +8880,7 @@ export type GEN_AI_SYSTEM_INSTRUCTIONS_TYPE = string; * * Attribute Value Type: `string` {@link GEN_AI_SYSTEM_MESSAGE_TYPE} * - * Apply Scrubbing: auto + * Apply Scrubbing: manual * * Attribute defined in OTEL: No * Visibility: public @@ -9016,7 +9016,7 @@ export type GEN_AI_TOOL_INPUT_TYPE = string; * * Attribute Value Type: `string` {@link GEN_AI_TOOL_MESSAGE_TYPE} * - * Apply Scrubbing: auto + * Apply Scrubbing: manual * * Attribute defined in OTEL: No * Visibility: public @@ -12331,7 +12331,7 @@ export type MCP_TOOL_NAME_TYPE = string; * * Attribute Value Type: `string` {@link MCP_TOOL_RESULT_CONTENT_TYPE} * - * Apply Scrubbing: auto - Tool results can contain user data + * Apply Scrubbing: manual - Tool results can contain user data * * Attribute defined in OTEL: No * Visibility: public @@ -13964,7 +13964,7 @@ export type NET_PEER_IP_TYPE = string; * * Attribute Value Type: `string` {@link NET_PEER_NAME_TYPE} * - * Apply Scrubbing: auto + * Apply Scrubbing: manual * * Attribute defined in OTEL: Yes * Visibility: public @@ -15343,7 +15343,7 @@ export type REPLAY_ID_TYPE = string; * * Attribute Value Type: `string` {@link RESOURCE_DEPLOYMENT_ENVIRONMENT_TYPE} * - * Apply Scrubbing: manual + * Apply Scrubbing: never * * Attribute defined in OTEL: Yes * Visibility: public @@ -15365,7 +15365,7 @@ export type RESOURCE_DEPLOYMENT_ENVIRONMENT_TYPE = string; * * Attribute Value Type: `string` {@link RESOURCE_DEPLOYMENT_ENVIRONMENT_NAME_TYPE} * - * Apply Scrubbing: manual + * Apply Scrubbing: never * * Attribute defined in OTEL: Yes * Visibility: public @@ -17610,7 +17610,7 @@ export type SENTRY_TRACE_STATUS_TYPE = string; * * Attribute Value Type: `string` {@link SENTRY_TRANSACTION_TYPE} * - * Apply Scrubbing: never + * Apply Scrubbing: manual * * Attribute defined in OTEL: No * Visibility: public @@ -17841,7 +17841,7 @@ export type SERVER_ADDRESS_TYPE = string; * * Attribute Value Type: `string` {@link SERVER_NAME_TYPE} * - * Apply Scrubbing: auto + * Apply Scrubbing: manual * * Attribute defined in OTEL: No * Visibility: public @@ -22351,7 +22351,7 @@ export const ATTRIBUTE_METADATA: Record = { type: 'string', keys: ['gen_ai.tool.name', 'ai.function_call', 'mcp.tool.name'], applyScrubbing: { - key: 'auto', + key: 'manual', }, isInOtel: false, visibility: 'public', @@ -22525,7 +22525,7 @@ export const ATTRIBUTE_METADATA: Record = { type: 'string', keys: ['gen_ai.system_instructions', 'ai.preamble', 'gen_ai.system.message'], applyScrubbing: { - key: 'auto', + key: 'manual', }, isInOtel: false, visibility: 'public', @@ -22934,7 +22934,7 @@ export const ATTRIBUTE_METADATA: Record = { 'gen_ai.prompt', ], applyScrubbing: { - key: 'auto', + key: 'manual', }, isInOtel: false, visibility: 'public', @@ -23018,7 +23018,7 @@ export const ATTRIBUTE_METADATA: Record = { type: 'string[]', keys: ['gen_ai.output.messages', 'ai.response.text', 'ai.response.toolCalls', 'ai.responses', 'ai.tool_calls'], applyScrubbing: { - key: 'auto', + key: 'manual', }, isInOtel: false, visibility: 'public', @@ -26899,7 +26899,7 @@ export const ATTRIBUTE_METADATA: Record = { 'resource.deployment.environment.name', ], applyScrubbing: { - key: 'manual', + key: 'never', }, isInOtel: false, visibility: 'public', @@ -28485,7 +28485,7 @@ export const ATTRIBUTE_METADATA: Record = { type: 'string', keys: ['gen_ai.system_instructions', 'ai.preamble', 'gen_ai.system.message'], applyScrubbing: { - key: 'auto', + key: 'manual', }, isInOtel: false, visibility: 'public', @@ -28605,7 +28605,7 @@ export const ATTRIBUTE_METADATA: Record = { 'mcp.tool.result.content', ], applyScrubbing: { - key: 'auto', + key: 'manual', }, isInOtel: false, visibility: 'public', @@ -31199,7 +31199,7 @@ export const ATTRIBUTE_METADATA: Record = { 'mcp.tool.result.content', ], applyScrubbing: { - key: 'auto', + key: 'manual', reason: 'Tool results can contain user data', }, isInOtel: false, @@ -32639,7 +32639,7 @@ export const ATTRIBUTE_METADATA: Record = { type: 'string', keys: ['net.peer.name'], applyScrubbing: { - key: 'auto', + key: 'manual', }, isInOtel: true, visibility: 'public', @@ -33594,7 +33594,7 @@ export const ATTRIBUTE_METADATA: Record = { 'resource.deployment.environment.name', ], applyScrubbing: { - key: 'manual', + key: 'never', }, isInOtel: true, visibility: 'public', @@ -33615,7 +33615,7 @@ export const ATTRIBUTE_METADATA: Record = { 'resource.deployment.environment.name', ], applyScrubbing: { - key: 'manual', + key: 'never', }, isInOtel: true, visibility: 'public', @@ -35162,7 +35162,7 @@ export const ATTRIBUTE_METADATA: Record = { type: 'string', keys: ['sentry.segment.name', 'transaction', 'sentry.transaction'], applyScrubbing: { - key: 'never', + key: 'manual', }, isInOtel: false, visibility: 'public', @@ -35355,7 +35355,7 @@ export const ATTRIBUTE_METADATA: Record = { type: 'string', keys: ['server.address', 'address', 'http.server_name', 'net.host.name', 'server_name'], applyScrubbing: { - key: 'auto', + key: 'manual', }, isInOtel: false, visibility: 'public', diff --git a/model/attributes/ai/ai__function_call.json b/model/attributes/ai/ai__function_call.json index b66a3b6ef..07428218a 100644 --- a/model/attributes/ai/ai__function_call.json +++ b/model/attributes/ai/ai__function_call.json @@ -3,7 +3,7 @@ "brief": "For an AI model call, the function that was called. This is deprecated for OpenAI, and replaced by tool_calls", "type": "string", "apply_scrubbing": { - "key": "auto" + "key": "manual" }, "is_in_otel": false, "example": "function_name", diff --git a/model/attributes/ai/ai__preamble.json b/model/attributes/ai/ai__preamble.json index 35be9b01f..5a67d1add 100644 --- a/model/attributes/ai/ai__preamble.json +++ b/model/attributes/ai/ai__preamble.json @@ -3,7 +3,7 @@ "brief": "For an AI model call, the preamble parameter. Preambles are a part of the prompt used to adjust the model's overall behavior and conversation style.", "type": "string", "apply_scrubbing": { - "key": "auto" + "key": "manual" }, "is_in_otel": false, "example": "You are now a clown.", diff --git a/model/attributes/ai/ai__texts.json b/model/attributes/ai/ai__texts.json index 78bf80ebf..6b85de2d2 100644 --- a/model/attributes/ai/ai__texts.json +++ b/model/attributes/ai/ai__texts.json @@ -3,7 +3,7 @@ "brief": "Raw text inputs provided to the model.", "type": "string[]", "apply_scrubbing": { - "key": "auto" + "key": "manual" }, "is_in_otel": false, "example": ["Hello, how are you?", "What is the capital of France?"], diff --git a/model/attributes/ai/ai__tool_calls.json b/model/attributes/ai/ai__tool_calls.json index ee30763ab..0b9db9b0a 100644 --- a/model/attributes/ai/ai__tool_calls.json +++ b/model/attributes/ai/ai__tool_calls.json @@ -3,7 +3,7 @@ "brief": "For an AI model call, the tool calls that were made.", "type": "string[]", "apply_scrubbing": { - "key": "auto" + "key": "manual" }, "is_in_otel": false, "example": ["tool_call_1", "tool_call_2"], diff --git a/model/attributes/environment.json b/model/attributes/environment.json index 3a8da75e1..386a9d781 100644 --- a/model/attributes/environment.json +++ b/model/attributes/environment.json @@ -3,7 +3,7 @@ "brief": "The sentry environment.", "type": "string", "apply_scrubbing": { - "key": "manual" + "key": "never" }, "is_in_otel": false, "example": "production", diff --git a/model/attributes/gen_ai/gen_ai__system__message.json b/model/attributes/gen_ai/gen_ai__system__message.json index f194ec5a7..0f9aa1cb2 100644 --- a/model/attributes/gen_ai/gen_ai__system__message.json +++ b/model/attributes/gen_ai/gen_ai__system__message.json @@ -3,7 +3,7 @@ "brief": "The system instructions passed to the model.", "type": "string", "apply_scrubbing": { - "key": "auto" + "key": "manual" }, "is_in_otel": false, "example": "You are a helpful assistant", diff --git a/model/attributes/gen_ai/gen_ai__tool__message.json b/model/attributes/gen_ai/gen_ai__tool__message.json index 69c04dc2c..382666728 100644 --- a/model/attributes/gen_ai/gen_ai__tool__message.json +++ b/model/attributes/gen_ai/gen_ai__tool__message.json @@ -3,7 +3,7 @@ "brief": "The response from a tool or function call passed to the model.", "type": "string", "apply_scrubbing": { - "key": "auto" + "key": "manual" }, "is_in_otel": false, "example": "rainy, 57°F", diff --git a/model/attributes/mcp/mcp__tool__result__content.json b/model/attributes/mcp/mcp__tool__result__content.json index 214b5a37c..9973b96b5 100644 --- a/model/attributes/mcp/mcp__tool__result__content.json +++ b/model/attributes/mcp/mcp__tool__result__content.json @@ -3,7 +3,7 @@ "brief": "The content of the tool result.", "type": "string", "apply_scrubbing": { - "key": "auto", + "key": "manual", "reason": "Tool results can contain user data" }, "is_in_otel": false, diff --git a/model/attributes/net/net__peer__name.json b/model/attributes/net/net__peer__name.json index 1771ec5cb..dbe9c1144 100644 --- a/model/attributes/net/net__peer__name.json +++ b/model/attributes/net/net__peer__name.json @@ -3,7 +3,7 @@ "brief": "Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name.", "type": "string", "apply_scrubbing": { - "key": "auto" + "key": "manual" }, "is_in_otel": true, "example": "example.com", diff --git a/model/attributes/resource/resource__deployment__environment.json b/model/attributes/resource/resource__deployment__environment.json index 6166b751c..cc2f63bb1 100644 --- a/model/attributes/resource/resource__deployment__environment.json +++ b/model/attributes/resource/resource__deployment__environment.json @@ -3,7 +3,7 @@ "brief": "The software deployment environment name.", "type": "string", "apply_scrubbing": { - "key": "manual" + "key": "never" }, "is_in_otel": true, "example": "production", diff --git a/model/attributes/resource/resource__deployment__environment__name.json b/model/attributes/resource/resource__deployment__environment__name.json index d53a36b26..9ef4d038f 100644 --- a/model/attributes/resource/resource__deployment__environment__name.json +++ b/model/attributes/resource/resource__deployment__environment__name.json @@ -3,7 +3,7 @@ "brief": "The software deployment environment name.", "type": "string", "apply_scrubbing": { - "key": "manual" + "key": "never" }, "is_in_otel": true, "example": "production", diff --git a/model/attributes/sentry/sentry__transaction.json b/model/attributes/sentry/sentry__transaction.json index 139b05e09..70e344660 100644 --- a/model/attributes/sentry/sentry__transaction.json +++ b/model/attributes/sentry/sentry__transaction.json @@ -3,7 +3,7 @@ "brief": "The sentry transaction (segment name).", "type": "string", "apply_scrubbing": { - "key": "never" + "key": "manual" }, "is_in_otel": false, "example": "GET /", diff --git a/model/attributes/server_name.json b/model/attributes/server_name.json index 49ca0b7fe..8f9b3cc24 100644 --- a/model/attributes/server_name.json +++ b/model/attributes/server_name.json @@ -3,7 +3,7 @@ "brief": "The name of the device. On servers and desktops, this is typically the hostname.", "type": "string", "apply_scrubbing": { - "key": "auto" + "key": "manual" }, "is_in_otel": false, "example": "example.com", diff --git a/python/src/sentry_conventions/attributes.py b/python/src/sentry_conventions/attributes.py index 40ec90377..14452d697 100644 --- a/python/src/sentry_conventions/attributes.py +++ b/python/src/sentry_conventions/attributes.py @@ -533,7 +533,7 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): """For an AI model call, the function that was called. This is deprecated for OpenAI, and replaced by tool_calls Type: str - Apply Scrubbing: auto + Apply Scrubbing: manual Defined in OTEL: No Visibility: public Aliases: gen_ai.tool.name, mcp.tool.name @@ -648,7 +648,7 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): """For an AI model call, the preamble parameter. Preambles are a part of the prompt used to adjust the model's overall behavior and conversation style. Type: str - Apply Scrubbing: auto + Apply Scrubbing: manual Defined in OTEL: No Visibility: public Aliases: gen_ai.system_instructions @@ -924,7 +924,7 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): """Raw text inputs provided to the model. Type: List[str] - Apply Scrubbing: auto + Apply Scrubbing: manual Defined in OTEL: No Visibility: public Aliases: gen_ai.input.messages, ai.prompt.messages, gen_ai.prompt, ai.prompt @@ -963,7 +963,7 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): """For an AI model call, the tool calls that were made. Type: List[str] - Apply Scrubbing: auto + Apply Scrubbing: manual Defined in OTEL: No Visibility: public DEPRECATED: Use gen_ai.output.messages instead @@ -4205,7 +4205,7 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): """The sentry environment. Type: str - Apply Scrubbing: manual + Apply Scrubbing: never Defined in OTEL: No Visibility: public Aliases: sentry.environment @@ -5435,7 +5435,7 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): """The system instructions passed to the model. Type: str - Apply Scrubbing: auto + Apply Scrubbing: manual Defined in OTEL: No Visibility: public DEPRECATED: Use gen_ai.system_instructions instead @@ -5529,7 +5529,7 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): """The response from a tool or function call passed to the model. Type: str - Apply Scrubbing: auto + Apply Scrubbing: manual Defined in OTEL: No Visibility: public Aliases: gen_ai.tool.call.result, gen_ai.tool.output, mcp.tool.result.content, ai.toolCall.result, anthropic.tool_result.content @@ -7536,7 +7536,7 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): """The content of the tool result. Type: str - Apply Scrubbing: auto - Tool results can contain user data + Apply Scrubbing: manual - Tool results can contain user data Defined in OTEL: No Visibility: public Aliases: gen_ai.tool.call.result, gen_ai.tool.message, gen_ai.tool.output, ai.toolCall.result, anthropic.tool_result.content @@ -8227,7 +8227,7 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): """Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. Type: str - Apply Scrubbing: auto + Apply Scrubbing: manual Defined in OTEL: Yes Visibility: public Aliases: address, server.address, http.server_name, net.host.name, http.host, server_name @@ -9129,7 +9129,7 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): """The software deployment environment name. Type: str - Apply Scrubbing: manual + Apply Scrubbing: never Defined in OTEL: Yes Visibility: public DEPRECATED: Use sentry.environment instead @@ -9143,7 +9143,7 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): """The software deployment environment name. Type: str - Apply Scrubbing: manual + Apply Scrubbing: never Defined in OTEL: Yes Visibility: public DEPRECATED: Use sentry.environment instead @@ -10411,7 +10411,7 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): """The sentry transaction (segment name). Type: str - Apply Scrubbing: never + Apply Scrubbing: manual Defined in OTEL: No Visibility: public Aliases: sentry.segment.name, transaction @@ -10548,7 +10548,7 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): """The name of the device. On servers and desktops, this is typically the hostname. Type: str - Apply Scrubbing: auto + Apply Scrubbing: manual Defined in OTEL: No Visibility: public Aliases: address, server.address, http.server_name, net.host.name, http.host, net.peer.name @@ -12037,7 +12037,7 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): "ai.function_call", "mcp.tool.name", ), - apply_scrubbing=ApplyScrubbingInfo(key=ApplyScrubbing.AUTO), + apply_scrubbing=ApplyScrubbingInfo(key=ApplyScrubbing.MANUAL), is_in_otel=False, visibility=Visibility.PUBLIC, example="function_name", @@ -12229,7 +12229,7 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): "ai.preamble", "gen_ai.system.message", ), - apply_scrubbing=ApplyScrubbingInfo(key=ApplyScrubbing.AUTO), + apply_scrubbing=ApplyScrubbingInfo(key=ApplyScrubbing.MANUAL), is_in_otel=False, visibility=Visibility.PUBLIC, example="You are now a clown.", @@ -12700,7 +12700,7 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): "ai.texts", "gen_ai.prompt", ), - apply_scrubbing=ApplyScrubbingInfo(key=ApplyScrubbing.AUTO), + apply_scrubbing=ApplyScrubbingInfo(key=ApplyScrubbing.MANUAL), is_in_otel=False, visibility=Visibility.PUBLIC, example=["Hello, how are you?", "What is the capital of France?"], @@ -12788,7 +12788,7 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): "ai.responses", "ai.tool_calls", ), - apply_scrubbing=ApplyScrubbingInfo(key=ApplyScrubbing.AUTO), + apply_scrubbing=ApplyScrubbingInfo(key=ApplyScrubbing.MANUAL), is_in_otel=False, visibility=Visibility.PUBLIC, example=["tool_call_1", "tool_call_2"], @@ -17551,7 +17551,7 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): "resource.deployment.environment", "resource.deployment.environment.name", ), - apply_scrubbing=ApplyScrubbingInfo(key=ApplyScrubbing.MANUAL), + apply_scrubbing=ApplyScrubbingInfo(key=ApplyScrubbing.NEVER), is_in_otel=False, visibility=Visibility.PUBLIC, example="production", @@ -19364,7 +19364,7 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): "ai.preamble", "gen_ai.system.message", ), - apply_scrubbing=ApplyScrubbingInfo(key=ApplyScrubbing.AUTO), + apply_scrubbing=ApplyScrubbingInfo(key=ApplyScrubbing.MANUAL), is_in_otel=False, visibility=Visibility.PUBLIC, example="You are a helpful assistant", @@ -19506,7 +19506,7 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): "gen_ai.tool.output", "mcp.tool.result.content", ), - apply_scrubbing=ApplyScrubbingInfo(key=ApplyScrubbing.AUTO), + apply_scrubbing=ApplyScrubbingInfo(key=ApplyScrubbing.MANUAL), is_in_otel=False, visibility=Visibility.PUBLIC, example="rainy, 57°F", @@ -22679,7 +22679,7 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): "mcp.tool.result.content", ), apply_scrubbing=ApplyScrubbingInfo( - key=ApplyScrubbing.AUTO, reason="Tool results can contain user data" + key=ApplyScrubbing.MANUAL, reason="Tool results can contain user data" ), is_in_otel=False, visibility=Visibility.PUBLIC, @@ -23860,7 +23860,7 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): brief="Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name.", type=AttributeType.STRING, keys=("net.peer.name",), - apply_scrubbing=ApplyScrubbingInfo(key=ApplyScrubbing.AUTO), + apply_scrubbing=ApplyScrubbingInfo(key=ApplyScrubbing.MANUAL), is_in_otel=True, visibility=Visibility.PUBLIC, example="example.com", @@ -25259,7 +25259,7 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): "resource.deployment.environment", "resource.deployment.environment.name", ), - apply_scrubbing=ApplyScrubbingInfo(key=ApplyScrubbing.MANUAL), + apply_scrubbing=ApplyScrubbingInfo(key=ApplyScrubbing.NEVER), is_in_otel=True, visibility=Visibility.PUBLIC, example="production", @@ -25279,7 +25279,7 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): "resource.deployment.environment", "resource.deployment.environment.name", ), - apply_scrubbing=ApplyScrubbingInfo(key=ApplyScrubbing.MANUAL), + apply_scrubbing=ApplyScrubbingInfo(key=ApplyScrubbing.NEVER), is_in_otel=True, visibility=Visibility.PUBLIC, example="production", @@ -26978,7 +26978,7 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): "transaction", "sentry.transaction", ), - apply_scrubbing=ApplyScrubbingInfo(key=ApplyScrubbing.NEVER), + apply_scrubbing=ApplyScrubbingInfo(key=ApplyScrubbing.MANUAL), is_in_otel=False, visibility=Visibility.PUBLIC, example="GET /", @@ -27222,7 +27222,7 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): "net.host.name", "server_name", ), - apply_scrubbing=ApplyScrubbingInfo(key=ApplyScrubbing.AUTO), + apply_scrubbing=ApplyScrubbingInfo(key=ApplyScrubbing.MANUAL), is_in_otel=False, visibility=Visibility.PUBLIC, example="example.com", diff --git a/test/attributes.test.ts b/test/attributes.test.ts index 41c6655ae..334d9cacf 100644 --- a/test/attributes.test.ts +++ b/test/attributes.test.ts @@ -239,6 +239,23 @@ describe('attribute json', async () => { expect(missingAliases).toEqual([]); }); + it('has the same apply_scrubbing setting as every attribute in its deprecation chain', async () => { + if (!content.deprecation?.replacement) { + return; + } + + const replacement = content.deprecation.replacement; + const replacementFileName = attributeKeyToFileName(replacement); + const replacementNamespace = replacement.includes('.') ? replacement.split('.')[0] : undefined; + const replacementFilePath = path.join(traceFolders, replacementNamespace ?? '', replacementFileName); + const replacementContent: AttributeJson = JSON.parse(await fs.promises.readFile(replacementFilePath, 'utf-8')); + + expect( + content.apply_scrubbing.key, + `Conflicting apply_scrubbing settings for alias "${content.key}" and replacement "${replacement}"`, + ).toBe(replacementContent.apply_scrubbing.key); + }); + it('its replacement should not be deprecated', async () => { if (!content.deprecation?.replacement) { return; diff --git a/test/mcp-result-attributes.test.ts b/test/mcp-result-attributes.test.ts index b55c5f5d5..67387142a 100644 --- a/test/mcp-result-attributes.test.ts +++ b/test/mcp-result-attributes.test.ts @@ -63,16 +63,4 @@ describe('legacy MCP result attributes', () => { expect(ATTRIBUTE_SEARCH_METADATA[GEN_AI_TOOL_CALL_RESULT]?.deprecationChain).not.toContain(key); } }); - - it('preserves automatic scrubbing for the newly registered string fields', () => { - const results = Object.entries(ATTRIBUTE_METADATA).filter( - ([key]) => key.startsWith('mcp.tool.result.') || key.startsWith('mcp.prompt.result..'), - ); - - for (const [, metadata] of results) { - if (metadata.type === 'string') { - expect(metadata.applyScrubbing.key).toBe('auto'); - } - } - }); });