Skip to content

Commit 36361cd

Browse files
committed
chore: Merge branch 'main' into chore/add-crd-versioning
2 parents a248c47 + 0f9b6f9 commit 36361cd

File tree

9 files changed

+300
-100
lines changed

9 files changed

+300
-100
lines changed

Cargo.lock

Lines changed: 7 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/stackable-operator/CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,28 @@ All notable changes to this project will be documented in this file.
44

55
## [Unreleased]
66

7+
## [0.91.1] - 2025-04-09
8+
9+
### Added
10+
11+
- Add re-exports for `stackable-telemetry` and `stackable-versioned` ([#1007]).
12+
- Add new features: `default`, `full`, `telemetry`, and `versioned` ([#1007]).
13+
14+
[#1007]: https://github.com/stackabletech/operator-rs/pull/1007
15+
16+
## [0.91.0] - 2025-04-08
17+
18+
### Changed
19+
20+
- BREAKING: Remove `cli::TelemetryArguments` and `cli::RollingPeriod` which are both replaced by
21+
types from `stackable_telemetry` ([#1001]).
22+
- BREAKING: The `ProductOperatorRun` struct now uses `stackable_telemetry::tracing::TelemetryOptions`
23+
for the `telemetry_arguments` field ([#1001]).
24+
25+
[#1001]: https://github.com/stackabletech/operator-rs/pull/1001
26+
27+
## [0.90.0] - 2025-04-07
28+
729
### Added
830

931
- BREAKING: Inject vector aggregator address into vector config file using an environment variable ([#1000]).

crates/stackable-operator/Cargo.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
11
[package]
22
name = "stackable-operator"
33
description = "Stackable Operator Framework"
4-
version = "0.89.1"
4+
version = "0.91.1"
55
authors.workspace = true
66
license.workspace = true
77
edition.workspace = true
88
repository.workspace = true
99

1010
[features]
11+
full = ["time", "telemetry", "versioned"]
12+
default = ["telemetry", "versioned"]
1113
time = ["dep:time"]
14+
telemetry = []
15+
versioned = []
1216

1317
[dependencies]
18+
stackable-telemetry = { path = "../stackable-telemetry", features = ["clap"] }
1419
stackable-versioned = { path = "../stackable-versioned", features = ["k8s"] }
1520
stackable-operator-derive = { path = "../stackable-operator-derive" }
1621
stackable-shared = { path = "../stackable-shared" }

crates/stackable-operator/src/cli.rs

Lines changed: 5 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,13 @@
108108
//!
109109
use std::{
110110
ffi::OsStr,
111-
ops::Deref,
112111
path::{Path, PathBuf},
113112
};
114113

115114
use clap::Args;
116115
use product_config::ProductConfigManager;
117116
use snafu::{ResultExt, Snafu};
117+
use stackable_telemetry::tracing::TelemetryOptions;
118118

119119
use crate::{namespace::WatchNamespace, utils::cluster_info::KubernetesClusterInfoOpts};
120120

@@ -165,10 +165,8 @@ pub enum Command<Run: Args = ProductOperatorRun> {
165165
/// ```rust
166166
/// # use stackable_operator::cli::{Command, ProductOperatorRun, ProductConfigPath};
167167
/// use clap::Parser;
168-
/// use stackable_operator::{
169-
/// cli::TelemetryArguments,
170-
/// namespace::WatchNamespace,
171-
/// };
168+
/// use stackable_operator::namespace::WatchNamespace;
169+
/// use stackable_telemetry::tracing::TelemetryOptions;
172170
///
173171
/// #[derive(clap::Parser, Debug, PartialEq, Eq)]
174172
/// struct Run {
@@ -184,7 +182,7 @@ pub enum Command<Run: Args = ProductOperatorRun> {
184182
/// common: ProductOperatorRun {
185183
/// product_config: ProductConfigPath::from("bar".as_ref()),
186184
/// watch_namespace: WatchNamespace::One("foobar".to_string()),
187-
/// telemetry_arguments: TelemetryArguments::default(),
185+
/// telemetry_arguments: TelemetryOptions::default(),
188186
/// cluster_info_opts: Default::default(),
189187
/// },
190188
/// }));
@@ -219,7 +217,7 @@ pub struct ProductOperatorRun {
219217
pub watch_namespace: WatchNamespace,
220218

221219
#[command(flatten)]
222-
pub telemetry_arguments: TelemetryArguments,
220+
pub telemetry_arguments: TelemetryOptions,
223221

224222
#[command(flatten)]
225223
pub cluster_info_opts: KubernetesClusterInfoOpts,
@@ -280,50 +278,6 @@ impl ProductConfigPath {
280278
}
281279
}
282280

283-
#[derive(Debug, Default, PartialEq, Eq, Args)]
284-
pub struct TelemetryArguments {
285-
/// Disable console output.
286-
#[arg(long, env)]
287-
pub no_console_output: bool,
288-
289-
/// Enable logging to rolling files located in the specified DIRECTORY.
290-
#[arg(long, env, value_name = "DIRECTORY", group = "rolling_logs_group")]
291-
pub rolling_logs: Option<PathBuf>,
292-
293-
/// Time PERIOD after which log files are rolled over.
294-
#[arg(long, env, value_name = "PERIOD", requires = "rolling_logs_group")]
295-
pub rolling_logs_period: Option<RollingPeriod>,
296-
297-
/// Enable exporting traces via OTLP.
298-
#[arg(long, env)]
299-
pub otlp_traces: bool,
300-
301-
/// Enable exporting logs via OTLP.
302-
#[arg(long, env)]
303-
pub otlp_logs: bool,
304-
}
305-
306-
#[derive(Clone, Debug, PartialEq, Eq, strum::Display, strum::EnumString, clap::ValueEnum)]
307-
pub enum RollingPeriod {
308-
Minutely,
309-
Hourly,
310-
Daily,
311-
Never,
312-
}
313-
314-
impl Deref for RollingPeriod {
315-
type Target = tracing_appender::rolling::Rotation;
316-
317-
fn deref(&self) -> &Self::Target {
318-
match self {
319-
RollingPeriod::Minutely => &tracing_appender::rolling::Rotation::MINUTELY,
320-
RollingPeriod::Hourly => &tracing_appender::rolling::Rotation::HOURLY,
321-
RollingPeriod::Daily => &tracing_appender::rolling::Rotation::DAILY,
322-
RollingPeriod::Never => &tracing_appender::rolling::Rotation::NEVER,
323-
}
324-
}
325-
}
326-
327281
#[cfg(test)]
328282
mod tests {
329283
use std::{env, fs::File};

crates/stackable-operator/src/lib.rs

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
//! ## Crate Features
2+
//!
3+
//! - `default` enables a default set of features which most operators need.
4+
//! - `full` enables all available features.
5+
//! - `time` enables interoperability between [`time::Duration`] and the `time` crate.
6+
//! - `telemetry` enables various helpers for emitting telemetry data.
7+
//! - `versioned` enables the macro for CRD versioning.
8+
19
pub mod builder;
210
pub mod cli;
311
pub mod client;
@@ -22,14 +30,16 @@ pub mod time;
2230
pub mod utils;
2331
pub mod validation;
2432

33+
// External re-exports
34+
pub use k8s_openapi;
35+
pub use kube;
36+
pub use schemars;
2537
// Internal re-exports
38+
// TODO (@Techassi): Ideally we would want webhook and certs exported here as
39+
// well, but that would require some restructuring of crates.
40+
pub use stackable_shared as shared;
2641
pub use stackable_shared::{crd::CustomResourceExt, yaml::YamlSchema};
27-
28-
pub mod shared {
29-
pub use stackable_shared::*;
30-
}
31-
32-
// External re-exports
33-
pub use ::k8s_openapi;
34-
pub use ::kube;
35-
pub use ::schemars;
42+
#[cfg(feature = "telemetry")]
43+
pub use stackable_telemetry as telemetry;
44+
#[cfg(feature = "versioned")]
45+
pub use stackable_versioned as versioned;

crates/stackable-telemetry/CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,21 @@ All notable changes to this project will be documented in this file.
44

55
## [Unreleased]
66

7+
## [0.5.0] - 2025-04-08
8+
9+
### Added
10+
11+
- Add new `Tracing::pre_configured` method ([#1001]).
12+
- Add `TelemetryOptions` struct and `RollingPeriod` enum
13+
- Add `clap` feature to enable `TelemetryOptions` being used as CLI arguments
14+
15+
### Changed
16+
17+
- BREAKING: Change `FileLogSettingsBuilder::with_rotation_period` to take `impl Into<Rotation>`
18+
instead of `Rotation` ([#1001]).
19+
20+
[#1001]: https://github.com/stackabletech/operator-rs/pull/1001
21+
722
## [0.4.0] - 2025-04-02
823

924
### Added

crates/stackable-telemetry/Cargo.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
[package]
22
name = "stackable-telemetry"
3-
version = "0.4.0"
3+
version = "0.5.0"
44
authors.workspace = true
55
license.workspace = true
66
edition.workspace = true
77
repository.workspace = true
88

9+
[features]
10+
clap = ["dep:clap"]
11+
912
[dependencies]
1013
axum.workspace = true
14+
clap = { workspace = true, optional = true }
1115
futures-util.workspace = true
1216
opentelemetry = { workspace = true, features = ["logs"] }
1317
opentelemetry-appender-tracing.workspace = true
@@ -16,6 +20,7 @@ opentelemetry-otlp = { workspace = true, features = ["grpc-tonic", "gzip-tonic",
1620
opentelemetry_sdk = { workspace = true, features = ["logs", "rt-tokio", "spec_unstable_logs_enabled"] }
1721
pin-project.workspace = true
1822
snafu.workspace = true
23+
strum.workspace = true
1924
tokio.workspace = true
2025
tower.workspace = true
2126
tracing.workspace = true

0 commit comments

Comments
 (0)