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

Test the weaver_semconv crate against the official semantic convention registry #20

Closed
lquerel opened this issue Feb 13, 2024 · 1 comment

Comments

@lquerel
Copy link
Contributor

lquerel commented Feb 13, 2024

The weaver_semconv crate describes the data model used to represent a semantic convention registry. To validate that the model aligns with the official version of the OpenTelemetry semantic convention, we can create an integration test that ensures parsing all the files in the registry produces no errors.

Several things are necessary to implement this integration test:

  • Ensure that each Rust structure used to represent an object from the registry is annotated with #[serde(deny_unknown_fields)]. This ensures that there are no fields in the official registry (yaml file) that are not described in the corresponding Rust structures. This should already be the case, but it would be useful to verify.
  • Create a tests directory at the root of the weaver project to add an integration test for validating the parsing of all files from the official registry. See Rust Integration Test doc.
  • Use the weaver_cache crate in combination with the weaver_semconv crate to 1) locally retrieve the registry files (see unit test in weaver_cache/src/lib.rs) and 2) parse these files with the load_from_file method of the SemConvSpecs structure.

Note: I think that for now, it's better to postpone testing the registry resolution process until this process is finalized in weaver_resolver (see registry.rs).

@lquerel
Copy link
Contributor Author

lquerel commented Feb 15, 2024

Implemented in #25

@lquerel lquerel closed this as completed Feb 15, 2024
@github-project-automation github-project-automation bot moved this from Todo to Done in OTel Weaver Project Feb 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

1 participant