Skip to content

Commit

Permalink
Define SemConv predefined JQ functions (#246)
Browse files Browse the repository at this point in the history
* feat(forge): Support hierarchical weaver config

* feat(forge): Test override_with

* feat(forge): Implement better UX for templates and config.

* chore(forge): Fix a unit test.

* feat(forge): Support multiple paths to init a WeaverConfig with overriding support.

* feat(cli): Reintroduce target concept

* feat(cli): Introduce --config parameter in weaver registry generate

* doc(forge): Document the organization and resolution of config files

* doc(forge): Document the organization and resolution of config files

* feat(forge): Improve WeaverConfig and TemplateEngine public APIs

* feat(forge): Remove FileContent from the public API

* feat(forge): Create constants for Jinja syntax delimiters

* chore(forge): Remove unused filters function_name, struct_name, ...

* chore(build): Merge with main and bump weaver version

* feat(forge): Add predefined semconv JQ functions

* feat(forge): Add more predefined semconv JQ functions

* feat(forge): Use new JQ function in rust codegen example

* feat(forge): Define semconv functions

* feat(forge): Update documentation

* feat(forge): Update documentation

* feat(forge): Introduce concept of JQ package to import JQ functions

* feat(forge): Simplify the Rust example with the new filters.

* feat(forge): Update unit tests

* feat(forge): Enable whitespace control on the Rust example

* feat(forge): Improve documentation intro

* feat(forge): Improve documentation section Template Directory Structure

* feat(forge): Improve documentation section Configuration file

* feat(forge): Change namespace to root_namespace and improve docs

* feat(forge): Fix renaming issue
  • Loading branch information
lquerel authored Jul 22, 2024
1 parent e99c89d commit 5661695
Show file tree
Hide file tree
Showing 131 changed files with 2,698 additions and 14,105 deletions.
32 changes: 32 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,38 @@

All notable changes to this project will be documented in this file.

## [0.7.0] - 2024-07-22

What's Changed

* Add support for new custom semconv JQ filters by @lquerel.
* Update Weaver Forge documentation and include a step-by-step guide for codegen authors by @lquerel.

The following new filters have been added to the Weaver Forge:

* `semconv_group_attributes_by_root_namespace`: Groups the attributes by their root namespace.
* `semconv_attributes($options)`: Extracts and processes semantic convention attributes based on provided options. $options is an object that can contain:
* `exclude_stability`: a list of stability statuses to exclude.
* `exclude_deprecated`: a boolean to exclude deprecated metrics.
* `exclude_root_namespace`: a list of root namespaces to exclude.
* `semconv_attributes`: Convenience function to extract all attributes without any filtering options.
* `semconv_grouped_attributes($options)`: Groups the processed attributes by their root namespace based on provided options. $options is an object that can contain:
* `exclude_stability`: a list of stability statuses to exclude.
* `exclude_deprecated`: a boolean to exclude deprecated metrics.
* `exclude_root_namespace`: a list of root namespaces to exclude.
* `semconv_grouped_attributes`: Convenience function to group all attributes by their root namespace without any filtering options.
* `semconv_group_metrics_by_root_namespace`: Groups the metrics by their root namespace.
* `semconv_metrics($options)`: Extracts and processes semantic convention metrics based on provided options. $options is an object that can contain:
* `exclude_stability`: a list of stability statuses to exclude.
* `exclude_deprecated`: a boolean to exclude deprecated metrics.
* `exclude_root_namespace`: a list of root namespaces to exclude.
* `semconv_metrics`: Convenience function to extract all metrics without any filtering options.
* `semconv_grouped_metrics($options)`: Groups the processed metrics by their root namespace based on provided options. $options is an object that can contain:
* `exclude_stability`: a list of stability statuses to exclude.
* `exclude_deprecated`: a boolean to exclude deprecated metrics.
* `exclude_root_namespace`: a list of root namespaces to exclude.
* `semconv_grouped_metrics`: Convenience function to group all metrics by their root namespace without any filtering options.

## [0.6.0] - 2024-07-16

What's Changed
Expand Down
94 changes: 43 additions & 51 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 Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "weaver"
version = "0.6.0"
version = "0.7.0"
authors = ["OpenTelemetry"]
edition = "2021"
repository = "https://github.com/open-telemetry/weaver"
Expand Down
2 changes: 1 addition & 1 deletion crates/weaver_cache/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "weaver_cache"
version = "0.6.0"
version = "0.7.0"
authors.workspace = true
repository.workspace = true
license.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion crates/weaver_checker/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "weaver_checker"
version = "0.6.0"
version = "0.7.0"
authors.workspace = true
repository.workspace = true
license.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion crates/weaver_codegen_test/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "weaver_codegen_test"
version = "0.6.0"
version = "0.7.0"
authors.workspace = true
repository.workspace = true
license.workspace = true
Expand Down
7 changes: 5 additions & 2 deletions crates/weaver_codegen_test/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use weaver_common::{in_memory, Logger};
use weaver_forge::config::{Params, WeaverConfig};
use weaver_forge::file_loader::FileSystemFileLoader;
use weaver_forge::registry::ResolvedRegistry;
use weaver_forge::{OutputDirective, TemplateEngine};
use weaver_forge::{OutputDirective, TemplateEngine, SEMCONV_JQ};
use weaver_resolver::SchemaResolver;
use weaver_semconv::path::RegistryPath;
use weaver_semconv::registry::SemConvRegistry;
Expand Down Expand Up @@ -53,7 +53,10 @@ fn main() {
.unwrap_or_else(|e| process_error(&logger, e));
let config = WeaverConfig::try_from_path("./templates/registry/rust")
.unwrap_or_else(|e| process_error(&logger, e));
let engine = TemplateEngine::new(config, loader, Params::default());
let mut engine = TemplateEngine::new(config, loader, Params::default());
engine
.import_jq_package(SEMCONV_JQ)
.unwrap_or_else(|e| process_error(&logger, e));
let template_registry = ResolvedRegistry::try_from_resolved_registry(
schema
.registry(REGISTRY_ID)
Expand Down
Loading

0 comments on commit 5661695

Please sign in to comment.