diff --git a/crates/weaver_forge/src/registry.rs b/crates/weaver_forge/src/registry.rs index 9d307af4..07cc629d 100644 --- a/crates/weaver_forge/src/registry.rs +++ b/crates/weaver_forge/src/registry.rs @@ -98,10 +98,12 @@ pub struct ResolvedGroup { /// The name of the event. If not specified, the prefix is used. /// If prefix is empty (or unspecified), name is required. pub name: Option, - /// The lineage of the group. #[serde(skip_serializing_if = "Option::is_none")] pub lineage: Option, + /// The readable name for attribute groups used when generating registry tables. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_name: Option, } impl ResolvedGroup { @@ -153,6 +155,7 @@ impl ResolvedGroup { unit: group.unit.clone(), name: group.name.clone(), lineage, + display_name: group.display_name.clone(), }) } } @@ -211,6 +214,7 @@ impl ResolvedRegistry { unit: group.unit.clone(), name: group.name.clone(), lineage, + display_name: group.display_name.clone(), } }) .collect(); diff --git a/crates/weaver_resolved_schema/src/registry.rs b/crates/weaver_resolved_schema/src/registry.rs index 23c2fa7d..c41fc405 100644 --- a/crates/weaver_resolved_schema/src/registry.rs +++ b/crates/weaver_resolved_schema/src/registry.rs @@ -120,10 +120,12 @@ pub struct Group { /// If prefix is empty (or unspecified), name is required. #[serde(skip_serializing_if = "Option::is_none")] pub name: Option, - /// The lineage of the group. #[serde(skip_serializing_if = "Option::is_none")] pub lineage: Option, + /// The readable name for attribute groups used when generating registry tables. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_name: Option, } /// Common statistics for a group. diff --git a/crates/weaver_resolver/src/registry.rs b/crates/weaver_resolver/src/registry.rs index 262d089c..3df9bf2f 100644 --- a/crates/weaver_resolver/src/registry.rs +++ b/crates/weaver_resolver/src/registry.rs @@ -264,6 +264,7 @@ fn group_from_spec(group: GroupSpecWithProvenance) -> UnresolvedGroup { unit: group.spec.unit, name: group.spec.name, lineage: Some(GroupLineage::new(&group.provenance)), + display_name: group.spec.display_name, }, attributes: attrs, provenance: group.provenance, diff --git a/crates/weaver_semconv/data/faas-common.yaml b/crates/weaver_semconv/data/faas-common.yaml index ca424b17..43de8f25 100644 --- a/crates/weaver_semconv/data/faas-common.yaml +++ b/crates/weaver_semconv/data/faas-common.yaml @@ -2,6 +2,7 @@ groups: - id: attributes.faas.common type: attribute_group brief: "Describes FaaS attributes." + display_name: "FaaS Attributes" prefix: faas attributes: - id: trigger diff --git a/crates/weaver_semconv/src/group.rs b/crates/weaver_semconv/src/group.rs index f6df958e..e2e5e2c7 100644 --- a/crates/weaver_semconv/src/group.rs +++ b/crates/weaver_semconv/src/group.rs @@ -84,6 +84,8 @@ pub struct GroupSpec { /// The name of the event. If not specified, the prefix is used. /// If prefix is empty (or unspecified), name is required. pub name: Option, + /// The readable name for attribute groups used when generating registry tables. + pub display_name: Option, } impl GroupSpec { @@ -331,6 +333,7 @@ mod tests { instrument: None, unit: None, name: None, + display_name: None, }; assert!(group.validate("").is_ok()); @@ -430,6 +433,7 @@ mod tests { instrument: None, unit: None, name: None, + display_name: None, }; assert!(group.validate("").is_ok()); diff --git a/crates/weaver_semconv/src/registry.rs b/crates/weaver_semconv/src/registry.rs index ca06eb53..651aa4ae 100644 --- a/crates/weaver_semconv/src/registry.rs +++ b/crates/weaver_semconv/src/registry.rs @@ -260,6 +260,7 @@ mod tests { deprecated: None, events: vec![], name: None, + display_name: Some("Group 1".to_owned()), }], }, ), @@ -283,6 +284,7 @@ mod tests { deprecated: None, events: vec![], name: None, + display_name: Some("Group 2".to_owned()), }], }, ),