Skip to content

feat(conventions): Support multiple examples - #505

Merged
Lms24 merged 6 commits into
mainfrom
feat/multiple-attribute-examples
Jul 17, 2026
Merged

Lms24 merged 6 commits into
mainfrom
feat/multiple-attribute-examples

Conversation

@Lms24

@Lms24 Lms24 commented Jul 15, 2026 •

Copy link
Copy Markdown
Member

Add support for multiple attribute examples across validation, authoring, generated JavaScript and Python metadata, and documentation while preserving legacy example compatibility. This is helpful when one example alone isn't enough to illustrate the possible values.

Also added a few examples to db.query.summary which is such a case IMHO.

cc @mydea since we talked about this

Fixes #209

@github-actions

github-actions Bot commented Jul 15, 2026 •

Copy link
Copy Markdown

Semver Impact of This PR

🟡 Minor (new features)

📋 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

  • Deprecate rpc.grpc.status_code in favor of rpc.response.status_code by lucas-zimerman in #494
  • Add deprecated messaging.destination_kind by andreiborza in #509
  • Add sentry.segment.name.source attribute by Lms24 in #466
  • Add attribute transformations by constantinius in #465
  • Add stable app vitals attributes by buenaflor in #493
  • Deprecate sentry.frames.* attributes by buenaflor in #500
  • Add missing AI legacy aliases from Relay SpanData by vgrozdanic in #498

Other

  • (conventions) Support multiple examples by Lms24 in #505

Internal Changes 🔧

  • (attribute) Improve db.statement example and add deprecation reason by Lms24 in #501
  • (attributes) Deprecate sentry.span.source and change backfill status of sentry.source by Lms24 in #510
  • (attrs) Backport attributes and normalizations from Relay by Dav1dde in #497
  • (codeowners) Assign telemetry-experience to gen_ai/ai attributes by vgrozdanic in #506
  • (release) Show version in workflow run title by constantinius in #504

🤖 This preview updates automatically when you update the PR.

Lms24 added a commit that referenced this pull request Jul 15, 2026
Associate the multiple examples update with its pull request in source and generated metadata.

Refs #505
Co-Authored-By: Claude <[email protected]>

Co-authored-by: Cursor <[email protected]>
@Lms24
Lms24 marked this pull request as ready for review July 15, 2026 08:17
@Lms24
Lms24 requested review from a team, cleptric, mjq and nsdeschenes as code owners July 15, 2026 08:17
@Lms24 Lms24 self-assigned this Jul 15, 2026
Lms24 added a commit that referenced this pull request Jul 15, 2026
Show the official OpenTelemetry variants for server routes and URL templates to demonstrate multiple supported placeholder syntaxes.

Refs #505
Co-Authored-By: Claude <[email protected]>

Co-authored-by: Cursor <[email protected]>
@Lms24 Lms24 changed the title feat(attributes): Support multiple examples feat(conventions): Support multiple examples Jul 15, 2026
Lms24 added a commit that referenced this pull request Jul 15, 2026
Use clearer static and dynamic route examples in the source definitions and generated metadata.

Refs #505
Co-Authored-By: Claude <[email protected]>

Co-authored-by: Cursor <[email protected]>
Lms24 added a commit that referenced this pull request Jul 17, 2026
Associate the multiple examples update with its pull request in source and generated metadata.

Refs #505
Co-Authored-By: Claude <[email protected]>

Co-authored-by: Cursor <[email protected]>
Lms24 added a commit that referenced this pull request Jul 17, 2026
Show the official OpenTelemetry variants for server routes and URL templates to demonstrate multiple supported placeholder syntaxes.

Refs #505
Co-Authored-By: Claude <[email protected]>

Co-authored-by: Cursor <[email protected]>
Lms24 added a commit that referenced this pull request Jul 17, 2026
Use clearer static and dynamic route examples in the source definitions and generated metadata.

Refs #505
Co-Authored-By: Claude <[email protected]>

Co-authored-by: Cursor <[email protected]>
@Lms24
Lms24 force-pushed the feat/multiple-attribute-examples branch from 2f49fd8 to f792310 Compare July 17, 2026 10:08
Comment thread scripts/types.ts

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Wonder if it would be worth it to copy over the some of schemas from the content config and use them here then you can infer the types for example AttributeValue 👀

Comment thread scripts/types.ts Outdated
if (!Array.isArray(examples) || examples.length === 0) {
throw new Error('Examples must be provided as a non-empty JSON array');
}
return examples as AttributeValue[];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

And then you wouldn't have to cast =P

@Lms24

Lms24 commented Jul 17, 2026

Copy link
Copy Markdown
Member Author

Wonder if it would be worth it to copy over the some of schemas from the content config and use them here then you can infer the types for example AttributeValue

Good point. Seems like we have three type/schema definitions at the moment:

  • schemas with JSON schema
  • docs/src/content.config.ts
  • scripts/types.ts

Would be nice if we could unify these or at least keep them better in sync. Definitely opens up room for divergence at the moment. I'm gonna think a bit about this a bit and tackle as a follow-up. Thanks for calling this out!

Lms24 and others added 5 commits July 17, 2026 15:34
Add unambiguous plural examples across validation, authoring, generated
metadata, and documentation while preserving the legacy singular field.

Fixes #209
Co-Authored-By: Claude <[email protected]>

Co-authored-by: Cursor <[email protected]>
Associate the multiple examples update with its pull request in source and generated metadata.

Refs #505
Co-Authored-By: Claude <[email protected]>

Co-authored-by: Cursor <[email protected]>
Show the official OpenTelemetry variants for server routes and URL templates to demonstrate multiple supported placeholder syntaxes.

Refs #505
Co-Authored-By: Claude <[email protected]>

Co-authored-by: Cursor <[email protected]>
Use clearer static and dynamic route examples in the source definitions and generated metadata.

Refs #505
Co-Authored-By: Claude <[email protected]>

Co-authored-by: Cursor <[email protected]>
@Lms24
Lms24 force-pushed the feat/multiple-attribute-examples branch from 130421e to 9c35305 Compare July 17, 2026 13:34
Comment thread test/attributes.test.ts Resolved
@Lms24
Lms24 enabled auto-merge (squash) July 17, 2026 13:55
@Lms24
Lms24 merged commit 238c35e into main Jul 17, 2026
16 of 17 checks passed
@Lms24
Lms24 deleted the feat/multiple-attribute-examples branch July 17, 2026 13:57

@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.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 68f0781. Configure here.

--visibility, -v The visibility of the attribute (public/internal)
--example, -e An example value (optional)
--examples Example values as a non-empty JSON array (optional, preferred)
--example, -e A single example value (optional, legacy)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Optional examples conflict with schema

Low Severity

The schema now requires example or examples whenever has_dynamic_suffix is true, but create:attribute help text and the interactive prompt still describe examples as optional. Creating a dynamic-suffix attribute without examples fails later in Ajv validation instead of at input time, which is easy to hit for keys containing .<key>.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 68f0781. Configure here.

Lms24 added a commit to getsentry/sentry-docs that referenced this pull request Jul 17, 2026
This PR clarifies the release process for `sentry-conventions`. I tried
following the original version and encountered multiple discrepancies.
Besides a general wording treatment over the page, the main changes are:

- link to relay setup and how to init the git submodule
- snuba dependency bump PRs can no longer be self-approved and merged.
Code owner approval is required.
- attempt to clarify when Sentry backend code needs updating. **I am
still not sure if the found cases are all correct, or if they're
unnecessary, or if any are missing.** I tried to gather as much as I
could find from the various slack threads but I'd really appreciate some
clarity here.
- added sentry frontend which was missing previously 

I'm aware we have some changes in flight that will hopefully get rid of
(some of the) sentry backend changes, at which point this hopefully gets
much easier 🤞. Depending on what gets merged first, we can also adjust
this PR.

Other changes:
- "Adding a new attribute" section: Uses the new plural `--examples`
option which will be introduced by
getsentry/sentry-conventions#505. Side-note: We
should shorten conventions contributing guides in favour of this page to
avoid drifts.
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.

Provide multiple examples for attributes

2 participants