-
Notifications
You must be signed in to change notification settings - Fork 24
feat: include target architecture of compiled builds in logstash events #126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #126 +/- ##
==========================================
+ Coverage 63.48% 63.49% +0.01%
==========================================
Files 212 212
Lines 22344 22345 +1
==========================================
+ Hits 14184 14188 +4
+ Misses 7078 7077 -1
+ Partials 1082 1080 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
zimeg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🪵 Words of findings and thought in these changes for the kind reviewers!
| CLIVersion: versionString, | ||
| Host: ioutils.GetHostname(), | ||
| OS: runtime.GOOS, | ||
| Arch: runtime.GOARCH, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📣 TIL that GOARCH is set at compile time and not runtime, so this matches the installed build:
GOARCH, GOOS, and GOROOT are recorded at compile time and made available by constants or functions in this package, but they do not influence the execution of the run-time system.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow! I was about to point that this is may report the user's system architecture instead of the binary's architecture. Thanks for digging into it and finding out that it uses the binary's arch!
mwbrooks
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ Great work @zimeg! This will definitely help us understand what architecture folks are running.
🧪 I've manually tested by downloading the Universal and Intel binaries and confirming that the logs are flusehd with amd64 arch:
# Remove the unsigned warning
$ xattr -dr com.apple.quarantine ./bin/slack
# Test
./bin/slack version --verbose
# [2025-06-12 15:34:45] FlushToLogstash will POST https://dev.slackb.com/events/cli payload: [{"context":{"arch":"amd64","bin":"./bin/slack","cli_version":"3.3.0-15-g5113c2a","command":"version","command_canonical":"version","flags":["verbose"],"host":"...","os":"darwin","session_id":"...","system_id":"..."},"data":{"app":{},"auth":{}},"event":"success","timestamp":...}]| CLIVersion: versionString, | ||
| Host: ioutils.GetHostname(), | ||
| OS: runtime.GOOS, | ||
| Arch: runtime.GOARCH, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow! I was about to point that this is may report the user's system architecture instead of the binary's architecture. Thanks for digging into it and finding out that it uses the binary's arch!
|
@mwbrooks Thanks for checking the releases! I didn't think to also test with the universal build but found The But beforehand, a thankful TIL about this most helpful command - I have been using System Preferences: |
|
@zimeg Yea, it's unfortunate that the Universal binary is not reporting both architectures or something unique, but we have to work with what we have! |
Summary
This PR adds the target architecture of compiled builds in events sent to logstash for errors following #101 #114 #124.
Reviewers
Confirm this build includes the target machine's architecture with the following command:
$ slack version --verbose ... FlushToLogstash will POST https://dev.slackb.com/events/cli payload: [{"context":{"arch":"arm64","...":"..."}]Requirements