Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP - fix(stats): Skip group calculations if we don't have instances #696

Closed
wants to merge 1 commit into from

Conversation

xiu
Copy link

@xiu xiu commented Apr 10, 2025

When playing around with #627, I noticed a panic when running stats against the custom registry:

✔ `acme` semconv registry `tests/custom_registry` loaded (177 files)
Semantic Convention Registry Stats:
  - Total number of files: 177
✔ `acme` semconv registry resolved
Resolved Telemetry Schema Stats:
Registry
  - 2 groups
    - 0 Metrics
      - Total number of attributes: 0
        - [(attributes card: frequency), ...]: []

thread 'main' panicked at src/registry/stats.rs:198:13:
attempt to divide by zero
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test

cargo run registry stats -r tests/custom_registry.

Expected behavior

No panic

Test: `cargo run registry stats -r tests/custom_registry`.
Expected behavior: No panic
@xiu
Copy link
Author

xiu commented Apr 10, 2025

Following https://github.com/open-telemetry/weaver/blob/17d6609d44ffac28c290380ecbca276928d8657e/CONTRIBUTING.md, I'm having an issue running just:

cargo machete
Analyzing dependencies of crates in this directory...
cargo-machete found the following unused dependencies in this directory:
weaver_resolved_schema -- ./crates/weaver_resolved_schema/Cargo.toml:
        serde_yaml

If you believe cargo-machete has detected an unused dependency incorrectly,
you can add the dependency to the list of dependencies to ignore in the
`[package.metadata.cargo-machete]` section of the appropriate Cargo.toml.
For example:

[package.metadata.cargo-machete]
ignored = ["prost"]

You can also try running it with the `--with-metadata` flag for better accuracy,
though this may modify your Cargo.lock files.

Done!
error: Recipe `pre-push-check` failed on line 17 with exit code 1

Not sure whether that is intended.

@lquerel
Copy link
Contributor

lquerel commented Apr 10, 2025

Fixed in #697

@xiu
Copy link
Author

xiu commented Apr 10, 2025

Thanks!

@xiu xiu closed this Apr 10, 2025
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.

2 participants