chore: add workspace proxies to telemetry (#8963)

This commit is contained in:
Dean Sheather
2023-08-08 11:29:35 -07:00
committed by GitHub
parent 3c52b01850
commit f7a35e0559
3 changed files with 45 additions and 1 deletions

View File

@ -23,6 +23,7 @@ import (
"github.com/coder/coder/coderd/httpapi"
"github.com/coder/coder/coderd/httpmw"
"github.com/coder/coder/coderd/rbac"
"github.com/coder/coder/coderd/telemetry"
"github.com/coder/coder/coderd/workspaceapps"
"github.com/coder/coder/codersdk"
"github.com/coder/coder/cryptorand"
@ -369,6 +370,10 @@ func (api *API) postWorkspaceProxy(rw http.ResponseWriter, r *http.Request) {
return
}
api.Telemetry.Report(&telemetry.Snapshot{
WorkspaceProxies: []telemetry.WorkspaceProxy{telemetry.ConvertWorkspaceProxy(proxy)},
})
aReq.New = proxy
httpapi.Write(ctx, rw, http.StatusCreated, codersdk.UpdateWorkspaceProxyResponse{
Proxy: convertProxy(proxy, proxyhealth.ProxyStatus{