Skip to content

Commit c90e7ce

Browse files
authored
Document semconv version weaver is compatible with and update migration docs (#1402)
1 parent 903e839 commit c90e7ce

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/non-normative/code-generation.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,10 @@ This section contains suggestions on how to structure semantic convention artifa
8686
This section describes how to do code-generation with weaver.
8787

8888
> [!IMPORTANT]
89-
> We're transitioning from [build-tools](https://github.com/open-telemetry/build-tools/blob/main/semantic-conventions/README.md#code-generator)
89+
> We're transitioning away from [build-tools](https://github.com/open-telemetry/build-tools/blob/main/semantic-conventions/README.md#code-generator)
9090
> to [opentelemetry-weaver](https://github.com/open-telemetry/weaver/blob/main/crates/weaver_forge/README.md) to generate code for semantic conventions.
9191
> All new code-generation should be done using weaver, build-tools may become incompatible with future version of semantic conventions.
92+
> Weaver supports Semantic Conventions version starting from [1.26.0](https://github.com/open-telemetry/semantic-conventions/tree/v1.26.0).
9293
9394
Code-generation is based on YAML definitions in the specific version of semantic conventions.
9495
Usually, it involves several steps where some can be semi-automated:
@@ -182,12 +183,11 @@ Notable changes on helper methods:
182183

183184
- `attr.fqn | to_const_name` -> `attr.name | screaming_snake_case`
184185
- `attr.fqn | to_camelcase(True)` -> `attr.name | pascal_case`
185-
- `attr.brief | to_doc_brief | indent` -> `attr.brief | comment_with_prefix(" ")` (prefix is used to indent)
186+
- `attr.brief | to_doc_brief | indent` -> `attr.brief | comment(indent=4)`, check out extensive [comment formatting configuration](https://github.com/open-telemetry/weaver/blob/main/crates/weaver_forge/README.md#comment-filter)
186187
- stability/deprecation checks:
187188
- `attribute is stable` if checking one attribute, `attributes | select("stable")` to filter stable attributes
188189
- `attribute is experimental` if checking one attribute, `attributes | select("experimental")` to filter experimental attributes
189190
- `attribute is deprecated` if checking one attribute, `attributes | select("deprecated")` to filter deprecated attributes
190191
- check if attribute is a template: `attribute.type is template_type`
191-
- `print_member_value` - no replacement at this time, use something like `{%- if type == "string" -%}"{{value}}"{%-else-%}{{value}}{%-endif-%}`
192192
- new way to simplify switch-like logic: `key | map_text("map_name")`. Maps can be defined in the weaver config.
193193
It can be very useful to convert semantic convention attribute types to language-specific types.

0 commit comments

Comments
 (0)