Skip to content

fix(semconv): correct & simplify codegen templates#2059

Merged
kaylareopelle merged 8 commits intoopen-telemetry:mainfrom
robbkidd:robb.simplify-semconv-templates
Mar 18, 2026
Merged

fix(semconv): correct & simplify codegen templates#2059
kaylareopelle merged 8 commits intoopen-telemetry:mainfrom
robbkidd:robb.simplify-semconv-templates

Conversation

@robbkidd
Copy link
Copy Markdown
Member

@robbkidd robbkidd commented Mar 17, 2026

  • Update rendering of deprecation notes for deprecated attributes/metrics

The data under this key is now a dict. .note is informative when present, but isn't always, so fallback to .reason.

  • Remove @example blocks

Yard @example content needs to be indented within the code comment in a tricksy way. Combine that with the variety of shapes the data under .examples is provided and the template becomes complicated and brittle.

WWJD: What Would Java Do? - They don't include .examples in their generated semantic conventions code. So let's not also.

(attribute|metric).deprecated is a dict, so dropping it into Yard doc
content gets weird with Yard treating {} as a reference to other Yard
content elsewhere.

This change uses deprecated.note (if present) or deprecated.reason
(always present, but less info) capitalized with a period.
attribute.examples come in too many shapes to include in generated code
docs without a complicated template to interpret their shape.

WWJD: What Would Java Do?

Java doesn't include examples. Let's not, also.
@robbkidd
Copy link
Copy Markdown
Member Author

Per my usual, walking the commits is intended to make review more straightforward.

@robbkidd
Copy link
Copy Markdown
Member Author

robbkidd commented Mar 17, 2026

Spellcheck failure is on content generated from semconv source models. 😐

@kaylareopelle
Copy link
Copy Markdown
Contributor

Spellcheck failure is on content generate from semconv source models. 😐

It'll be fixed for future versions 🎉 open-telemetry/semantic-conventions#3549

Comment thread semantic_conventions/lib/opentelemetry/semconv/incubating/aws/attributes.rb Outdated
Copy link
Copy Markdown
Contributor

@kaylareopelle kaylareopelle left a comment

Choose a reason for hiding this comment

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

This is great! Thank you! Would you mind adding something to either the README or the Rake task output to let folks know the task isn't bumping the version anymore? We can pull it out if/when we get back to full automation.

Better directions for how to hold this update process.
@robbkidd
Copy link
Copy Markdown
Member Author

robbkidd commented Mar 18, 2026

@kaylareopelle Updated words!

Example output from the rake task:

❯ rake update_spec_version_constant

+++ Updating library SPEC_VERSION constant to 1.37.0.
    ℹ️  VERSION is managed by release automation and left unchanged.
sed -i.bak "s/SPEC_VERSION = '.*'/SPEC_VERSION = '1.37.0'/g" lib/opentelemetry/semantic_conventions/version.rb
rm lib/opentelemetry/semantic_conventions/version.rb.bak

🔍 👀

Update: There are two spaces between ℹ️ and VERSION. I put two in because output on my terminal seemed to swallow one space, but they both appear here even though I copied that content from my terminal. How do fonts even? I'm happy to remove that second space or leave it.

@kaylareopelle
Copy link
Copy Markdown
Contributor

@kaylareopelle Updated words!

Example output from the rake task:

❯ rake update_spec_version_constant

+++ Updating library SPEC_VERSION constant to 1.37.0.
    ℹ️  VERSION is managed by release automation and left unchanged.
sed -i.bak "s/SPEC_VERSION = '.*'/SPEC_VERSION = '1.37.0'/g" lib/opentelemetry/semantic_conventions/version.rb
rm lib/opentelemetry/semantic_conventions/version.rb.bak

🔍 👀

Update: There are two spaces between ℹ️ and VERSION. I put two in because output on my terminal seemed to swallow one space, but they both appear here even though I copied that content from my terminal. How do fonts even? I'm happy to remove that second space or leave it.

Thanks for the update! I think it looks great as-is. We can go back and fix it if it bugs us.

@kaylareopelle kaylareopelle merged commit 8a4baa3 into open-telemetry:main Mar 18, 2026
64 checks passed
@otelbot-ruby otelbot-ruby Bot mentioned this pull request Mar 24, 2026
@otelbot-ruby otelbot-ruby Bot mentioned this pull request Apr 7, 2026
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