You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(metrics): add Git sync observability metrics to feature flag backend (#4673)
* This change enhances Flipt's Git-based feature flag backend observability by adding detailed synchronization metrics. Currently, failures during Git sync are only logged without metric visibility, limiting proactive monitoring and alerting capabilities.
- Introduce new OpenTelemetry metrics for Git sync operations:
- Last sync time as an observable gauge (timestamp).
- Sync duration histogram.
- Counters for number of flags fetched.
- Success and failure counts with failure reason attributes.
- Instrument the `SnapshotStore.update` method, the core sync loop, to record these metrics accurately on every sync attempt, including partial failures and cleanups.
- Extend the `Snapshot` type with `TotalFlagsCount()` to count all flags across namespaces for metric reporting.
- Integrate metrics initialization in app startup ensuring consistent telemetry setup.
- Improve test coverage by suggesting strategies to verify metric emission and sync behavior.
These metric additions enable operators to monitor Git sync health, detect failures promptly, and troubleshoot issues efficiently, significantly improving runtime observability and system reliability.
Signed-off-by: Rohit Jaiswal <[email protected]>
* fix(tests): close channel only once
Signed-off-by: Rohit Jaiswal <[email protected]>
* fix(tests): add check for missing features repoURL
Signed-off-by: Rohit Jaiswal <[email protected]>
* feat(metrics): move git metrics in git package
Signed-off-by: Rohit Jaiswal <[email protected]>
* feat(metrics): remove reason from sync metrics
Signed-off-by: Rohit Jaiswal <[email protected]>
* feat(metrics): remove url check
Signed-off-by: Rohit Jaiswal <[email protected]>
* fix(tests): metrics unit tests
Signed-off-by: Rohit Jaiswal <[email protected]>
* refactor: simplify git sync metrics
Signed-off-by: Roman Dmytrenko <[email protected]>
* feat(metrics): use consistent naming and code patterns
Signed-off-by: Rohit Jaiswal <[email protected]>
* feat(metrics): add unit tests for metrics
Signed-off-by: Rohit Jaiswal <[email protected]>
* feat(metrics): use correct meter func
Signed-off-by: Rohit Jaiswal <[email protected]>
* remove unused code
Signed-off-by: Roman Dmytrenko <[email protected]>
---------
Signed-off-by: Rohit Jaiswal <[email protected]>
Signed-off-by: Roman Dmytrenko <[email protected]>
Co-authored-by: Rohit Jaiswal <[email protected]>
Co-authored-by: Mark Phelps <[email protected]>
Co-authored-by: Roman Dmytrenko <[email protected]>
0 commit comments