argoproj-labs / argocd-agent

Redefining the multi cluster story of Argo CD
Apache License 2.0
81 stars 15 forks source link

feat: Add informer metrics #209

Closed jannfis closed 3 weeks ago

jannfis commented 4 weeks ago

This PR adds metrics to the generic informer, conveniently handled within the callbacks.

Additionally, it adds some unit tests for the informer package.

The next step will move the existing application informer to use the generic informer, too.

codecov-commenter commented 4 weeks ago

Codecov Report

Attention: Patch coverage is 42.85714% with 84 lines in your changes missing coverage. Please review.

Project coverage is 47.01%. Comparing base (61613f0) to head (1311be9).

Files with missing lines Patch % Lines
internal/informer/appproject/projectinformer.go 61.42% 21 Missing and 6 partials :warning:
internal/informer/informer.go 8.33% 18 Missing and 4 partials :warning:
internal/metrics/metrics.go 0.00% 22 Missing :warning:
internal/manager/application/application.go 0.00% 5 Missing :warning:
internal/metrics/server.go 70.58% 3 Missing and 2 partials :warning:
internal/manager/appproject/appproject.go 0.00% 2 Missing :warning:
principal/server.go 85.71% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #209 +/- ## ========================================== + Coverage 46.99% 47.01% +0.02% ========================================== Files 57 57 Lines 4886 4956 +70 ========================================== + Hits 2296 2330 +34 - Misses 2413 2444 +31 - Partials 177 182 +5 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.