Skip to content

Commit

Permalink
feat: [TKC-2194] fix workflow execution telemetry (#5659)
Browse files Browse the repository at this point in the history
  • Loading branch information
povilasv authored Jul 12, 2024
1 parent 3b1a4b9 commit 4665fbd
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions pkg/telemetry/sender_sio.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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).
Expand Down Expand Up @@ -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
}

0 comments on commit 4665fbd

Please sign in to comment.