From 0064ce48fcbd524eccfa6da5d5d62ad2ae8e0a99 Mon Sep 17 00:00:00 2001
From: Povilas Versockas
Date: Thu, 11 Jul 2024 18:44:13 +0300
Subject: [PATCH] feat: [TKC-2194] fix workflow execution telemetry
---
pkg/telemetry/sender_sio.go | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/pkg/telemetry/sender_sio.go b/pkg/telemetry/sender_sio.go
index 516f6668ea5..909da094b7c 100644
--- a/pkg/telemetry/sender_sio.go
+++ b/pkg/telemetry/sender_sio.go
@@ -70,7 +70,7 @@ func mapEvent(userID string, event Event) analytics.Track {
return analytics.Track{
Event: event.Name,
UserId: userID,
- Properties: mapProperties(event.Params),
+ Properties: mapProperties(event.Name, event.Params),
Context: &analytics.Context{
App: analytics.AppInfo{
Name: event.Params.AppName,
@@ -81,7 +81,7 @@ func mapEvent(userID string, event Event) analytics.Track {
}
}
-func mapProperties(params Params) analytics.Properties {
+func mapProperties(name string, params Params) analytics.Properties {
properties := analytics.NewProperties().
Set("name", params.AppName).
Set("version", params.AppVersion).
@@ -132,6 +132,19 @@ func mapProperties(params Params) analytics.Properties {
if params.TestSuiteSteps != 0 {
properties = properties.Set("testSuiteSteps", params.TestSuiteSteps)
}
+ if name == "testkube_api_run_test_workflow" {
+ properties = properties.Set("testWorkflowSteps", params.TestWorkflowSteps)
+ properties = properties.Set("testWorkflowExecuteCount", params.TestWorkflowExecuteCount)
+ properties = properties.Set("testWorkflowParallelUsed", params.TestWorkflowParallelUsed)
+ properties = properties.Set("testWorkflowMatrixUsed", params.TestWorkflowMatrixUsed)
+ properties = properties.Set("testWorkflowServicesUsed", params.TestWorkflowServicesUsed)
+ properties = properties.Set("testWorkflowIsSample", params.TestWorkflowIsSample)
+ properties = properties.Set("testWorkflowTemplates", params.TestWorkflowTemplates)
+ properties = properties.Set("testWorkflowImages", params.TestWorkflowImages)
+ properties = properties.Set("testWorkflowTemplateUsed", params.TestWorkflowTemplateUsed)
+ properties = properties.Set("testWorkflowArtifactUsed", params.TestWorkflowArtifactUsed)
+ properties = properties.Set("testWorkflowImage", params.TestWorkflowImage)
+ }
return properties
}