Skip to content

Commit 8c8324d

Browse files
chore: update tracer info links (#629)
* chore: update tracer info links Signed-off-by: vaibhav upreti <vaibhav.upreti16@gmail.com> * fix: colours Signed-off-by: vaibhav upreti <vaibhav.upreti16@gmail.com> --------- Signed-off-by: vaibhav upreti <vaibhav.upreti16@gmail.com>
1 parent f6b0031 commit 8c8324d

2 files changed

Lines changed: 44 additions & 30 deletions

File tree

src/tracer-installer/src/installer/install.rs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -217,15 +217,18 @@ impl Installer {
217217

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

225-
println!("- Then initialize Tracer:");
225+
println!("- {} Read the documentation:", "Docs".bold().yellow());
226+
println!(" {}\n", "https://www.tracer.cloud/docs".cyan());
227+
228+
println!("- {} Initialize Tracer:", "Setup".bold().yellow());
226229
println!(" {}\n", "tracer init".cyan());
227230

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

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

237-
println!("- Support:");
238240
println!(
239-
" {} Visit {} or email {}\n",
240-
"Need help?".green(),
241-
"https://github.com/Tracer-Cloud/tracer".cyan(),
241+
"- {} Need help? Email us at {}\n",
242+
"Support".green(),
242243
"support@tracer.cloud".cyan()
243244
);
244245
}

src/tracer/src/cli/handlers/info.rs

Lines changed: 35 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -141,32 +141,24 @@ impl InfoDisplay {
141141
formatter.add_field("User", pipeline_user, "magenta");
142142
formatter.add_field("Organization", user_organization, "magenta");
143143
formatter.add_field("Email", user_email, "magenta");
144-
formatter.add_field("Stage", pipeline.stage(), "yellow");
145144

146145
if let Some(otel_status) = &pipeline.opentelemetry_status {
147146
let status_text = if otel_status.enabled {
148-
"Running"
147+
format!(
148+
"Running (PID: {})",
149+
otel_status.pid.map_or("N/A".to_string(), |p| p.to_string())
150+
)
149151
} else {
150-
"Stopped"
152+
"Stopped".to_string()
151153
};
152154
let status_color = if otel_status.enabled {
153155
"active"
154156
} else {
155157
"inactive"
156158
};
157-
formatter.add_status_field("Logging status", status_text, status_color);
158-
159-
if let Some(version) = &otel_status.version {
160-
formatter.add_field("Version", version, "cyan");
161-
}
162-
if let Some(pid) = otel_status.pid {
163-
formatter.add_field("PID", &pid.to_string(), "white");
164-
}
165-
if let Some(endpoint) = &otel_status.endpoint {
166-
formatter.add_field("Endpoint", endpoint, "yellow");
167-
}
159+
formatter.add_status_field("Logging", &status_text, status_color);
168160
} else {
169-
formatter.add_status_field("Logging status", "Unknown", "inactive");
161+
formatter.add_status_field("Logging", "Unknown", "inactive");
170162
}
171163

172164
formatter.add_empty_line();
@@ -235,6 +227,13 @@ impl InfoDisplay {
235227
formatter.add_field("Run status", "No run found", "red");
236228
formatter.add_empty_line();
237229
}
230+
231+
formatter.add_section_header("Resources");
232+
formatter.add_empty_line();
233+
formatter.add_field("Dashboard", self.get_sandbox_url(&pipeline), "blue");
234+
formatter.add_field("Docs", "https://www.tracer.cloud/docs", "blue");
235+
formatter.add_field("Support", "support@tracer.cloud", "blue");
236+
formatter.add_empty_line();
238237
}
239238

240239
pub fn print_error(&self) {
@@ -246,26 +245,40 @@ impl InfoDisplay {
246245
formatter.add_header("Tracer CLI");
247246
formatter.add_empty_line();
248247
formatter.add_field("Version", &Version::current().to_string(), "bold");
248+
formatter.add_field(
249+
"Stage",
250+
if is_development_environment() {
251+
"dev"
252+
} else {
253+
"prod"
254+
},
255+
"bold",
256+
);
249257
formatter.add_empty_line();
250258
formatter.add_section_header("Pipeline details");
251259
formatter.add_empty_line();
252260
formatter.add_status_field("Pipeline status", "Not started", "inactive");
253261
formatter.add_empty_line();
254262
formatter.add_section_header("Next steps");
255263
formatter.add_empty_line();
256-
formatter.add_field("Interactive setup", "tracer init", "cyan");
257-
formatter.add_hyperlink("Sandbox", self.get_sandbox_url());
258-
formatter.add_hyperlink(
259-
"Documentation",
260-
"https://github.com/Tracer-Cloud/tracer-client",
261-
);
264+
formatter.add_field("Get started", "tracer login && tracer init", "cyan");
265+
formatter.add_field("Dashboard", self.get_sandbox_url_from_env(), "blue");
266+
formatter.add_field("Docs", "https://www.tracer.cloud/docs", "blue");
262267
formatter.add_field("Support", "support@tracer.cloud", "blue");
263268
formatter.add_empty_line();
264269
formatter.add_footer();
265270
println!("{}", formatter.get_output());
266271
}
267272

268-
pub fn get_sandbox_url(&self) -> &str {
273+
pub fn get_sandbox_url(&self, pipeline: &PipelineMetadata) -> &str {
274+
if pipeline.is_dev {
275+
SANDBOX_URL_DEV
276+
} else {
277+
SANDBOX_URL_PROD
278+
}
279+
}
280+
281+
pub fn get_sandbox_url_from_env(&self) -> &str {
269282
if is_development_environment() {
270283
SANDBOX_URL_DEV
271284
} else {

0 commit comments

Comments
 (0)