Skip to content

Commit

Permalink
Track OS distro in diagnose report (#901)
Browse files Browse the repository at this point in the history
This helps us with debugging what exact version of Linux an app is
running on, for example.

Part of appsignal/support#206
  • Loading branch information
tombruijn authored Jan 2, 2023
1 parent a7c2aa7 commit 7f62ada
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
bump: "patch"
type: "add"
---

Track the Operating System release/distro in the diagnose report. This helps us with debugging what exact version of Linux an app is running on, for example.
3 changes: 3 additions & 0 deletions lib/appsignal/cli/diagnose.rb
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,9 @@ def host_information
save :os, os
puts_value "Operating System", os_label

distribution_file = "/etc/os-release"
save :os_distribution, File.exist?(distribution_file) ? File.read(distribution_file) : ""

language_version = "#{rbconfig["RUBY_PROGRAM_VERSION"]}-p#{rbconfig["PATCHLEVEL"]}"
save :language_version, language_version
puts_format "Ruby version", language_version
Expand Down
2 changes: 1 addition & 1 deletion spec/integration/diagnose
3 changes: 3 additions & 0 deletions spec/lib/appsignal/cli/diagnose_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -636,9 +636,12 @@ def dont_accept_prompt_to_send_diagnostics_report
run
host_report = received_report["host"]
host_report.delete("running_in_container") # Tested elsewhere
distribution_file = "/etc/os-release"
os_distribution = File.exist?(distribution_file) ? File.read(distribution_file) : ""
expect(host_report).to eq(
"architecture" => rbconfig["host_cpu"],
"os" => rbconfig["host_os"],
"os_distribution" => os_distribution,
"language_version" => language_version,
"heroku" => false,
"root" => false
Expand Down

0 comments on commit 7f62ada

Please sign in to comment.