Skip to content

Commit

Permalink
Track OS distro in diagnose report (#812)
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 6ee5245 commit 7b879f6
Show file tree
Hide file tree
Showing 3 changed files with 21 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.
14 changes: 14 additions & 0 deletions src/diagnose.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,27 @@ export class DiagnoseTool {
return {
architecture: process.arch,
os: process.platform,
os_distribution: this.getOsDistribution(),
language_version: process.versions.node,
heroku,
root: processGetuid() === 0,
running_in_container: this.#extension.runningInContainer()
}
}

private getOsDistribution() {
const path = "/etc/os-release"
if (fs.existsSync(path)) {
try {
return fs.readFileSync(path, "utf8")
} catch (error) {
return `Error reading ${path}: ${error}`
}
} else {
return ""
}
}

private getInstallationReport() {
let rawReport
try {
Expand Down
2 changes: 1 addition & 1 deletion test/integration/diagnose

0 comments on commit 7b879f6

Please sign in to comment.