From a03f3968472ce79e540cd76f129dd3e97cfcae66 Mon Sep 17 00:00:00 2001 From: Marcio Goda Date: Fri, 8 Dec 2023 10:25:04 +0000 Subject: [PATCH] added release_version tag and fixed version tag (#53) * added cdflow_version tag and fixed version tag * fixed missing colon in tag * swap cdflow version with Relase Version * fixed release release_version tag --- main.go | 5 ++++- monitoring/datadog.go | 16 +++++++++------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/main.go b/main.go index f2040b3..4a39669 100644 --- a/main.go +++ b/main.go @@ -231,7 +231,7 @@ func runCommand() (status int) { usage("release") return 2 } - + state.MonitoringClient.ReleaseVersion = releaseArgs.Version if err := release.RunCommand(state, *releaseArgs, env); err != nil { if status, ok := err.(command.Failure); ok { return int(status) @@ -248,6 +248,7 @@ func runCommand() (status int) { } state.MonitoringClient.Environment = deployArgs.EnvName + state.MonitoringClient.ReleaseVersion = deployArgs.Version if err := deploy.RunCommand(state, deployArgs, env); err != nil { if status, ok := err.(command.Failure); ok { @@ -265,6 +266,7 @@ func runCommand() (status int) { } state.MonitoringClient.Environment = shellArgs.EnvName + state.MonitoringClient.ReleaseVersion = shellArgs.Version if err := shell.RunCommand(state, shellArgs, env); err != nil { if status, ok := err.(command.Failure); ok { @@ -297,6 +299,7 @@ func runCommand() (status int) { } state.MonitoringClient.Environment = destroyArgs.EnvName + state.MonitoringClient.ReleaseVersion = destroyArgs.Version if err := destroy.RunCommand(state, destroyArgs, env); err != nil { if status, ok := err.(command.Failure); ok { diff --git a/monitoring/datadog.go b/monitoring/datadog.go index 63a8620..51902ba 100644 --- a/monitoring/datadog.go +++ b/monitoring/datadog.go @@ -12,13 +12,14 @@ import ( ) type DatadogClient struct { - APIKey string - Command string - Environment string - ConfigData map[string]string - Project string - StatusCode int - Version string + APIKey string + Command string + Environment string + ConfigData map[string]string + Project string + StatusCode int + Version string + ReleaseVersion string } func NewDatadogClient() *DatadogClient { @@ -76,6 +77,7 @@ func (m *DatadogClient) collectTags() []string { tags := []string{ "command:" + m.Command, "version:" + m.Version, + "release_version:" + m.ReleaseVersion, "status_code:" + strconv.Itoa(m.StatusCode), }