From a76f0e281c66dbc3ec593e98ccf621f658dd04a7 Mon Sep 17 00:00:00 2001 From: Nikolay Edigaryev Date: Mon, 19 Aug 2024 18:21:48 +0400 Subject: [PATCH] Support manualRerunCount in task's fields (#13) --- internal/command/datadog/payload/buildortask.go | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/internal/command/datadog/payload/buildortask.go b/internal/command/datadog/payload/buildortask.go index 3f1e729..389e7f2 100644 --- a/internal/command/datadog/payload/buildortask.go +++ b/internal/command/datadog/payload/buildortask.go @@ -19,11 +19,12 @@ type BuildOrTask struct { } `json:"user"` } Task struct { - ID *int64 `json:"id"` - Name *string `json:"name"` - Status *string `json:"status"` - InstanceType *string `json:"instanceType"` - UniqueLabels []string `json:"uniqueLabels"` + ID *int64 `json:"id"` + Name *string `json:"name"` + Status *string `json:"status"` + InstanceType *string `json:"instanceType"` + UniqueLabels []string `json:"uniqueLabels"` + ManualRerunCount *int64 `json:"manualRerunCount"` } common @@ -66,4 +67,7 @@ func (buildOrTask BuildOrTask) Enrich(header http.Header, evt *datadogsender.Eve if value := buildOrTask.Task.UniqueLabels; len(value) > 0 { evt.Tags = append(evt.Tags, fmt.Sprintf("task_unique_labels:%s", strings.Join(value, ","))) } + if value := buildOrTask.Task.ManualRerunCount; value != nil { + evt.Tags = append(evt.Tags, fmt.Sprintf("manual_rerun_count:%d", *value)) + } }