Skip to content

Commit

Permalink
Expose target container targetting
Browse files Browse the repository at this point in the history
When I implemented this in #906 I was working in a stack and completely lost
track of exposing this new work in the CLI: there was no way to flip this
feature on. Fixed in this PR.

Signed-off-by: Brian L. Troutwine <[email protected]>
  • Loading branch information
blt committed Jul 12, 2024
1 parent eca9cdd commit 1908acf
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

## [0.22.0-rc1]
### Fixed
- Target observer was not exposed through CLI.

## [0.22.0-rc0]
### Added
- Target observer now allows a docker target, identified by name.
Expand Down
2 changes: 1 addition & 1 deletion 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 lading/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "lading"
version = "0.22.0-rc0"
version = "0.22.0-rc1"
authors = [
"Brian L. Troutwine <[email protected]>",
"George Hahn <[email protected]>",
Expand Down
9 changes: 8 additions & 1 deletion lading/src/bin/lading.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ impl FromStr for CliKeyValues {
#[clap(group(
ArgGroup::new("target")
.required(true)
.args(&["target-path", "target-pid", "no-target"]),
.args(&["target-path", "target-pid", "target-container", "no-target"]),
))]
#[clap(group(
ArgGroup::new("telemetry")
Expand All @@ -153,6 +153,9 @@ struct Opts {
/// measure an externally-launched process by PID
#[clap(long)]
target_pid: Option<NonZeroU32>,
/// measure an externally-launched container by name
#[clap(long)]
target_container: Option<String>,
/// disable target measurement
#[clap(long)]
no_target: bool,
Expand Down Expand Up @@ -264,6 +267,10 @@ fn get_config(ops: &Opts, config: Option<String>) -> Result<Config, Error> {
None
} else if let Some(pid) = ops.target_pid {
Some(target::Config::Pid(target::PidConfig { pid }))
} else if let Some(name) = &ops.target_container {
Some(target::Config::Docker(target::DockerConfig {
name: name.clone(),
}))
} else if let Some(path) = &ops.target_path {
Some(target::Config::Binary(target::BinaryConfig {
command: path.clone(),
Expand Down

0 comments on commit 1908acf

Please sign in to comment.