Skip to content

Commit 551a8fd

Browse files
committed
chore: add install_source to telemetry
This will help determine the number of installs from marketplaces!
1 parent 2478012 commit 551a8fd

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

coderd/telemetry/telemetry.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,13 @@ func (r *remoteReporter) deployment() error {
230230
if sysInfo.Containerized != nil {
231231
containerized = *sysInfo.Containerized
232232
}
233+
234+
// Tracks where Coder was installed from!
235+
installSource := os.Getenv("CODER_TELEMETRY_INSTALL_SOURCE")
236+
if installSource != "" && installSource != "aws_marketplace" {
237+
return xerrors.Errorf("invalid installce source: %s", installSource)
238+
}
239+
233240
data, err := json.Marshal(&Deployment{
234241
ID: r.options.DeploymentID,
235242
Architecture: sysInfo.Architecture,
@@ -243,6 +250,7 @@ func (r *remoteReporter) deployment() error {
243250
OIDCAuth: r.options.OIDCAuth,
244251
OIDCIssuerURL: r.options.OIDCIssuerURL,
245252
Prometheus: r.options.Prometheus,
253+
InstallSource: installSource,
246254
STUN: r.options.STUN,
247255
Tunnel: r.options.Tunnel,
248256
OSType: sysInfo.OS.Type,
@@ -677,6 +685,7 @@ type Deployment struct {
677685
OIDCAuth bool `json:"oidc_auth"`
678686
OIDCIssuerURL string `json:"oidc_issuer_url"`
679687
Prometheus bool `json:"prometheus"`
688+
InstallSource string `json:"install_source"`
680689
STUN bool `json:"stun"`
681690
OSType string `json:"os_type"`
682691
OSFamily string `json:"os_family"`

0 commit comments

Comments
 (0)