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

Commit0793a4b

Browse files
authored
feat: add cross-origin reporting for telemetry in the dashboard (#13612)
* feat: add cross-origin reporting for telemetry in the dashboard* Respect the telemetry flag* Fix embedded metadata* Fix compilation error* Fix linting
1 parenta1db6d8 commit0793a4b

File tree

15 files changed

+131
-5
lines changed

15 files changed

+131
-5
lines changed

‎coderd/apidoc/docs.go‎

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎coderd/apidoc/swagger.json‎

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎coderd/coderd.go‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,7 @@ func New(options *Options) *API {
447447
WorkspaceProxy:false,
448448
UpgradeMessage:api.DeploymentValues.CLIUpgradeMessage.String(),
449449
DeploymentID:api.DeploymentID,
450+
Telemetry:api.Telemetry.Enabled(),
450451
}
451452
api.SiteHandler=site.New(&site.Options{
452453
BinFS:binFS,

‎coderd/telemetry/telemetry.go‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ type Reporter interface {
9393
// database. For example, if a new user is added, a snapshot can
9494
// contain just that user entry.
9595
Report(snapshot*Snapshot)
96+
Enabled()bool
9697
Close()
9798
}
9899

@@ -109,6 +110,10 @@ type remoteReporter struct {
109110
shutdownAt*time.Time
110111
}
111112

113+
func (*remoteReporter)Enabled()bool {
114+
returntrue
115+
}
116+
112117
func (r*remoteReporter)Report(snapshot*Snapshot) {
113118
gor.reportSync(snapshot)
114119
}
@@ -948,4 +953,5 @@ type ExternalProvisioner struct {
948953
typenoopReporterstruct{}
949954

950955
func (*noopReporter)Report(_*Snapshot) {}
956+
func (*noopReporter)Enabled()bool {returnfalse }
951957
func (*noopReporter)Close() {}

‎codersdk/deployment.go‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2173,11 +2173,12 @@ type BuildInfoResponse struct {
21732173
ExternalURLstring`json:"external_url"`
21742174
// Version returns the semantic version of the build.
21752175
Versionstring`json:"version"`
2176-
21772176
// DashboardURL is the URL to hit the deployment's dashboard.
21782177
// For external workspace proxies, this is the coderd they are connected
21792178
// to.
21802179
DashboardURLstring`json:"dashboard_url"`
2180+
// Telemetry is a boolean that indicates whether telemetry is enabled.
2181+
Telemetrybool`json:"telemetry"`
21812182

21822183
WorkspaceProxybool`json:"workspace_proxy"`
21832184

‎docs/api/general.md‎

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎docs/api/schemas.md‎

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎enterprise/wsproxy/wsproxysdk/wsproxysdk_test.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ func TestDialCoordinator(t *testing.T) {
216216
Node:&proto.Node{
217217
Id:55,
218218
AsOf:timestamppb.New(time.Unix(1689653252,0)),
219-
Key:peerNodeKey[:],
219+
Key:peerNodeKey,
220220
Disco:string(peerDiscoKey),
221221
PreferredDerp:0,
222222
DerpLatency:map[string]float64{

‎site/jest.setup.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ global.scrollTo = jest.fn();
4141

4242
window.HTMLElement.prototype.scrollIntoView=jest.fn();
4343
window.open=jest.fn();
44+
navigator.sendBeacon=jest.fn();
4445

4546
// Polyfill the getRandomValues that is used on utils/random.ts
4647
Object.defineProperty(global.self,"crypto",{

‎site/src/api/typesGenerated.ts‎

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp