Repository navigation
fix(attributes): Remove allow_any_value boolean attribute and allow any as type - #273
Conversation
Semver Impact of This PR🟢 Patch (bug fixes) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨
Bug Fixes 🐛
Documentation 📚
Internal Changes 🔧Deps
Other
🤖 This preview updates automatically when you update the PR. |
27818ec to
386d91f
Compare
Add case for the new `any` attribute type in the test switch statement so it doesn't throw when an attribute with `type: "any"` has an example. Co-Authored-By: Claude Opus 4.6 <[email protected]>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: CLI create-attribute tool missing new
anytype option- Added 'any' type to both the help text and interactive selector options in scripts/create_attribute.ts.
Or push these changes by commenting:
@cursor push ff95815c56
Preview (ff95815c56)
diff --git a/scripts/create_attribute.ts b/scripts/create_attribute.ts
--- a/scripts/create_attribute.ts
+++ b/scripts/create_attribute.ts
@@ -14,7 +14,7 @@
--help, -h Show this help message
--key, -k The attribute key (e.g. http.route)
--description, -d A description of the attribute
- --type, -t The type of the attribute (string/boolean/integer/double/string[]/boolean[]/integer[]/double[])
+ --type, -t The type of the attribute (string/boolean/integer/double/string[]/boolean[]/integer[]/double[]/any)
--has_pii, -p Whether the attribute contains PII (true/maybe/false)
--is_in_otel, -o Whether the attribute is in OpenTelemetry (true/false)
--example, -e An example value (optional)
@@ -221,6 +221,7 @@
{ value: 'integer[]', label: 'Integer Array' },
{ value: 'boolean[]', label: 'Boolean Array' },
{ value: 'double[]', label: 'Double Array' },
+ { value: 'any', label: 'Any' },
],
}),
);| brief: string; | ||
| has_dynamic_suffix?: boolean; | ||
| type: 'string' | 'boolean' | 'integer' | 'double' | 'string[]' | 'boolean[]' | 'integer[]' | 'double[]'; | ||
| type: 'string' | 'boolean' | 'integer' | 'double' | 'string[]' | 'boolean[]' | 'integer[]' | 'double[]' | 'any'; |
There was a problem hiding this comment.
CLI create-attribute tool missing new any type option
Low Severity
Adding 'any' to the type union in scripts/types.ts and across all generators, schemas, and tests creates an inconsistency with scripts/create_attribute.ts, which was not updated. That file's interactive askForAttributeType selector and --type help text still only list the eight original types, so users cannot select any when creating an attribute interactively. Non-interactive mode would pass schema validation, but the interactive flow silently omits the new option.
There was a problem hiding this comment.
That is on purpose, because this is not something we want to easily offer for now until we fully support objects in the ingestion pipeline!
|
Bugbot Autofix prepared a fix for the issue found in the latest run.
Or push these changes by commenting: Preview (f99a4000e5)diff --git a/test/attributes.test.ts b/test/attributes.test.ts
--- a/test/attributes.test.ts
+++ b/test/attributes.test.ts
@@ -58,6 +58,8 @@
expect(Array.isArray(content.example)).toBe(true);
expect((content.example as boolean[]).every((e: boolean) => typeof e === 'boolean')).toBe(true);
break;
+ case 'any':
+ break;
default:
throw new Error('Invalid type');
} |
The Vercel AI integration in sentry-javascript records the `experimental_telemetry.metadata` of an AI SDK call as `vercel.ai.telemetry.metadata.<key>` span attributes. SDK v10 did this through the AI SDK's own OTel spans. A fix in v11 restores it for `ai` 4 to 6 (getsentry/sentry-javascript#24721). The type is `any`. The AI SDK allows strings, numbers, booleans and arrays of these as metadata values, and the SDK sends them unchanged. The schema allows only one type per attribute, so `any` is the only type that covers all of these values. The docs content schema did not accept `any`, though `schemas/attribute.schema.json` allows it, as of #273. No attribute used `any` before. Related: getsentry/sentry-javascript#24721 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>



Since there is no revert label option, reverts #272
The only change is extending
typeattribute to acceptanyas a value which can be set per attribute.