Skip to content

release-25.1: roachprod/roachtest/logictest: unconditionally disable Sentry crash reporting #146559

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
May 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions pkg/roachprod/install/cockroach.go
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,10 @@ func (c *SyncedCluster) generateStartCmd(
EnvVars: append(append([]string{
fmt.Sprintf("ROACHPROD=%s", c.roachprodEnvValue(node)),
"GOTRACEBACK=crash",
// N.B. disable telemetry (see `TelemetryOptOut`).
"COCKROACH_SKIP_ENABLING_DIAGNOSTIC_REPORTING=1",
// N.B. set crash reporting URL (see `crashReportURL()`) to the empty string to disable Sentry crash reports.
"COCKROACH_CRASH_REPORTS=",
}, c.Env...), getEnvVars()...),
Binary: cockroachNodeBinary(c, node),
Args: args,
Expand Down
2 changes: 2 additions & 0 deletions pkg/sql/logictest/logic.go
Original file line number Diff line number Diff line change
Expand Up @@ -1334,6 +1334,8 @@ func (t *logicTest) newTestServerCluster(bootstrapBinaryPath, upgradeBinaryPath
t.logsDir = logsDir

var envVars []string
// Set crash reporting URL to the empty string to disable Sentry crash reports.
envVars = append(envVars, "COCKROACH_CRASH_REPORTS=")
if strings.Contains(upgradeBinaryPath, "cockroach-short") {
// If we're using a cockroach-short binary, that means it was
// locally built, so we need to opt-out of version offsetting to
Expand Down
7 changes: 5 additions & 2 deletions pkg/upgrade/upgrades/permanent_upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,16 @@ func addRootToAdminRole(ctx context.Context, txn isql.Txn) error {
func optInToDiagnosticsStatReporting(
ctx context.Context, _ clusterversion.ClusterVersion, deps upgrade.TenantDeps,
) error {
// N.B. The default for `diagnostics.reporting.enabled` is `true` as of [1].
// [1] https://github.com/cockroachdb/cockroach/pull/131097
optIn := true
// We're opting-out of the automatic opt-in. See discussion in updates.go.
if cluster.TelemetryOptOut {
return nil
optIn = false
}
_, err := deps.InternalExecutor.Exec(
ctx, "optInToDiagnosticsStatReporting", nil, /* txn */
`SET CLUSTER SETTING diagnostics.reporting.enabled = true`)
fmt.Sprintf(`SET CLUSTER SETTING diagnostics.reporting.enabled = %t`, optIn))
if errors.Is(err, cluster.SettingOverrideErr) {
return nil
}
Expand Down
8 changes: 5 additions & 3 deletions pkg/util/log/logcrash/crash_reporting.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,13 @@ var (
// Collecting this data from production clusters helps us understand and improve
// how our storage systems behave in real-world use cases.
//
// Note: while the setting itself is actually defined with a default value of
// `false`, it is usually automatically set to `true` when a cluster is created
// (or is migrated from a earlier beta version). This can be prevented with the
// Note: while the setting defaults to `true`, it can be overridden with the
// env var COCKROACH_SKIP_ENABLING_DIAGNOSTIC_REPORTING.
//
// Note: while this setting also controls crash reporting (see logcrash.ShouldSendReport), the updated setting
// isn't affected until after the server startup sequence is complete. Thus, if you also must disable crash reporting
// during server startup, you should set the env var `COCKROACH_CRASH_REPORTS=` to the empty value.
//
// Doing this, rather than just using a default of `true`, means that a node
// will not errantly send a report using a default before loading settings.
DiagnosticsReportingEnabled = settings.RegisterBoolSetting(
Expand Down