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
17 changes: 9 additions & 8 deletions src/tracer-installer/src/installer/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,15 +217,18 @@ impl Installer {

print_title("Next Steps");
println!(
"- {} please follow the instructions at {}\n",
"For a better onboarding".bold().yellow(),
"- {} Get started with the interactive guide at {}\n",
"Quick Start".bold().yellow(),
sandbox_url.cyan()
);

println!("- Then initialize Tracer:");
println!("- {} Read the documentation:", "Docs".bold().yellow());
println!(" {}\n", "https://www.tracer.cloud/docs".cyan());

println!("- {} Initialize Tracer:", "Setup".bold().yellow());
println!(" {}\n", "tracer init".cyan());

println!("- [Optional] View Daemon Status:");
println!("- {} Check daemon status:", "Status".bold().yellow());
println!(" {}\n", "tracer info".cyan());

if !nix::unistd::Uid::effective().is_root() {
Expand All @@ -234,11 +237,9 @@ impl Installer {
println!(" {}\n", "sudo chmod u+s ~/.tracerbio/bin/tracer".cyan());
}

println!("- Support:");
println!(
" {} Visit {} or email {}\n",
"Need help?".green(),
"https://github.com/Tracer-Cloud/tracer".cyan(),
"- {} Need help? Email us at {}\n",
"Support".green(),
"support@tracer.cloud".cyan()
);
}
Expand Down
57 changes: 35 additions & 22 deletions src/tracer/src/cli/handlers/info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,32 +141,24 @@ impl InfoDisplay {
formatter.add_field("User", pipeline_user, "magenta");
formatter.add_field("Organization", user_organization, "magenta");
formatter.add_field("Email", user_email, "magenta");
formatter.add_field("Stage", pipeline.stage(), "yellow");

if let Some(otel_status) = &pipeline.opentelemetry_status {
let status_text = if otel_status.enabled {
"Running"
format!(
"Running (PID: {})",
otel_status.pid.map_or("N/A".to_string(), |p| p.to_string())
)
} else {
"Stopped"
"Stopped".to_string()
};
let status_color = if otel_status.enabled {
"active"
} else {
"inactive"
};
formatter.add_status_field("Logging status", status_text, status_color);

if let Some(version) = &otel_status.version {
formatter.add_field("Version", version, "cyan");
}
if let Some(pid) = otel_status.pid {
formatter.add_field("PID", &pid.to_string(), "white");
}
if let Some(endpoint) = &otel_status.endpoint {
formatter.add_field("Endpoint", endpoint, "yellow");
}
formatter.add_status_field("Logging", &status_text, status_color);
} else {
formatter.add_status_field("Logging status", "Unknown", "inactive");
formatter.add_status_field("Logging", "Unknown", "inactive");
}

formatter.add_empty_line();
Expand Down Expand Up @@ -235,6 +227,13 @@ impl InfoDisplay {
formatter.add_field("Run status", "No run found", "red");
formatter.add_empty_line();
}

formatter.add_section_header("Resources");
formatter.add_empty_line();
formatter.add_field("Dashboard", self.get_sandbox_url(&pipeline), "blue");
formatter.add_field("Docs", "https://www.tracer.cloud/docs", "blue");
formatter.add_field("Support", "support@tracer.cloud", "blue");
formatter.add_empty_line();
}

pub fn print_error(&self) {
Expand All @@ -246,26 +245,40 @@ impl InfoDisplay {
formatter.add_header("Tracer CLI");
formatter.add_empty_line();
formatter.add_field("Version", &Version::current().to_string(), "bold");
formatter.add_field(
"Stage",
if is_development_environment() {
"dev"
} else {
"prod"
},
"bold",
);
formatter.add_empty_line();
formatter.add_section_header("Pipeline details");
formatter.add_empty_line();
formatter.add_status_field("Pipeline status", "Not started", "inactive");
formatter.add_empty_line();
formatter.add_section_header("Next steps");
formatter.add_empty_line();
formatter.add_field("Interactive setup", "tracer init", "cyan");
formatter.add_hyperlink("Sandbox", self.get_sandbox_url());
formatter.add_hyperlink(
"Documentation",
"https://github.com/Tracer-Cloud/tracer-client",
);
formatter.add_field("Get started", "tracer login && tracer init", "cyan");
formatter.add_field("Dashboard", self.get_sandbox_url_from_env(), "blue");
formatter.add_field("Docs", "https://www.tracer.cloud/docs", "blue");
formatter.add_field("Support", "support@tracer.cloud", "blue");
formatter.add_empty_line();
formatter.add_footer();
println!("{}", formatter.get_output());
}

pub fn get_sandbox_url(&self) -> &str {
pub fn get_sandbox_url(&self, pipeline: &PipelineMetadata) -> &str {
if pipeline.is_dev {
SANDBOX_URL_DEV
} else {
SANDBOX_URL_PROD
}
}

pub fn get_sandbox_url_from_env(&self) -> &str {
if is_development_environment() {
SANDBOX_URL_DEV
} else {
Expand Down
Loading