Repository navigation
feat(conventions): Support multiple examples - #505
Conversation
Semver Impact of This PR🟡 Minor (new features) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨Attributes
Other
Internal Changes 🔧
🤖 This preview updates automatically when you update the PR. |
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]>
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]>
2f49fd8 to
f792310
Compare
There was a problem hiding this comment.
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 👀
| if (!Array.isArray(examples) || examples.length === 0) { | ||
| throw new Error('Examples must be provided as a non-empty JSON array'); | ||
| } | ||
| return examples as AttributeValue[]; |
There was a problem hiding this comment.
And then you wouldn't have to cast =P
Good point. Seems like we have three type/schema definitions at the moment:
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! |
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]>
130421e to
9c35305
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ 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) |
There was a problem hiding this comment.
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)
Reviewed by Cursor Bugbot for commit 68f0781. Configure here.
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.


Add support for multiple attribute examples across validation, authoring, generated JavaScript and Python metadata, and documentation while preserving legacy
examplecompatibility. This is helpful when one example alone isn't enough to illustrate the possible values.Also added a few examples to
db.query.summarywhich is such a case IMHO.cc @mydea since we talked about this
Fixes #209