Skip to content

[telemetry] add nix.version to sentry and segment #1469

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

Merged
merged 1 commit into from
Sep 12, 2023

Conversation

savil
Copy link
Collaborator

@savil savil commented Sep 11, 2023

Summary

Upon request by @Lagoja, this PR adds nix-version information to the sentry and segment telemetry logging.

How was it tested?

Added a sentryDSN and telemetryKey locally, and built the binary.
Added a print-statement to verify the nix-version in the commandEvent to segment is correctly set for me.

Copy link
Collaborator Author

savil commented Sep 11, 2023

Current dependencies on/for this PR:

This comment was auto-generated by Graphite.

@savil savil requested a review from gcurtis September 11, 2023 23:17
@savil savil marked this pull request as ready for review September 11, 2023 23:17
@savil savil merged commit e5aceed into main Sep 12, 2023
@savil savil deleted the savil/nix-version-telemetry branch September 12, 2023 18:52
@savil savil mentioned this pull request Oct 18, 2023
savil added a commit that referenced this pull request Oct 18, 2023
## Summary

`newSentryException` can error
[here](https://github.com/jetpack-io/devbox/blob/main/internal/telemetry/sentry.go#L55)
due to `err` being `nil`. Its only callsite is
[here](https://github.com/jetpack-io/devbox/blob/main/internal/telemetry/telemetry.go#L130),
but the `nix.Version` above is resetting the `err` to `nil` leading to a
segfault.

This was my bad from #1469 

In this PR, I change the variable `err` to `errToLog` so that any of us
adding other code here do not accidentally clobber the `errToLog`
variable.

I think but not sure this is the cause of #1562 (but not sure).

## How was it tested?

I managed to get a repro with the nginx example and running `devbox`
version 0.6, and doing `devbox services up -b`, when the services are
already running leading to an error.

When I run it with the new `devbox` binary, it errors correctly without
a segfault.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants