insights: Add codeInsightsCriticalTelemetry into ping payload
Created by: CristinaBirkel
Closes https://github.com/sourcegraph/sourcegraph/issues/32745
Description
Our critical telemetry ping (total insights) wasn't getting published. I believe this fixes it!
Test plan
I tried to test this out locally. There may be a better way, but here's what I did. (The real test will be once it is deployed to k8s
.)
- Add some logging to
cmd/frontend/internal/app/updatecheck/handler.go
below this line:
fmt.Println("Message:")
var p pingPayload
var t types.CodeInsightsCriticalTelemetry
json.Unmarshal(message, &p)
json.Unmarshal(p.CodeInsightsCriticalTelemetry, &t)
fmt.Println(t)
That will allow you to see what is being published.
sg start dotcom
- Then make a request
POST https://sourcegraph.test:3443/.api/updates
with a body (you may need to change the site number to your own?):
{
"site": "b300fe72-89bf-4927-b3a7-76c32396a98c",
"version": "3.8.0",
"CodeInsightsCriticalTelemetry": { "TotalInsights": 15 }
}
- Check your logs. Before this change, I was seeing a 0. After the change, I see a 15. So that gives me some confidence that this fix is correct.