Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7adf582

Browse files
committed
disable report on close when reporting telemetry disabled
1 parent9455ca5 commit7adf582

File tree

2 files changed

+16
-12
lines changed

2 files changed

+16
-12
lines changed

‎cli/server.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -822,10 +822,11 @@ func (r *RootCmd) Server(newAPI func(context.Context, *coderd.Options) (*coderd.
822822

823823
if!vals.Telemetry.Enable.Value() {
824824
reporter,err:=telemetry.New(telemetry.Options{
825-
DeploymentID:deploymentID,
826-
Database:options.Database,
827-
Logger:logger.Named("telemetry"),
828-
URL:vals.Telemetry.URL.Value(),
825+
DeploymentID:deploymentID,
826+
Database:options.Database,
827+
Logger:logger.Named("telemetry"),
828+
URL:vals.Telemetry.URL.Value(),
829+
DisableReportOnClose:true,
829830
})
830831
iferr!=nil {
831832
logger.Debug(ctx,"create telemetry reporter (disabled)",slog.Error(err))

‎coderd/telemetry/telemetry.go

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,11 @@ type Options struct {
4747
// URL is an endpoint to direct telemetry towards!
4848
URL*url.URL
4949

50-
DeploymentIDstring
51-
DeploymentConfig*codersdk.DeploymentValues
52-
BuiltinPostgresbool
53-
Tunnelbool
50+
DeploymentIDstring
51+
DeploymentConfig*codersdk.DeploymentValues
52+
BuiltinPostgresbool
53+
Tunnelbool
54+
DisableReportOnClosebool
5455

5556
SnapshotFrequency time.Duration
5657
ParseLicenseJWTfunc(lic*License)error
@@ -175,10 +176,12 @@ func (r *remoteReporter) Close() {
175176
close(r.closed)
176177
now:=dbtime.Now()
177178
r.shutdownAt=&now
178-
// Report a final collection of telemetry prior to close!
179-
// This could indicate final actions a user has taken, and
180-
// the time the deployment was shutdown.
181-
r.reportWithDeployment()
179+
if!r.options.DisableReportOnClose {
180+
// Report a final collection of telemetry prior to close!
181+
// This could indicate final actions a user has taken, and
182+
// the time the deployment was shutdown.
183+
r.reportWithDeployment()
184+
}
182185
r.closeFunc()
183186
}
184187

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp