Ensure telemetry data is sent as a flat map, rather than a structured one.
Этот коммит содержится в:
@@ -403,6 +403,12 @@ func requestTrueUpReview(c *Context, w http.ResponseWriter, r *http.Request) {
|
|||||||
|
|
||||||
// Send telemetry data.
|
// Send telemetry data.
|
||||||
json.Unmarshal(reviewProfileJson, &telemetryProperties)
|
json.Unmarshal(reviewProfileJson, &telemetryProperties)
|
||||||
|
delete(telemetryProperties, "plugins")
|
||||||
|
plugins := reviewProfile.Plugins.ToMap()
|
||||||
|
for pluginName, pluginValue := range plugins {
|
||||||
|
telemetryProperties[pluginName] = pluginValue
|
||||||
|
}
|
||||||
|
|
||||||
telemetryService := c.App.Srv().GetTelemetryService()
|
telemetryService := c.App.Srv().GetTelemetryService()
|
||||||
telemetryService.SendTelemetry(model.TrueUpReviewTelemetryName, telemetryProperties)
|
telemetryService.SendTelemetry(model.TrueUpReviewTelemetryName, telemetryProperties)
|
||||||
|
|
||||||
|
|||||||
@@ -24,3 +24,12 @@ type TrueUpReviewPlugins struct {
|
|||||||
ActivePluginNames []string `json:"active_plugin_names"`
|
ActivePluginNames []string `json:"active_plugin_names"`
|
||||||
InactivePluginNames []string `json:"inactive_plugin_names"`
|
InactivePluginNames []string `json:"inactive_plugin_names"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (t *TrueUpReviewPlugins) ToMap() map[string]any {
|
||||||
|
return map[string]any{
|
||||||
|
"total_active_plugins": t.TotalActivePlugins,
|
||||||
|
"total_inactive_plugins": t.TotalInactivePlugins,
|
||||||
|
"active_plugin_names": t.ActivePluginNames,
|
||||||
|
"inactive_plugin_names": t.InactivePluginNames,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user