Skip to content

feat(names): Add function span name and description rules - #618

Merged
Lms24 merged 2 commits into
mainfrom
lms/feat-function-desc-names
Sep 3, 2026
Merged

feat(names): Add function span name and description rules#618
Lms24 merged 2 commits into
mainfrom
lms/feat-function-desc-names

Conversation

@Lms24

@Lms24 Lms24 commented Sep 3, 2026

Copy link
Copy Markdown
Member

Description

Adds name and description templates for function spans, used to group code function invocations. I propose for both, name and description, we rely on the {code.function.name} attribute which is what our SDKs set today mostly. Should be low card. enough.

ref getsentry/sentry-javascript#23954

PR Checklist

  • I have run yarn test and verified that the tests pass.
  • I have run yarn generate to generate and format code and docs.

If an attribute was added:

  • The attribute is in a namespace (e.g. nextjs.function_id, not function_id)
  • I have used the correct value for apply_scrubbing (i.e. manual or auto. Use never only for values that should never be scrubbed such as IDs)

If an attribute was deprecated:

@github-actions

github-actions Bot commented Sep 3, 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

  • Add sveltekit.* attributes emitted by SvelteKit's native spans by Lms24 in #611
  • Add browser.navigation.type, move navigation.* to router.navigation.* by logaretm in #600
  • Add langchain.chain.name (deprecated) in favor of gen_ai.pipeline.name by RulaKhaled in #599
  • Add browser.paint.type by Lms24 in #606

Names

  • Add function span name and description rules by Lms24 in #618
  • Add browser.* span name and description rules by Lms24 in #607
  • Add cache span name rules by Lms24 in #605

Other

  • (descriptions) Add graphql span description rules by Lms24 in #616

Bug Fixes 🐛

  • (descriptions) Add graphql-enhanced http.client span description template by Lms24 in #613

Internal Changes 🔧

Deps

  • Bump browserslist from 4.28.2 to 4.28.8 by dependabot in #614
  • Bump fast-uri from 3.1.5 to 3.1.7 by dependabot in #612

Other

  • (descriptions) Fix http.client span description example by Lms24 in #603
  • (names) Add OTel divergence note for graphql span names by Lms24 in #615

🤖 This preview updates automatically when you update the PR.

@Lms24

Lms24 commented Sep 3, 2026

Copy link
Copy Markdown
Member Author

bugbot review

1 similar comment
@Lms24

Lms24 commented Sep 3, 2026

Copy link
Copy Markdown
Member Author

bugbot review

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 6c5cd17. Configure here.

@Lms24 Lms24 self-assigned this Sep 3, 2026
@Lms24
Lms24 marked this pull request as ready for review September 3, 2026 14:02
@Lms24
Lms24 requested review from a team, cleptric, mjq and nsdeschenes as code owners September 3, 2026 14:02
{
"name": "Function execution",
"brief": "The execution of a function or a set of instructions that isn't covered by a more specific operation.",
"ops": ["function"],

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: The system lacks validation to ensure that ops referenced in name/description files (e.g., function.json) actually exist, creating a risk of future inconsistencies if ops are modified.
Severity: LOW

Suggested Fix

Enhance the test suite (test/name.test.ts and test/description.test.ts) to validate that all strings listed in the ops array of name and description files correspond to an existing operation defined in one of the model/op/*.json category files. This will enforce referential integrity and prevent future breakages.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: model/description/function.json#L7

Potential issue: The schemas for name and description files, `name.schema.json` and
`description.schema.json`, define the `ops` field as an array of strings without any
validation that these strings correspond to actual operations defined in `model/op/`.
While the `function` op referenced in the new files does exist in
`model/op/general.json`, the system lacks a test to enforce this referential integrity.
This creates a potential for future inconsistencies, where an op could be renamed or
removed from the `model/op/` files, but the corresponding name/description files would
not be flagged as invalid by the test suite, leading to broken behavior for those
operations.

Also affects:

  • model/name/function.json:8

Did we get this right? 👍 / 👎 to inform future reviews.

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.

good point. will address in a follow-up!

@Lms24
Lms24 enabled auto-merge (squash) September 3, 2026 14:22
{
"name": "Function execution",
"brief": "The execution of a function or a set of instructions that isn't covered by a more specific operation.",
"ops": ["function"],

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: The new generic "function" naming rules will unintentionally apply to more specific sub-ops like "function.gcp" and "function.nextjs" due to prefix matching.
Severity: LOW

Suggested Fix

To prevent unintended inheritance, consider adding specific (even if empty) naming and description rules for each of the function.* sub-ops. Alternatively, if this fallback behavior is desired, document this interaction in the PR description to confirm it is intentional.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: model/description/function.json#L7

Potential issue: The new generic naming and description rules for the `"function"`
operation will be inherited by more specific sub-operations like `"function.gcp"`,
`"function.aws"`, and `"function.nextjs"`. This is due to a prefix-matching mechanism
where specific ops inherit rules from their parent if no specific rules exist for them.
The pull request does not acknowledge this inheritance, suggesting it may be an
unintended side effect. This could lead to these more specific function spans receiving
generic names instead of potentially more appropriate, specific ones.

Also affects:

  • model/name/function.json:8

@Lms24
Lms24 merged commit 712dc4d into main Sep 3, 2026
14 of 17 checks passed
@Lms24
Lms24 deleted the lms/feat-function-desc-names branch September 3, 2026 14:23
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