Skip to content

Commit

Permalink
fix(manifest-repo-export-service): measure pushes write when nothing …
Browse files Browse the repository at this point in the history
…to push (#2067)

The `measurePushes` method sends metrics to datadog about wether the
manifest repo export service successfully pushed to git.
This PR makes the service write the metric, as a success, even when
there are no pushes.

Ref: SRX-PLAY6B

---------

Co-authored-by: Sven Urbanski <[email protected]>
  • Loading branch information
1 parent e30ba8f commit 3683edf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/database.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ Metric `Kuberpult.manifest_export_push_failures`.
This metric measures each failure in the manifest-repo-export-service to push to the git repository.
It measures 0 if there are currently no failures, and 1 if there are.

This metric is only written, if there is something for kuberpult to push.
This metric is allways written, even if there is nothing for kuberpult to push.
In case kuberpult has nothing to push this metric writes 0 every `manifestRepoExport.eslProcessingIdleTimeSeconds` seconds.


#### Monitoring Processing Delay
Expand Down
1 change: 1 addition & 0 deletions services/manifest-repo-export-service/pkg/cmd/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ func processEsls(ctx context.Context, repo repository.Repository, dbHandler *db.
if transformer == nil {
sleepDuration.Reset()
d := sleepDuration.NextBackOff()
measurePushes(ddMetrics, log, false)
logger.FromContext(ctx).Sugar().Warnf("event processing skipped, will try again in %v", d)
time.Sleep(d)
continue
Expand Down

0 comments on commit 3683edf

Please sign in to comment.