Skip to content

Commit 6be9fd5

Browse files
authored
Merge pull request #146558 from cockroachdb/blathers/backport-release-24.3-146343
release-24.3: roachprod/roachtest/logictest: unconditionally disable Sentry crash reporting
2 parents dc13f2e + 08cf813 commit 6be9fd5

File tree

4 files changed

+15
-5
lines changed

4 files changed

+15
-5
lines changed

pkg/roachprod/install/cockroach.go

+3
Original file line numberDiff line numberDiff line change
@@ -814,7 +814,10 @@ func (c *SyncedCluster) generateStartCmd(
814814
EnvVars: append(append([]string{
815815
fmt.Sprintf("ROACHPROD=%s", c.roachprodEnvValue(node)),
816816
"GOTRACEBACK=crash",
817+
// N.B. disable telemetry (see `TelemetryOptOut`).
817818
"COCKROACH_SKIP_ENABLING_DIAGNOSTIC_REPORTING=1",
819+
// N.B. set crash reporting URL (see `crashReportURL()`) to the empty string to disable Sentry crash reports.
820+
"COCKROACH_CRASH_REPORTS=",
818821
}, c.Env...), getEnvVars()...),
819822
Binary: cockroachNodeBinary(c, node),
820823
Args: args,

pkg/sql/logictest/logic.go

+2
Original file line numberDiff line numberDiff line change
@@ -1334,6 +1334,8 @@ func (t *logicTest) newTestServerCluster(bootstrapBinaryPath, upgradeBinaryPath
13341334
t.logsDir = logsDir
13351335

13361336
var envVars []string
1337+
// Set crash reporting URL to the empty string to disable Sentry crash reports.
1338+
envVars = append(envVars, "COCKROACH_CRASH_REPORTS=")
13371339
if strings.Contains(upgradeBinaryPath, "cockroach-short") {
13381340
// If we're using a cockroach-short binary, that means it was
13391341
// locally built, so we need to opt-out of version offsetting to

pkg/upgrade/upgrades/permanent_upgrades.go

+5-2
Original file line numberDiff line numberDiff line change
@@ -141,13 +141,16 @@ func addRootToAdminRole(ctx context.Context, txn isql.Txn) error {
141141
func optInToDiagnosticsStatReporting(
142142
ctx context.Context, _ clusterversion.ClusterVersion, deps upgrade.TenantDeps,
143143
) error {
144+
// N.B. The default for `diagnostics.reporting.enabled` is `true` as of [1].
145+
// [1] https://github.com/cockroachdb/cockroach/pull/131097
146+
optIn := true
144147
// We're opting-out of the automatic opt-in. See discussion in updates.go.
145148
if cluster.TelemetryOptOut {
146-
return nil
149+
optIn = false
147150
}
148151
_, err := deps.InternalExecutor.Exec(
149152
ctx, "optInToDiagnosticsStatReporting", nil, /* txn */
150-
`SET CLUSTER SETTING diagnostics.reporting.enabled = true`)
153+
fmt.Sprintf(`SET CLUSTER SETTING diagnostics.reporting.enabled = %t`, optIn))
151154
if errors.Is(err, cluster.SettingOverrideErr) {
152155
return nil
153156
}

pkg/util/log/logcrash/crash_reporting.go

+5-3
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,13 @@ var (
4040
// Collecting this data from production clusters helps us understand and improve
4141
// how our storage systems behave in real-world use cases.
4242
//
43-
// Note: while the setting itself is actually defined with a default value of
44-
// `false`, it is usually automatically set to `true` when a cluster is created
45-
// (or is migrated from a earlier beta version). This can be prevented with the
43+
// Note: while the setting defaults to `true`, it can be overridden with the
4644
// env var COCKROACH_SKIP_ENABLING_DIAGNOSTIC_REPORTING.
4745
//
46+
// Note: while this setting also controls crash reporting (see logcrash.ShouldSendReport), the updated setting
47+
// isn't affected until after the server startup sequence is complete. Thus, if you also must disable crash reporting
48+
// during server startup, you should set the env var `COCKROACH_CRASH_REPORTS=` to the empty value.
49+
//
4850
// Doing this, rather than just using a default of `true`, means that a node
4951
// will not errantly send a report using a default before loading settings.
5052
DiagnosticsReportingEnabled = settings.RegisterBoolSetting(

0 commit comments

Comments
 (0)