Skip to content

fix(attributes): Remove allow_any_value boolean attribute and allow any as type - #273

Merged
vgrozdanic merged 2 commits into
mainfrom
vg/allow-any-as-a-type
Mar 4, 2026
Merged

vgrozdanic merged 2 commits into
mainfrom
vg/allow-any-as-a-type

Conversation

@vgrozdanic

@vgrozdanic vgrozdanic commented Mar 4, 2026 •

Copy link
Copy Markdown
Member

Since there is no revert label option, reverts #272

The only change is extending type attribute to accept any as a value which can be set per attribute.

@github-actions

github-actions Bot commented Mar 4, 2026 •

Copy link
Copy Markdown

Semver Impact of This PR

🟢 Patch (bug fixes)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

  • (attributes) Add allow_any_value field to attribute schema by vgrozdanic in #272
  • (http) Add http.server.request.time_in_queue attribute by dingsdax in #267
  • (resource) Add resource.deployment.environment by mjq in #266

Bug Fixes 🐛

  • (attributes) Remove allow_any_value boolean attribute and allow any as type by vgrozdanic in #273
  • (gen_ai) Input and output token description by obostjancic in #261

Documentation 📚

  • Update README with up-to-date links by ericapisani in #258

Internal Changes 🔧

Deps

  • Bump svelte from 5.51.5 to 5.53.5 by dependabot in #271
  • Bump rollup from 4.40.1 to 4.59.0 by dependabot in #269
  • Bump svelte from 5.48.1 to 5.51.5 by dependabot in #260

Other

  • (ai) Deprecate rest of ai.* attributes by constantinius in #264
  • (deps-dev) Bump tar from 7.5.7 to 7.5.8 by dependabot in #259
  • (gen_ai) Deprecate gen_ai.tool.input, gen_ai.tool.message, gen_ai.tool.output by constantinius in #265

🤖 This preview updates automatically when you update the PR.

@vgrozdanic
vgrozdanic force-pushed the vg/allow-any-as-a-type branch from 27818ec to 386d91f Compare March 4, 2026 13:17
@vgrozdanic
vgrozdanic marked this pull request as ready for review March 4, 2026 13:19
@vgrozdanic
vgrozdanic requested review from a team, Lms24, cleptric, lcian, mjq and nsdeschenes as code owners March 4, 2026 13:19
Comment thread scripts/types.ts Resolved
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]>

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 any type option
    • Added 'any' type to both the help text and interactive selector options in scripts/create_attribute.ts.

Create PR

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' },
       ],
     }),
   );
This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.

Comment thread scripts/types.ts
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';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Fix in Cursor Fix in Web

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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!

@cursor

cursor Bot commented Mar 4, 2026

Copy link
Copy Markdown

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: Test throws on new any type with example
    • Added case 'any' to the switch statement in the attribute example test to allow attributes with type 'any' without throwing an error.

Create PR

Or push these changes by commenting:

@cursor push f99a4000e5
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');
         }
This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.

@vgrozdanic
vgrozdanic merged commit 1054bc3 into main Mar 4, 2026
12 checks passed
@vgrozdanic
vgrozdanic deleted the vg/allow-any-as-a-type branch March 4, 2026 13:43
isaacs added a commit that referenced this pull request Oct 5, 2026
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants