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
This commit is contained in:
Kyle Carberry
2024-06-20 15:19:45 -04:00
committed by GitHub
parent a1db6d809e
commit 0793a4b35b
15 changed files with 131 additions and 5 deletions
+6
View File
@@ -93,6 +93,7 @@ type Reporter interface {
// database. For example, if a new user is added, a snapshot can
// contain just that user entry.
Report(snapshot *Snapshot)
Enabled() bool
Close()
}
@@ -109,6 +110,10 @@ type remoteReporter struct {
shutdownAt *time.Time
}
func (*remoteReporter) Enabled() bool {
return true
}
func (r *remoteReporter) Report(snapshot *Snapshot) {
go r.reportSync(snapshot)
}
@@ -948,4 +953,5 @@ type ExternalProvisioner struct {
type noopReporter struct{}
func (*noopReporter) Report(_ *Snapshot) {}
func (*noopReporter) Enabled() bool { return false }
func (*noopReporter) Close() {}