Skip to content
Merged
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
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/weaver_infer/allowed-external-types.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
# the public API. Ideally this can have a few exceptions as possible.
allowed_external_types = [
"serde_core::ser::Serialize",
"weaver_semconv::group::GroupSpec",
"weaver_semconv::v2::SemConvSpecV2",
"weaver_live_check::Sample",
]
9 changes: 6 additions & 3 deletions crates/weaver_infer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -245,11 +245,12 @@ impl AccumulatedSamples {
},
attributes,
entity_associations: vec![],
requirement_level: None,
common: inferred_common_fields(),
}
})
.collect::<Vec<_>>();
spans.sort_by(|left, right| left.r#type.to_string().cmp(&right.r#type.to_string()));
spans.sort_by_key(|left| left.r#type.to_string());

let mut metrics = self
.metrics
Expand All @@ -272,11 +273,12 @@ impl AccumulatedSamples {
unit: metric.unit.clone(),
attributes,
entity_associations: vec![],
requirement_level: None,
common: inferred_common_fields(),
}
})
.collect::<Vec<_>>();
metrics.sort_by(|left, right| left.name.to_string().cmp(&right.name.to_string()));
metrics.sort_by_key(|left| left.name.to_string());

let mut merged_events: HashMap<String, Vec<String>> = self
.events
Expand Down Expand Up @@ -311,11 +313,12 @@ impl AccumulatedSamples {
.map(|attribute_name| attribute_or_group_ref(&attribute_name))
.collect(),
entity_associations: vec![],
requirement_level: None,
common: inferred_common_fields(),
}
})
.collect::<Vec<_>>();
events.sort_by(|left, right| left.name.to_string().cmp(&right.name.to_string()));
events.sort_by_key(|left| left.name.to_string());

let mut attributes = attribute_defs.into_values().collect::<Vec<_>>();
attributes.sort_by(|left, right| left.key.cmp(&right.key));
Expand Down
1 change: 1 addition & 0 deletions crates/weaver_resolver/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ weaver_diff = { path = "../weaver_diff" }
weaver_semconv = { path = "../weaver_semconv" }
weaver_resolved_schema = { path = "../weaver_resolved_schema" }

semver.workspace = true
thiserror.workspace = true
rayon.workspace = true
serde.workspace = true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
groups:
file_format: definition/2
attributes:
- key: registry_a.name
type: string
brief: Name from registry A.
stability: stable
examples: ["A"]

attribute_groups:
- id: registry_a.example
type: attribute_group
visibility: public
brief: Example attributes from registry A.
stability: stable
attributes:
- id: registry_a.name
type: string
brief: Name from registry A.
stability: stable
requirement_level: required
examples: "A"
- ref: registry_a.name
requirement_level: required
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: registry_a
description: Test registry A for circular dependency testing.
semconv_version: 0.1.0
schema_base_url: https://example.com/registry_a/schemas/
schema_url: https://example.com/registry_a/schemas/0.1.0
dependencies:
- schema_url: https://example.com/registry_b/schemas/1.0.0
registry_path: data/circular-registry-test/registry_b
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
groups:
file_format: definition/2
attributes:
- key: registry_b.name
type: string
brief: Name from registry B.
stability: stable
examples: ["B"]

attribute_groups:
- id: registry_b.example
type: attribute_group
visibility: public
brief: Example attributes from registry B.
stability: stable
attributes:
- id: registry_b.name
type: string
brief: Name from registry B.
stability: stable
requirement_level: required
examples: "B"
- ref: registry_b.name
requirement_level: required
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: registry_b
description: Test registry B for circular dependency testing.
semconv_version: 0.1.0
schema_base_url: https://example.com/registry_b/schemas/
schema_url: https://example.com/registry_b/schemas/0.1.0
dependencies:
- name: registry_a
# schema_url: is not necessary here, we're using deprecated, but valid for now `name`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: main
description: Main Registry
semconv_version: 0.1.0
schema_base_url: https://example.com/main/
schema_url: https://example.com/main/0.1.0
dependencies:
- schema_url: https://example.com/a/0.1.0
registry_path: data/compatible-version-conflict/registry_a
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
file_format: definition/2
imports:
metrics:
- c.metric.1
spans:
- c.span.2
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: registry_a
description: Registry A
semconv_version: 0.1.0
schema_base_url: https://example.com/a/
schema_url: https://example.com/a/0.1.0
dependencies:
- schema_url: https://example.com/c/1.1.0
registry_path: data/compatible-version-conflict/registry_c_v1_1
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
file_format: definition/2
imports:
metrics:
- c.metric.1
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: registry_b
description: Registry B
semconv_version: 0.1.0
schema_base_url: https://example.com/b/
schema_url: https://example.com/b/0.1.0
dependencies:
- schema_url: https://example.com/c/1.2.0
registry_path: data/compatible-version-conflict/registry_c_v1_2
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
file_format: definition/2
imports:
spans:
- c.span.2
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
name: registry_c
description: Registry C v1.1
semconv_version: 1.1.0
schema_base_url: https://example.com/c/
schema_url: https://example.com/c/1.1.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
file_format: definition/2
attributes:
- key: c.attr1
type: string
brief: Attribute 1 from C v1.1
stability: stable

metrics:
- name: c.metric.1
brief: Metric 1 in C v1.1
unit: "1"
instrument: counter
stability: stable
attributes:
- ref: c.attr1
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
name: registry_c
description: Registry C v1.2
semconv_version: 1.2.0
schema_base_url: https://example.com/c/
schema_url: https://example.com/c/1.2.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
file_format: definition/2
attributes:
- key: c.attr1
type: string
brief: Attribute 1 from C v1.2 (updated)
stability: stable
- key: c.attr2
type: string
brief: Attribute 2 from C v1.2 (new)
stability: stable

metrics:
- name: c.metric.1
brief: Metric 1 in C v1.2 (updated)
unit: "1"
instrument: counter
stability: stable
attributes:
- ref: c.attr1

spans:
- type: c.span.2
kind: client
brief: Span 2 in C v1.2 (new)
stability: stable
name:
note: "c.span.2"
attributes:
- ref: c.attr2
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
schema_url: "http://test/main/1.0.0"
dependencies:
- schema_url: "http://test/dep/1.0.0"
registry_path: "data/dependency-not-found/non-existent"
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: main
description: Main Registry
schema_url: https://example.com/main/0.1.0
dependencies:
- schema_url: https://example.com/a/0.1.0
registry_path: data/diamond-conflict/registry_a
- schema_url: https://example.com/b/0.1.0
registry_path: data/diamond-conflict/registry_b
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
groups:
- id: main_group
type: attribute_group
brief: Main Group
attributes:
- ref: conflict_attr
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
name: registry_a
description: Registry A
schema_url: https://example.com/a/0.1.0
dependencies:
- schema_url: https://example.com/c/1.1.0
registry_path: data/diamond-conflict/registry_c_v1_1
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
file_format: definition/2
imports:
attribute_groups:
- test.group

attribute_groups:
- id: a_group
visibility: public
brief: Group A
stability: stable
attributes:
- ref: conflict_attr
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
name: registry_b
description: Registry B
schema_url: https://example.com/b/0.1.0
dependencies:
- schema_url: https://example.com/c/1.2.0
registry_path: data/diamond-conflict/registry_c_v1_2
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
file_format: definition/2
imports:
attribute_groups:
- test.group

attribute_groups:
- id: b_group
visibility: public
brief: Group B
stability: stable
attributes:
- ref: conflict_attr
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name: registry_c
description: Registry C v1.1
schema_url: https://example.com/c/1.1.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
file_format: definition/2
attributes:
- key: conflict_attr
type: string
brief: Attribute from C v1.1
stability: stable

attribute_groups:
- id: test.group
visibility: public
brief: Test group in C v1.1
stability: stable
attributes:
- ref: conflict_attr
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name: registry_c
description: Registry C v1.2
schema_url: https://example.com/c/1.2.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
file_format: definition/2
attributes:
- key: conflict_attr
type: string
brief: Attribute from C v1.2
stability: stable

attribute_groups:
- id: test.group
visibility: public
brief: Test group in C v1.2
stability: stable
attributes:
- ref: conflict_attr
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: test-diamond-resolved
description: Main registry for diamond test.
schema_url: https://main.com/schemas/0.1.0
dependencies:
- schema_url: http://a/schema/1.0.0
registry_path: data/diamond-resolved-test/registry-a-v1-0
- schema_url: http://b/schema/1.0.0
registry_path: data/diamond-resolved-test/registry-b
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
file_format: definition/1
groups: []
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name: A
description: Registry A version 1.0.0
schema_url: http://a/schema/1.0.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
file_format: manifest/2.0
schema_url: http://b/schema/1.0.0
description: Registry B resolved
stability: development
resolved_schema_uri: schema-next.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
file_format: resolved/2.0
schema_url: http://b/schema/1.0.0
dependencies:
- http://a/schema/1.1.0
registry:
attribute_groups: []
metrics: []
events: []
spans: []
entities: []
attributes: []
attribute_catalog: []
refinements:
spans: []
metrics: []
events: []
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
schema_url: "http://test/dep/1.0.0"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
schema_url: "http://test/dep/2.0.0"
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
schema_url: "http://test/main/1.0.0"
dependencies:
- schema_url: "http://test/dep/1.0.0"
registry_path: "data/duplicate-dependency/dep-v1"
- schema_url: "http://test/dep/2.0.0"
registry_path: "data/duplicate-dependency/dep-v2"
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: main
description: Main Registry
semconv_version: 0.1.0
schema_base_url: https://example.com/main/
schema_url: https://example.com/main/0.1.0
dependencies:
- schema_url: https://example.com/a/0.1.0
registry_path: data/incompatible-version-conflict/registry_a
Expand Down
Loading
Loading