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

is_experimental returns true by default #570

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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 CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ All notable changes to this project will be documented in this file.

What's changed

* For issue [#569](Add include_stability config into semconv_grouped_attributes): `is_experimental` returns `true` by default. ([#570](https://github.com/open-telemetry/weaver/pull/570) by @jerbly).
* Added an OTLP receiver to Weaver to prepare for the `weaver registry live-check` command. (see [#548](https://github.com/open-telemetry/weaver/pull/548) by @lquerel)
* Refactored CLI registry commands to remove some duplication. Resolving the registry with policy checks is common for `generate`, `resolve` and `check`. ([#536](https://github.com/open-telemetry/weaver/pull/536) by @jerbly).
* Added missing `after_resolution` policy checks to `generate` and `resolve` through the common code.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ groups:
value: 'nice'
- id: idle
value: 'idle'
stability: stable
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note. For our internal codegen test to pass I now had to explicitly set this to stable!

- id: iowait
value: 'iowait'
stability: experimental
Expand Down
7 changes: 4 additions & 3 deletions crates/weaver_forge/src/extensions/otel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,8 @@ pub(crate) fn is_stable(input: &Value) -> bool {
}

/// Checks if the input value is an object with a field named "stability" that has any value
/// other than "stable". Otherwise, it returns false.
/// other than "stable". Otherwise, it returns true. This implies that undefined stability
/// is considered experimental for safety.
#[must_use]
pub(crate) fn is_experimental(input: &Value) -> bool {
let result = input.get_attr("stability");
Expand All @@ -288,7 +289,7 @@ pub(crate) fn is_experimental(input: &Value) -> bool {
return stability != "stable";
}
}
false
true
}

/// Checks if the input value is an object with a field named "stability" that has the value "deprecated".
Expand Down Expand Up @@ -753,7 +754,7 @@ mod tests {
id: "test".to_owned(),
r#type: "test".to_owned(),
});
assert!(!is_experimental(&object));
assert!(is_experimental(&object));
}

#[test]
Expand Down
Loading