Skip to content

Commit 787e330

Browse files
Set sentry environment and release
1 parent 550c37e commit 787e330

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

.goreleaser.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ builds:
1313
binary: bin/depot
1414
main: ./cmd/depot
1515
ldflags:
16-
- -s -w -X github.com/depot/cli/internal/build.Version={{.Version}} -X github.com/depot/cli/internal/build.Date={{time "2006-01-02"}}
16+
- -s -w -X github.com/depot/cli/internal/build.Version={{.Version}} -X github.com/depot/cli/internal/build.Date={{time "2006-01-02"}} -X github.com/depot/cli/internal/build.SentryEnvironment=release
1717
- -X main.updaterEnabled=depot/cli
1818
id: macos
1919
goos: [darwin]

cmd/depot/main.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ func main() {
1717
func runMain() int {
1818
if os.Getenv("DEPOT_ERROR_TELEMETRY") != "0" {
1919
err := sentry.Init(sentry.ClientOptions{
20-
Dsn: "https://[email protected]/6271909",
20+
Dsn: "https://[email protected]/6271909",
21+
Environment: build.SentryEnvironment,
22+
Release: build.Version,
2123
})
2224
if err != nil {
2325
log.Fatalf("sentry.Init: %s", err)

internal/build/build.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import "runtime/debug"
44

55
var Version = "dev"
66
var Date = ""
7+
var SentryEnvironment = "development"
78

89
func init() {
910
if Version == "dev" {

0 commit comments

Comments
 (0)