Skip to content

Conversation

@jsuereth
Copy link
Contributor

Optimistically did this using some AI assistance. Still think there's room to clean up some of these statistics, but it still offers some good insights on V2.

Note: I did NOT implement any refinement based stats yet.

Example output:

$ ./target/debug/weaver registry stats --v2
Compute statistics on the registry `https://github.com/open-telemetry/semantic-conventions.git[model]`
ℹ No registry manifest found: /home/joshuasuereth/.weaver/vdir_cache/repo.AOZQW9pJUNkb/model/registry_manifest.yaml
✔ `main` semconv registry `https://github.com/open-telemetry/semantic-conventions.git[model]` loaded (229 files)
✔ `main` semconv registry resolved
Resolved Telemetry Schema Stats:
Registry
- Attributes
  - count: 1043
  - deprecated: 130
  - type breakdown: 
    - string: 618
    - int: 112
    - enum(card:002): 51
    - string[]: 34
    - enum(card:001): 26
    - enum(card:003): 26
    - template[string]: 26
    - boolean: 24
    - enum(card:005): 23
    - enum(card:004): 19
    - double: 14
    - enum(card:006): 9
    - enum(card:009): 9
    - any: 8
    - enum(card:008): 7
    - enum(card:007): 6
    - enum(card:012): 6
    - template[string[]]: 6
    - enum(card:011): 5
    - enum(card:016): 3
    - enum(card:015): 2
    - enum(card:017): 2
    - enum(card:041): 2
    - enum(card:014): 1
    - enum(card:019): 1
    - enum(card:021): 1
    - enum(card:033): 1
    - enum(card:054): 1
  - stability breakdown: 
    - development: 861
    - stable: 174
    - release_candidate: 8
- Attribute Groups
  TODO
- Entities
  - count: 55
  - deprecated: 1
  - stability breakdown: 
    - development: 53
    - stable: 2
  - total with note: 1
   - entity identity length distribution: 
      - 0: 36
      - 1: 14
      - 2: 4
      - 3: 1
- Events
  - count: 19
  - deprecated: 6
  - stability breakdown: 
    - release_candidate: 1
    - development: 17
    - stable: 1
  - total with note: 9
- Metrics
  - count: 486
  - deprecated: 68
  - stability breakdown: 
    - stable: 51
    - development: 435
  - total with note: 299
  - instrument breakdown: 
    - updowncounter: 243
    - counter: 120
    - gauge: 65
    - histogram: 58
  - unit breakdown: 
    - By: 120
    - s: 65
    - {pod}: 44
    - 1: 24
    - {cpu}: 21
    - {connection}: 18
    - {span}: 13
    - {request}: 11
    - {node}: 9
    - {error}: 7
    - {packet}: 7
    - {count}: 6
    - {log_record}: 6
    - {message}: 6
    - {object}: 6
    - {operation}: 6
    - ms: 5
    - {fault}: 5
    - {thread}: 5
    - Cel: 4
    - W: 4
    - {attempt}: 4
    - {hugepage}: 4
    - {persistentvolumeclaim}: 4
    - Hz: 3
    - V: 3
    - {class}: 3
    - {container}: 3
    - {inode}: 3
    - {timeout}: 3
    - J: 2
    - rpm: 2
    - {client}: 2
    - {collection}: 2
    - {data_point}: 2
    - {exception}: 2
    - {file_descriptor}: 2
    - {instance}: 2
    - {job}: 2
    - {procedure}: 2
    - {process}: 2
    - {record}: 2
    - {request_unit}: 2
    - {sign_in}: 2
    - {sign_out}: 2
    - {work_item}: 2
    - %: 1
    - By/s: 1
    - {Hz}: 1
    - {allocation}: 1
    - {assembly}: 1
    - {authrefresh}: 1
    - {buffer}: 1
    - {challenge}: 1
    - {change}: 1
    - {coldstart}: 1
    - {contention}: 1
    - {context_switch}: 1
    - {contributor}: 1
    - {fh}: 1
    - {forbid}: 1
    - {goroutine}: 1
    - {handshake}: 1
    - {invocation}: 1
    - {line}: 1
    - {match_attempt}: 1
    - {method}: 1
    - {namespace}: 1
    - {ref}: 1
    - {repository}: 1
    - {restart}: 1
    - {retransmit}: 1
    - {revision}: 1
    - {row}: 1
    - {run_queue_item}: 1
    - {run}: 1
    - {timer}: 1
    - {token}: 1
- Spans
  - count: 42
  - deprecated: 0
  - stability breakdown: 
    - development: 38
    - stable: 4
  - total with note: 37
  - span kind breakdown: 
    - Internal: 8
    - Server: 11
    - Client: 23
Refinements
  TODO

Total execution time: 2.303995894s

@jsuereth jsuereth requested a review from a team as a code owner November 25, 2025 15:36

impl Refinements {
/// Refinement statistics.
pub fn stats(&self) -> RefinementStats {

Check failure

Code scanning / clippy

this method could have a #[must_use] attribute Error

this method could have a #[must_use] attribute

impl Refinements {
/// Refinement statistics.
pub fn stats(&self) -> RefinementStats {

Check failure

Code scanning / clippy

this method could have a #[must_use] attribute Error

this method could have a #[must_use] attribute
}

/// Returns the statistics for this registry.
pub fn stats(&self) -> RegistryStats {

Check failure

Code scanning / clippy

this method could have a #[must_use] attribute Error

this method could have a #[must_use] attribute
}

/// Returns the statistics for this registry.
pub fn stats(&self) -> RegistryStats {

Check failure

Code scanning / clippy

this method could have a #[must_use] attribute Error

this method could have a #[must_use] attribute
}
*attribute_type_breakdown
.entry(attribute_type)
.or_insert(0 as usize) += 1;

Check failure

Code scanning / clippy

casting integer literal to usize is unnecessary Error

casting integer literal to usize is unnecessary
}
*attribute_type_breakdown
.entry(attribute_type)
.or_insert(0 as usize) += 1;

Check failure

Code scanning / clippy

casting integer literal to usize is unnecessary Error

casting integer literal to usize is unnecessary
fn test_stats() {
let registry = Registry {
attribute_groups: vec![],
registry_url: "https://opentelemetry.io/schemas/1.23.0".to_string(),

Check failure

Code scanning / clippy

to_string() called on a &str Error

to_string() called on a &str
},
}],
attributes: vec![Attribute {
key: "key".to_string(),

Check failure

Code scanning / clippy

to_string() called on a &str Error

to_string() called on a &str
@codecov
Copy link

codecov bot commented Nov 25, 2025

Codecov Report

❌ Patch coverage is 77.52809% with 20 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.3%. Comparing base (1511626) to head (8368f18).
⚠️ Report is 11 commits behind head on main.

Files with missing lines Patch % Lines
crates/weaver_resolved_schema/src/v2/registry.rs 81.1% 16 Missing ⚠️
crates/weaver_resolved_schema/src/v2/mod.rs 0.0% 3 Missing ⚠️
...rates/weaver_resolved_schema/src/v2/refinements.rs 0.0% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            main   #1037     +/-   ##
=======================================
+ Coverage   78.7%   79.3%   +0.6%     
=======================================
  Files         82      83      +1     
  Lines       6612    7122    +510     
=======================================
+ Hits        5204    5654    +450     
- Misses      1408    1468     +60     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant