You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current process of adding a new Semantic Convention Field is as follow.
Let's assume that you want to add the field display_name to the semantic convention groups. It's an optional field
containing a string that represents the display name of the group.
Update the weaver_semconv crate to define the new field in src/group.rs. The
data types defined in weaver_semconv are used to parse the registry YAML files. The following are some guidelines:
Optional field should be defined as Option<T>. So display_name should be defined as Option<String>.
N-ary fields should be defined as Vec<T>.
Other data types are also supported, such as bool, u64, f64, enum, HashMap, etc. The only constraint is
that the type should implement the serde::Deserialize and serde::Serialize traits.
Update all the unit tests to cover the new field. The easiest way to do this is to run the following command:
cargo test --package weaver_semconv
This command will run all the unit tests in the weaver_semconv crate.
The tests that fail will be the ones that need to be updated and usually the error message will guide you on what
needs to be updated (most of the time it's the addition of the new field in some struct or enum initialization).
Update the weaver_resolved_schema crate to add the corresponding new field in the "resolved" view of the registry.
This crate define the data types used to represent the resolved view of the registry.
The current process of adding a new Semantic Convention Field is as follow.
Let's assume that you want to add the field
display_name
to the semantic convention groups. It's an optional fieldcontaining a string that represents the display name of the group.
weaver_semconv
crate to define the new field in src/group.rs. Thedata types defined in
weaver_semconv
are used to parse the registry YAML files. The following are some guidelines:Option<T>
. Sodisplay_name
should be defined asOption<String>
.Vec<T>
.bool
,u64
,f64
,enum
,HashMap
, etc. The only constraint isthat the type should implement the
serde::Deserialize
andserde::Serialize
traits.cargo test --package weaver_semconv
weaver_semconv
crate.needs to be updated (most of the time it's the addition of the new field in some struct or enum initialization).
weaver_resolved_schema
crate to add the corresponding new field in the "resolved" view of the registry.This crate define the data types used to represent the resolved view of the registry.
weaver_resolver
crate to define the mapping between the "non-resolved" and "resolved" views of theregistry.
cargo test --package weaver_resolver
.weaver_forge
crate to generate the new field in data structures used by the template engine.cargo test --package weaver_forge
.weaver registry generate
command to generate and test thenew templates.
Steps 4 and 6 could be merged as step 6 doesn't really bring any new value in this context.
The text was updated successfully, but these errors were encountered: