Skip to content

Commit

Permalink
[ event_reporter ]: fixes after pr review
Browse files Browse the repository at this point in the history
  • Loading branch information
oleksandr-codefresh committed Dec 15, 2023
1 parent c65697c commit 28ffb17
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions event_reporter/reporter/application_event_reporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -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))
Expand Down

0 comments on commit 28ffb17

Please sign in to comment.