Skip to content

Commit

Permalink
feat(lifecycle-operator): add namespace to deploymentduration metri…
Browse files Browse the repository at this point in the history
…cs (#3292)

Signed-off-by: Pim Merks <pimmerks@users.noreply.github.com>
  • Loading branch information
pimmerks committed Mar 19, 2024
1 parent 15717bd commit 0735e31
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ func (a KeptnAppVersion) GetMetricsAttributes() []attribute.KeyValue {
func (a KeptnAppVersion) GetDurationMetricsAttributes() []attribute.KeyValue {
return []attribute.KeyValue{
common.AppName.String(a.Spec.AppName),
common.AppNamespace.String(a.Namespace),
common.AppVersion.String(a.Spec.Version),
common.AppPreviousVersion.String(a.Spec.PreviousVersion),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ func TestKeptnAppVersion(t *testing.T) {

require.Equal(t, []attribute.KeyValue{
common.AppName.String("appname"),
common.AppNamespace.String("namespace"),
common.AppVersion.String("version"),
common.AppPreviousVersion.String("prev"),
}, app.GetDurationMetricsAttributes())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ func (w KeptnWorkloadVersion) GetDurationMetricsAttributes() []attribute.KeyValu
return []attribute.KeyValue{
common.AppName.String(w.Spec.AppName),
common.WorkloadName.String(w.Spec.WorkloadName),
common.WorkloadNamespace.String(w.Namespace),
common.WorkloadVersion.String(w.Spec.Version),
common.WorkloadPreviousVersion.String(w.Spec.PreviousVersion),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ func TestKeptnWorkloadVersion(t *testing.T) {
require.Equal(t, []attribute.KeyValue{
common.AppName.String("appname"),
common.WorkloadName.String("workloadname"),
common.WorkloadNamespace.String("namespace"),
common.WorkloadVersion.String("version"),
common.WorkloadPreviousVersion.String("prev"),
}, workload.GetDurationMetricsAttributes())
Expand Down

0 comments on commit 0735e31

Please sign in to comment.