diff --git a/event_reporter/reporter/application_event_reporter.go b/event_reporter/reporter/application_event_reporter.go index 5e76061276b33..bc7e012288ece 100644 --- a/event_reporter/reporter/application_event_reporter.go +++ b/event_reporter/reporter/application_event_reporter.go @@ -39,6 +39,8 @@ var ( resourceEventCacheExpiration = time.Minute * time.Duration(env.ParseNumFromEnv(argocommon.EnvResourceEventCacheDuration, 20, 0, math.MaxInt32)) ) +const ApplicationKind = "Application" + type applicationEventReporter struct { cache *servercache.Cache codefreshClient codefresh.CodefreshClient @@ -216,7 +218,7 @@ func (s *applicationEventReporter) StreamApplicationEvents( return err } reconcileDuration := time.Since(startTime) - s.metricsServer.ObserveEventProcessingDurationHistogramDuration(a.Name, "Application", metrics.MetricChildAppEventType, reconcileDuration) + s.metricsServer.ObserveEventProcessingDurationHistogramDuration(a.Name, ApplicationKind, metrics.MetricChildAppEventType, reconcileDuration) } else { logCtx.Info("processing as root application") // will get here only for root applications (not managed as a resource by another application) @@ -237,7 +239,7 @@ func (s *applicationEventReporter) StreamApplicationEvents( return fmt.Errorf("failed to send event for root application %s/%s: %w", a.Namespace, a.Name, err) } reconcileDuration := time.Since(startTime) - s.metricsServer.ObserveEventProcessingDurationHistogramDuration(a.Name, "Application", metrics.MetricParentAppEventType, reconcileDuration) + s.metricsServer.ObserveEventProcessingDurationHistogramDuration(a.Name, ApplicationKind, metrics.MetricParentAppEventType, reconcileDuration) } revisionMetadata, _ := s.getApplicationRevisionDetails(ctx, a, getOperationRevision(a))