Skip to content

Commit 85b2bb1

Browse files
committed
Update implementation for simplicity
1 parent e2d6037 commit 85b2bb1

File tree

13 files changed

+87
-202
lines changed

13 files changed

+87
-202
lines changed

crates/weaver_emit/src/lib.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@ mod tests {
239239
body: None,
240240
entity_associations: vec![],
241241
annotations: None,
242+
migration: None,
242243
},
243244
ResolvedGroup {
244245
id: "test.updowncounter".to_owned(),
@@ -261,6 +262,7 @@ mod tests {
261262
display_name: None,
262263
body: None,
263264
annotations: None,
265+
migration: None,
264266
},
265267
ResolvedGroup {
266268
id: "test.counter".to_owned(),
@@ -283,6 +285,7 @@ mod tests {
283285
display_name: None,
284286
body: None,
285287
annotations: None,
288+
migration: None,
286289
},
287290
ResolvedGroup {
288291
id: "test.gauge".to_owned(),
@@ -305,6 +308,7 @@ mod tests {
305308
display_name: None,
306309
body: None,
307310
annotations: None,
311+
migration: None,
308312
},
309313
ResolvedGroup {
310314
id: "test.histogram".to_owned(),
@@ -327,6 +331,7 @@ mod tests {
327331
display_name: None,
328332
body: None,
329333
annotations: None,
334+
migration: None,
330335
},
331336
ResolvedGroup {
332337
id: "test.updowncounter.double".to_owned(),
@@ -349,6 +354,7 @@ mod tests {
349354
display_name: None,
350355
body: None,
351356
annotations: None,
357+
migration: None,
352358
},
353359
ResolvedGroup {
354360
id: "test.counter.double".to_owned(),
@@ -371,6 +377,7 @@ mod tests {
371377
display_name: None,
372378
body: None,
373379
annotations: None,
380+
migration: None,
374381
},
375382
ResolvedGroup {
376383
id: "test.gauge.double".to_owned(),
@@ -393,6 +400,7 @@ mod tests {
393400
display_name: None,
394401
body: None,
395402
annotations: None,
403+
migration: None,
396404
},
397405
ResolvedGroup {
398406
id: "test.histogram.double".to_owned(),
@@ -415,6 +423,7 @@ mod tests {
415423
display_name: None,
416424
body: None,
417425
annotations: None,
426+
migration: None,
418427
},
419428
],
420429
};

crates/weaver_forge/src/registry.rs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@ use weaver_resolved_schema::lineage::GroupLineage;
1414
use weaver_resolved_schema::registry::{Group, Registry};
1515
use weaver_semconv::any_value::AnyValueSpec;
1616
use weaver_semconv::deprecated::Deprecated;
17-
use weaver_semconv::footer::FooterSpec;
1817
use weaver_semconv::group::{GroupType, InstrumentSpec, SpanKindSpec};
19-
use weaver_semconv::header::HeaderSpec;
18+
use weaver_semconv::migration::MigrationSpec;
2019
use weaver_semconv::stability::Stability;
2120
use weaver_semconv::YamlValue;
2221

@@ -120,10 +119,7 @@ pub struct ResolvedGroup {
120119
pub entity_associations: Vec<String>,
121120
/// Header for the namespace/page.
122121
#[serde(skip_serializing_if = "Option::is_none")]
123-
pub header: Option<HeaderSpec>,
124-
/// Footer for the namespace/page.
125-
#[serde(skip_serializing_if = "Option::is_none")]
126-
pub footer: Option<FooterSpec>,
122+
pub migration: Option<MigrationSpec>,
127123
/// Annotations for the group.
128124
#[serde(default)]
129125
#[serde(skip_serializing_if = "Option::is_none")]
@@ -180,8 +176,7 @@ impl ResolvedGroup {
180176
lineage,
181177
display_name: group.display_name.clone(),
182178
body: group.body.clone(),
183-
footer: group.footer.clone(),
184-
header: group.header.clone(),
179+
migration: group.migration.clone(),
185180
entity_associations: group.entity_associations.clone(),
186181
annotations: group.annotations.clone(),
187182
})
@@ -243,8 +238,7 @@ impl ResolvedRegistry {
243238
lineage,
244239
display_name: group.display_name.clone(),
245240
body: group.body.clone(),
246-
footer: group.footer.clone(),
247-
header: group.header.clone(),
241+
migration: group.migration.clone(),
248242
entity_associations: group.entity_associations.clone(),
249243
annotations: group.annotations.clone(),
250244
}

crates/weaver_live_check/src/live_checker.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,7 @@ mod tests {
455455
display_name: None,
456456
body: None,
457457
annotations: None,
458+
migration: None,
458459
}],
459460
}
460461
}
@@ -527,6 +528,7 @@ mod tests {
527528
display_name: Some("System Memory Attributes".to_owned()),
528529
body: None,
529530
annotations: None,
531+
migration: None,
530532
},
531533
// System uptime metric
532534
ResolvedGroup {
@@ -550,6 +552,7 @@ mod tests {
550552
display_name: None,
551553
body: None,
552554
annotations: None,
555+
migration: None,
553556
},
554557
// System memory usage metric
555558
ResolvedGroup {
@@ -591,6 +594,7 @@ mod tests {
591594
display_name: None,
592595
body: None,
593596
annotations: None,
597+
migration: None,
594598
},
595599
],
596600
}
@@ -642,6 +646,7 @@ mod tests {
642646
display_name: None,
643647
body: None,
644648
annotations: None,
649+
migration: None,
645650
}],
646651
};
647652

@@ -895,6 +900,7 @@ mod tests {
895900
display_name: None,
896901
body: None,
897902
annotations: None,
903+
migration: None,
898904
}],
899905
};
900906

crates/weaver_resolved_schema/src/registry.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ use crate::registry::GroupStats::{
1717
};
1818
use serde::{Deserialize, Serialize};
1919
use weaver_semconv::deprecated::Deprecated;
20-
use weaver_semconv::footer::FooterSpec;
21-
use weaver_semconv::header::HeaderSpec;
20+
use weaver_semconv::migration::MigrationSpec;
2221
use weaver_semconv::group::{GroupType, InstrumentSpec, SpanKindSpec};
2322
use weaver_semconv::provenance::Provenance;
2423
use weaver_semconv::stability::Stability;
@@ -129,12 +128,9 @@ pub struct Group {
129128
/// This fields is only used for event groups.
130129
#[serde(skip_serializing_if = "Option::is_none")]
131130
pub body: Option<AnyValueSpec>,
132-
/// Header for the namespace/page.
131+
/// Migration details for the namespace.
133132
#[serde(skip_serializing_if = "Option::is_none")]
134-
pub header: Option<HeaderSpec>,
135-
/// Footer for the namespace/page.
136-
#[serde(skip_serializing_if = "Option::is_none")]
137-
pub footer: Option<FooterSpec>,
133+
pub migration: Option<MigrationSpec>,
138134
/// Annotations for the group.
139135
#[serde(default)]
140136
#[serde(skip_serializing_if = "Option::is_none")]

crates/weaver_resolver/src/registry.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -397,8 +397,7 @@ fn group_from_spec(group: GroupSpecWithProvenance) -> UnresolvedGroup {
397397
lineage: Some(GroupLineage::new(group.provenance.clone())),
398398
display_name: group.spec.display_name,
399399
body: group.spec.body,
400-
header: group.spec.header,
401-
footer: group.spec.footer,
400+
migration: group.spec.migration,
402401
annotations: group.spec.annotations,
403402
entity_associations: group.spec.entity_associations,
404403
},

crates/weaver_semconv/data/gen-ai.yaml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ groups:
44
name: gen-ai
55
note: This is a description of the gen ai namespace
66
brief: This is a summary of the gen ai namespace
7-
header:
8-
title: Migration strategy
9-
content: To protect personl information the following document should be followed.
10-
style: warning
11-
footer:
12-
content: Footer
7+
migration:
8+
brief: Migration strategy
9+
note: To protect personal information the following document should be followed.
10+
targetVersion: 1.20.0
11+
link: ./migration-guide.md

crates/weaver_semconv/src/footer.rs

Lines changed: 0 additions & 38 deletions
This file was deleted.

crates/weaver_semconv/src/group.rs

Lines changed: 12 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@ use std::fmt::{Display, Formatter};
1313
use crate::any_value::AnyValueSpec;
1414
use crate::attribute::{AttributeSpec, AttributeType, PrimitiveOrArrayTypeSpec};
1515
use crate::deprecated::Deprecated;
16-
use crate::footer::FooterSpec;
1716
use crate::group::InstrumentSpec::{Counter, Gauge, Histogram, UpDownCounter};
18-
use crate::header::HeaderSpec;
17+
use crate::migration::MigrationSpec;
1918
use crate::provenance::Provenance;
2019
use crate::semconv::Imports;
2120
use crate::stability::Stability;
@@ -111,12 +110,9 @@ pub struct GroupSpec {
111110
/// Note: only valid if type is event
112111
#[serde(skip_serializing_if = "Option::is_none")]
113112
pub body: Option<AnyValueSpec>,
114-
/// Header for the namespace/page.
113+
/// Migration details for the namespace/.
115114
#[serde(skip_serializing_if = "Option::is_none")]
116-
pub header: Option<HeaderSpec>,
117-
/// Footer for the namespace/page.
118-
#[serde(skip_serializing_if = "Option::is_none")]
119-
pub footer: Option<FooterSpec>,
115+
pub migration: Option<MigrationSpec>,
120116
/// Annotations for the group.
121117
#[serde(default)]
122118
#[serde(skip_serializing_if = "Option::is_none")]
@@ -709,8 +705,7 @@ mod tests {
709705
name: None,
710706
display_name: None,
711707
body: None,
712-
header: None,
713-
footer: None,
708+
migration: None,
714709
annotations: None,
715710
entity_associations: Vec::new(),
716711
};
@@ -876,8 +871,7 @@ mod tests {
876871
name: None,
877872
display_name: None,
878873
body: None,
879-
header: None,
880-
footer: None,
874+
migration: None,
881875
annotations: None,
882876
entity_associations: Vec::new(),
883877
};
@@ -1175,8 +1169,7 @@ mod tests {
11751169
),
11761170
},
11771171
}),
1178-
header: None,
1179-
footer: None,
1172+
migration: None,
11801173
annotations: None,
11811174
entity_associations: Vec::new(),
11821175
};
@@ -1392,8 +1385,7 @@ mod tests {
13921385
),
13931386
},
13941387
}),
1395-
header: None,
1396-
footer: None,
1388+
migration: None,
13971389
annotations: None,
13981390
entity_associations: Vec::new(),
13991391
};
@@ -1538,8 +1530,7 @@ mod tests {
15381530
name: None,
15391531
display_name: None,
15401532
body: None,
1541-
header: None,
1542-
footer: None,
1533+
migration: None,
15431534
annotations: None,
15441535
entity_associations: Vec::new(),
15451536
};
@@ -1710,8 +1701,7 @@ mod tests {
17101701
name: None,
17111702
display_name: None,
17121703
body: None,
1713-
header: None,
1714-
footer: None,
1704+
migration: None,
17151705
annotations: None,
17161706
entity_associations: Vec::new(),
17171707
};
@@ -1864,8 +1854,7 @@ mod tests {
18641854
name: None,
18651855
display_name: None,
18661856
body: None,
1867-
header: None,
1868-
footer: None,
1857+
migration: None,
18691858
annotations: None,
18701859
entity_associations: Vec::new(),
18711860
};
@@ -1926,8 +1915,7 @@ mod tests {
19261915
name: None,
19271916
display_name: None,
19281917
body: None,
1929-
header: None,
1930-
footer: None,
1918+
migration: None,
19311919
annotations: None,
19321920
entity_associations: vec!["test".to_owned()],
19331921
};
@@ -1987,8 +1975,7 @@ mod tests {
19871975
display_name: None,
19881976
attributes: vec![],
19891977
body: None,
1990-
header: None,
1991-
footer: None,
1978+
migration: None,
19921979
annotations: None,
19931980
entity_associations: Vec::new(),
19941981
};

0 commit comments

Comments
 (0)