Skip to content

Commit

Permalink
runtime/metrics: don't collect on startup or shutdown
Browse files Browse the repository at this point in the history
Metrics providers don't like when metrics are pushed on irregular
intervals and reject these metrics, causing unnecessary error logs.
  • Loading branch information
eandre committed Nov 27, 2023
1 parent ef3c663 commit 910b0b0
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions runtimes/go/appruntime/infrasdk/metrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ func (mgr *Manager) Shutdown(p *shutdown.Process) error {
<-p.ServicesShutdownCompleted.Done()
<-p.OutstandingTasks.Done()

mgr.collectNow(p.ForceShutdown)
mgr.cancel()

if mgr.exp != nil {
Expand All @@ -76,10 +75,6 @@ func (mgr *Manager) BeginCollection() {
return
}

ctx, cancel := context.WithTimeout(context.Background(), 25*time.Second)
mgr.collectNow(ctx)
cancel()

interval := mgr.runtime.Metrics.CollectionInterval
if interval <= 0 {
interval = time.Minute
Expand Down

0 comments on commit 910b0b0

Please sign in to comment.