Skip to content
Merged
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 @@ -13,6 +13,7 @@ All notable changes to this project will be documented in this file.
rego policies in weaver. ([#1038](https://github.com/open-telemetry/weaver/pull/1038) by @jsuereth)
- Add Log support for emit and live-check ([#1042](https://github.com/open-telemetry/weaver/pull/1042) by @jerbly)
- Add OTLP log emission for policy findings in live-check. Whenever a PolicyFinding is created, a log_record is emitted to your configured OTLP endpoint. ([#1045](https://github.com/open-telemetry/weaver/pull/1045) by @jerbly)
- Deprecate `weaver registry search` command. This command is not compatible with V2 schema and will be removed in a future version. Users should search the generated documentation instead. ([#1057](https://github.com/open-telemetry/weaver/pull/1057) by @jerbly)

# [0.19.0] - 2025-11-04

Expand Down
2 changes: 2 additions & 0 deletions docs/docker-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ This has four key components:

Weaver comes with an interactive component which can be leveraged with docker. Simply run the container with an interactive terminal attached:

> **DEPRECATED**: The `registry search` command is deprecated and will be removed in a future version. It is not compatible with V2 schema.

```sh
docker run -it \
otel/weaver:latest \
Expand Down
4 changes: 2 additions & 2 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,9 @@ Options:

### registry search

```text
Searches a registry (Note: Experimental and subject to change)
> **DEPRECATED**: This command is deprecated and will be removed in a future version. It is not compatible with V2 schema. Please search the generated documentation instead.

```text
Usage: weaver registry search [OPTIONS] [SEARCH_STRING]

Arguments:
Expand Down
3 changes: 2 additions & 1 deletion src/registry/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ pub enum RegistrySubCommand {
/// The process exits with a code of 0 if the resolution is successful.
#[clap(verbatim_doc_comment)]
Resolve(RegistryResolveArgs),
/// Searches a registry (Note: Experimental and subject to change).
/// DEPRECATED - Searches a registry. This command is deprecated and will be removed in a future version.
/// It is not compatible with V2 schema. Please search the generated documentation instead.
Search(RegistrySearchArgs),
/// Calculate a set of general statistics on a semantic convention registry.
Stats(RegistryStatsArgs),
Expand Down
46 changes: 34 additions & 12 deletions src/registry/search.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ pub struct RegistrySearchArgs {
enum Error {
#[error("{0}")]
StdIoError(String),
#[error("The search command is deprecated and not compatible with V2 schema. Please search the generated documentation instead.")]
V2SchemaIncompatible,
}

impl From<std::io::Error> for Error {
Expand Down Expand Up @@ -85,7 +87,7 @@ impl<'a> SearchApp<'a> {
Block::default()
.borders(Borders::TOP)
.border_style(Style::default().fg(Color::Gray))
.title("Search (press `Esc` or `Ctrl-Q` to stop running) ")
.title("Search [DEPRECATED] (press `Esc` or `Ctrl-Q` to stop running) ")
.title_style(Style::default().fg(Color::Green)),
);
SearchApp {
Expand All @@ -100,19 +102,29 @@ impl<'a> SearchApp<'a> {
let title_block = Block::default()
.borders(Borders::TOP)
.style(Style::default().bg(Color::Black))
.border_style(Style::default().fg(Color::Gray))
.border_style(Style::default().fg(Color::Yellow))
.title_alignment(ratatui::layout::Alignment::Center)
.title_style(Style::default().fg(Color::Green))
.title("Weaver Search");
.title_style(
Style::default()
.fg(Color::Yellow)
.add_modifier(Modifier::BOLD),
)
.title("Weaver Search [DEPRECATED]");
let group_count: usize = self.schema.registry.stats().group_count;
let title_contents = Line::from(vec![Span::styled(
format!(
"Loaded {0:?} groups w/ {1} attributes",
group_count,
self.schema.catalog.count_attributes()
),
Style::default().fg(Color::Gray),
)]);
let title_contents = vec![
Line::from(vec![Span::styled(
"⚠ DEPRECATED: This command will be removed. Search generated documentation instead.",
Style::default().fg(Color::Yellow).add_modifier(Modifier::BOLD),
)]),
Line::from(vec![Span::styled(
format!(
"Loaded {0:?} groups w/ {1} attributes",
group_count,
self.schema.catalog.count_attributes()
),
Style::default().fg(Color::Gray),
)]),
];
Paragraph::new(title_contents).block(title_block)
}

Expand Down Expand Up @@ -364,6 +376,11 @@ fn run_command_line_search(schema: &ResolvedTelemetrySchema, pattern: &str) {
pub(crate) fn command(args: &RegistrySearchArgs) -> Result<ExitDirectives, DiagnosticMessages> {
info!("Resolving registry `{}`", args.registry.registry);

// Check for V2 schema incompatibility
if args.registry.v2 {
return Err(DiagnosticMessages::from_error(Error::V2SchemaIncompatible));
}

let mut diag_msgs = DiagnosticMessages::empty();
let policy_config = PolicyArgs {
policies: vec![],
Expand All @@ -374,6 +391,11 @@ pub(crate) fn command(args: &RegistrySearchArgs) -> Result<ExitDirectives, Diagn
// Load the semantic convention registry into a local cache.
let resolved = weaver.load_and_resolve_main(&mut diag_msgs)?;

// Display deprecation warning
log::warn!("The 'weaver registry search' command is deprecated and will be removed in a future version.");
log::warn!("It is not compatible with V2 schema.");
log::warn!("Please search the generated documentation instead.");

// We should have two modes:
// 1. a single input we take in and directly output some rendered result.
// 2. An interactive UI
Expand Down