Skip to content

Add metrics for Git-based backend sync operations #4590

@rohitnarayan

Description

@rohitnarayan

Description

Currently, Flipt does not expose metrics for failures when syncing flags from a Git-based backend (GitLab/GitHub). Errors are logged, but there are no dedicated metrics for monitoring sync health. This makes it difficult to detect and alert on issues such as failed syncs, delayed updates, or unexpected changes.

To improve observability and reliability, Flipt should expose detailed metrics for git sync operations, covering both successes and failures.

Proposed metrics to add:

  • Last sync time
  • Sync duration
  • Number of flags updated/fetched
  • Success/failure counts
  • Failure reasons (if available)

These will allow operators to track sync behavior, set up alerts, and diagnose issues proactively.


Acceptance Criteria

  • Flipt exposes metrics for Git-based backend syncs including:
    • Last sync time
    • Sync duration
    • Number of flags updated/fetched
    • Success/failure counts
    • Failure reasons
  • Metrics are available via the existing metrics endpoint.
  • Metrics follow Prometheus naming conventions.
  • Documentation is updated to describe these metrics and how to consume them.

Validation

  1. Deploy Flipt with a Git-based backend (GitLab/GitHub).
  2. Trigger a successful sync.
    • Verify metrics update with new last_sync_time, sync_duration, and flags_fetched/updated values.
  3. Trigger a failed sync (e.g., bad credentials, unreachable repo).
    • Verify metrics increment failure_count and expose the failure reason.
  4. Query metrics endpoint and confirm all proposed metrics are present and correctly updated.
  5. Review updated documentation for accuracy.

Metadata

Metadata

Assignees

Labels

enhancementCreated by Linear-GitHub Sync

Type

No type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions