chore: add install_source to telemetry (#6008)

This will help determine the number of installs from marketplaces!
This commit is contained in:
Kyle Carberry
2023-02-03 01:30:54 +00:00
committed by GitHub
parent 8b424f03c2
commit 381d6674ca
2 changed files with 26 additions and 7 deletions
+9
View File
@@ -230,6 +230,13 @@ func (r *remoteReporter) deployment() error {
if sysInfo.Containerized != nil {
containerized = *sysInfo.Containerized
}
// Tracks where Coder was installed from!
installSource := os.Getenv("CODER_TELEMETRY_INSTALL_SOURCE")
if installSource != "" && installSource != "aws_marketplace" {
return xerrors.Errorf("invalid installce source: %s", installSource)
}
data, err := json.Marshal(&Deployment{
ID: r.options.DeploymentID,
Architecture: sysInfo.Architecture,
@@ -243,6 +250,7 @@ func (r *remoteReporter) deployment() error {
OIDCAuth: r.options.OIDCAuth,
OIDCIssuerURL: r.options.OIDCIssuerURL,
Prometheus: r.options.Prometheus,
InstallSource: installSource,
STUN: r.options.STUN,
Tunnel: r.options.Tunnel,
OSType: sysInfo.OS.Type,
@@ -677,6 +685,7 @@ type Deployment struct {
OIDCAuth bool `json:"oidc_auth"`
OIDCIssuerURL string `json:"oidc_issuer_url"`
Prometheus bool `json:"prometheus"`
InstallSource string `json:"install_source"`
STUN bool `json:"stun"`
OSType string `json:"os_type"`
OSFamily string `json:"os_family"`