Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions crates/weaver_emit/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ mod tests {
body: None,
entity_associations: vec![],
annotations: None,
migration: None,
},
ResolvedGroup {
id: "test.updowncounter".to_owned(),
Expand All @@ -261,6 +262,7 @@ mod tests {
display_name: None,
body: None,
annotations: None,
migration: None,
},
ResolvedGroup {
id: "test.counter".to_owned(),
Expand All @@ -283,6 +285,7 @@ mod tests {
display_name: None,
body: None,
annotations: None,
migration: None,
},
ResolvedGroup {
id: "test.gauge".to_owned(),
Expand All @@ -305,6 +308,7 @@ mod tests {
display_name: None,
body: None,
annotations: None,
migration: None,
},
ResolvedGroup {
id: "test.histogram".to_owned(),
Expand All @@ -327,6 +331,7 @@ mod tests {
display_name: None,
body: None,
annotations: None,
migration: None,
},
ResolvedGroup {
id: "test.updowncounter.double".to_owned(),
Expand All @@ -349,6 +354,7 @@ mod tests {
display_name: None,
body: None,
annotations: None,
migration: None,
},
ResolvedGroup {
id: "test.counter.double".to_owned(),
Expand All @@ -371,6 +377,7 @@ mod tests {
display_name: None,
body: None,
annotations: None,
migration: None,
},
ResolvedGroup {
id: "test.gauge.double".to_owned(),
Expand All @@ -393,6 +400,7 @@ mod tests {
display_name: None,
body: None,
annotations: None,
migration: None,
},
ResolvedGroup {
id: "test.histogram.double".to_owned(),
Expand All @@ -415,6 +423,7 @@ mod tests {
display_name: None,
body: None,
annotations: None,
migration: None,
},
],
};
Expand Down
6 changes: 6 additions & 0 deletions crates/weaver_forge/src/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use weaver_resolved_schema::registry::{Group, Registry};
use weaver_semconv::any_value::AnyValueSpec;
use weaver_semconv::deprecated::Deprecated;
use weaver_semconv::group::{GroupType, InstrumentSpec, SpanKindSpec};
use weaver_semconv::migration::MigrationSpec;
use weaver_semconv::stability::Stability;
use weaver_semconv::YamlValue;

Expand Down Expand Up @@ -116,6 +117,9 @@ pub struct ResolvedGroup {
#[serde(default)]
#[serde(skip_serializing_if = "Vec::is_empty")]
pub entity_associations: Vec<String>,
/// Header for the namespace/page.
#[serde(skip_serializing_if = "Option::is_none")]
pub migration: Option<MigrationSpec>,
/// Annotations for the group.
#[serde(default)]
#[serde(skip_serializing_if = "Option::is_none")]
Expand Down Expand Up @@ -172,6 +176,7 @@ impl ResolvedGroup {
lineage,
display_name: group.display_name.clone(),
body: group.body.clone(),
migration: group.migration.clone(),
entity_associations: group.entity_associations.clone(),
annotations: group.annotations.clone(),
})
Expand Down Expand Up @@ -233,6 +238,7 @@ impl ResolvedRegistry {
lineage,
display_name: group.display_name.clone(),
body: group.body.clone(),
migration: group.migration.clone(),
entity_associations: group.entity_associations.clone(),
annotations: group.annotations.clone(),
}
Expand Down
6 changes: 6 additions & 0 deletions crates/weaver_live_check/src/live_checker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,7 @@ mod tests {
display_name: None,
body: None,
annotations: None,
migration: None,
}],
}
}
Expand Down Expand Up @@ -527,6 +528,7 @@ mod tests {
display_name: Some("System Memory Attributes".to_owned()),
body: None,
annotations: None,
migration: None,
},
// System uptime metric
ResolvedGroup {
Expand All @@ -550,6 +552,7 @@ mod tests {
display_name: None,
body: None,
annotations: None,
migration: None,
},
// System memory usage metric
ResolvedGroup {
Expand Down Expand Up @@ -591,6 +594,7 @@ mod tests {
display_name: None,
body: None,
annotations: None,
migration: None,
},
],
}
Expand Down Expand Up @@ -642,6 +646,7 @@ mod tests {
display_name: None,
body: None,
annotations: None,
migration: None,
}],
};

Expand Down Expand Up @@ -895,6 +900,7 @@ mod tests {
display_name: None,
body: None,
annotations: None,
migration: None,
}],
};

Expand Down
18 changes: 17 additions & 1 deletion crates/weaver_resolved_schema/src/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ use crate::catalog::Catalog;
use crate::error::{handle_errors, Error};
use crate::lineage::GroupLineage;
use crate::registry::GroupStats::{
AttributeGroup, Entity, Event, Metric, MetricGroup, Scope, Span, Undefined,
AttributeGroup, Entity, Event, Metric, MetricGroup, Scope, Span, Undefined, NameSpace
};
use serde::{Deserialize, Serialize};
use weaver_semconv::deprecated::Deprecated;
use weaver_semconv::migration::MigrationSpec;
use weaver_semconv::group::{GroupType, InstrumentSpec, SpanKindSpec};
use weaver_semconv::provenance::Provenance;
use weaver_semconv::stability::Stability;
Expand Down Expand Up @@ -127,6 +128,9 @@ pub struct Group {
/// This fields is only used for event groups.
#[serde(skip_serializing_if = "Option::is_none")]
pub body: Option<AnyValueSpec>,
/// Migration details for the namespace.
#[serde(skip_serializing_if = "Option::is_none")]
pub migration: Option<MigrationSpec>,
/// Annotations for the group.
#[serde(default)]
#[serde(skip_serializing_if = "Option::is_none")]
Expand Down Expand Up @@ -155,6 +159,7 @@ impl Group {
GroupType::MetricGroup => None,
GroupType::Entity => self.name.as_deref(),
GroupType::Scope => None,
GroupType::NameSpace => self.name.as_deref(),
GroupType::Undefined => None,
}
}
Expand Down Expand Up @@ -218,6 +223,11 @@ pub enum GroupStats {
/// Common statistics for this type of group.
common_stats: CommonGroupStats,
},
/// Statistics for a namespace.
NameSpace {
/// Common statistics for this type of group.
common_stats: CommonGroupStats,
},
/// Statistics for a span.
Span {
/// Common statistics for this type of group.
Expand Down Expand Up @@ -307,6 +317,9 @@ impl Registry {
GroupType::Scope => Scope {
common_stats: CommonGroupStats::default(),
},
GroupType::NameSpace => NameSpace {
common_stats: CommonGroupStats::default(),
},
GroupType::Span => Span {
common_stats: CommonGroupStats::default(),
span_kind_breakdown: HashMap::new(),
Expand Down Expand Up @@ -359,6 +372,9 @@ impl Registry {
Scope { common_stats } => {
common_stats.update_stats(group);
}
NameSpace { common_stats } => {
common_stats.update_stats(group);
}
Span {
common_stats,
span_kind_breakdown,
Expand Down
1 change: 1 addition & 0 deletions crates/weaver_resolver/src/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,7 @@ fn group_from_spec(group: GroupSpecWithProvenance) -> UnresolvedGroup {
lineage: Some(GroupLineage::new(group.provenance.clone())),
display_name: group.spec.display_name,
body: group.spec.body,
migration: group.spec.migration,
annotations: group.spec.annotations,
entity_associations: group.spec.entity_associations,
},
Expand Down
11 changes: 11 additions & 0 deletions crates/weaver_semconv/data/gen-ai.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
groups:
- id: namespace.gen-ai
type: namespace
name: gen-ai
note: This is a description of the gen ai namespace
brief: This is a summary of the gen ai namespace
migration:
brief: Migration strategy
note: To protect personal information the following document should be followed.
targetVersion: 1.20.0
link: ./migration-guide.md
Loading