tutorial

Monitoring Codefresh with Vigilmon: Pipeline Heartbeats, Runner Health, API Checks & SSL Alerts

How to monitor Codefresh CI/CD pipelines with Vigilmon — build completion heartbeats, self-hosted runner health, API availability, GitOps Argo CD sync monitoring, and SSL certificate alerts.

Codefresh is a Kubernetes-native CI/CD platform that combines pipeline execution with GitOps delivery via Argo CD. Whether you're using Codefresh SaaS with self-hosted runners or the fully on-premises Codefresh On-Premises edition, pipelines can stall silently when runners disconnect, Argo CD application sync drifts, or API rate limits expire. Vigilmon provides external observability for Codefresh: build completion heartbeats, runner connectivity checks, API health validation, and SSL certificate alerts that catch failures before developers notice broken deployments.

What You'll Build

  • A build completion heartbeat for end-to-end pipeline verification
  • A Codefresh runner health heartbeat (for self-hosted runners)
  • An API availability check for the Codefresh platform
  • An Argo CD application sync heartbeat
  • SSL certificate expiry alerts (for on-premises deployments)
  • A TCP port check for the Codefresh on-premises API

Prerequisites

  • A Codefresh account (SaaS or On-Premises)
  • At least one pipeline configured and running
  • For runner monitoring: a Codefresh runner installed in your cluster
  • A free account at vigilmon.online

Step 1: Build Completion Heartbeat

The most direct way to monitor Codefresh is to verify that pipelines are actually completing successfully. Add a heartbeat step to a critical pipeline:

# codefresh.yml
version: "1.0"
stages:
  - build
  - test
  - deploy
  - notify

steps:
  build_image:
    title: Build Docker image
    type: build
    image_name: myorg/myapp
    stage: build

  run_tests:
    title: Run tests
    image: node:20
    stage: test
    commands:
      - npm ci
      - npm test

  deploy_staging:
    title: Deploy to staging
    image: codefresh/kubectl
    stage: deploy
    commands:
      - kubectl set image deployment/myapp myapp=${{CF_DOCKER_TAG}}

  notify_vigilmon:
    title: Notify Vigilmon
    image: curlimages/curl
    stage: notify
    commands:
      - curl -fsS -X POST https://vigilmon.online/api/heartbeat/YOUR-BUILD-HEARTBEAT-ID
    when:
      branch:
        only:
          - main

In Vigilmon:

  1. Add Monitor → Heartbeat.
  2. Expected interval: Match your main branch build frequency (e.g., 60 minutes).
  3. Grace period: 30 minutes.
  4. Label: Codefresh Build Completion

The heartbeat only fires after all preceding steps succeed. If tests fail, the deploy step errors, or Codefresh stops scheduling builds entirely, the heartbeat goes silent and Vigilmon alerts you.


Step 2: Codefresh Runner Health Heartbeat

Self-hosted Codefresh runners execute builds inside your Kubernetes cluster. A disconnected or crash-looping runner causes all builds to queue indefinitely in the Codefresh UI with no clear error:

#!/bin/bash
# /etc/cron.d/codefresh-runner-check — runs every 5 minutes

# Check that at least one runner pod is Running
RUNNER_COUNT=$(kubectl get pods -n codefresh \
  -l app=runner \
  --field-selector=status.phase=Running \
  --no-headers 2>/dev/null | wc -l)

if [ "${RUNNER_COUNT:-0}" -ge 1 ] 2>/dev/null; then
  curl -fsS -X POST https://vigilmon.online/api/heartbeat/YOUR-RUNNER-HEARTBEAT-ID
fi

Alternatively, use the Codefresh CLI:

#!/bin/bash
# Requires codefresh CLI authenticated

RUNNER_STATUS=$(codefresh get runners --output json \
  | python3 -c "
import sys, json
runners = json.load(sys.stdin)
online = [r for r in runners if r.get('status') == 'online']
print(len(online))
")

if [ "${RUNNER_STATUS:-0}" -ge 1 ] 2>/dev/null; then
  curl -fsS -X POST https://vigilmon.online/api/heartbeat/YOUR-RUNNER-HEARTBEAT-ID
fi

In Vigilmon:

  1. Add Monitor → Heartbeat.
  2. Expected interval: 5 minutes.
  3. Grace period: 15 minutes.
  4. Label: Codefresh Runner Health

If all runners go offline, the heartbeat stops and Vigilmon alerts you within the grace period — before the build queue backs up across all your teams.


Step 3: Codefresh API Availability Check

Codefresh exposes a REST API for pipeline management, build triggering, and environment queries. Validate API availability with a direct status check:

#!/bin/bash
# /etc/cron.d/codefresh-api-check — runs every 10 minutes

STATUS=$(curl -s -o /dev/null -w "%{http_code}" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  "https://g.codefresh.io/api/user")

if [ "$STATUS" = "200" ]; then
  curl -fsS -X POST https://vigilmon.online/api/heartbeat/YOUR-API-HEARTBEAT-ID
fi

In Vigilmon:

  1. Add Monitor → Heartbeat.
  2. Expected interval: 10 minutes.
  3. Grace period: 20 minutes.
  4. Label: Codefresh API Availability

This check verifies both API availability and that your API key is valid. Codefresh API key expiration is a common silent failure mode — builds appear to queue but the trigger webhook receives a 401 and fails silently.


Step 4: Monitor the Codefresh On-Premises UI (On-Premises Only)

For teams running Codefresh On-Premises, monitor the web UI directly:

  1. Log in to VigilmonAdd Monitor → HTTP.
  2. URL: https://codefresh.yourdomain.com
  3. Check interval: 120 seconds.
  4. Expected status: 200.
  5. Label: Codefresh On-Premises UI
  6. Click Save.

Also add a health endpoint check:

  1. Add Monitor → HTTP.
  2. URL: https://codefresh.yourdomain.com/api/ping
  3. Check interval: 60 seconds.
  4. Expected status: 200.
  5. Label: Codefresh On-Premises API
  6. Click Save.

Step 5: Argo CD GitOps Sync Heartbeat

Codefresh GitOps uses Argo CD under the hood. Monitor Argo CD application sync to confirm the GitOps layer is keeping your clusters in sync with the Git repository:

#!/bin/bash
# /etc/cron.d/argocd-sync-check — runs every 10 minutes

# Log in to Argo CD
argocd login argocd.yourdomain.com \
  --username admin \
  --password "$ARGOCD_PASSWORD" \
  --insecure 2>/dev/null

# Check that the target application is Synced and Healthy
SYNC_STATUS=$(argocd app get my-app --output json \
  | python3 -c "
import sys, json
app = json.load(sys.stdin)
sync = app.get('status', {}).get('sync', {}).get('status', '')
health = app.get('status', {}).get('health', {}).get('status', '')
print(sync, health)
")

if echo "$SYNC_STATUS" | grep -q "Synced Healthy"; then
  curl -fsS -X POST https://vigilmon.online/api/heartbeat/YOUR-ARGOCD-HEARTBEAT-ID
fi

In Vigilmon:

  1. Add Monitor → Heartbeat.
  2. Expected interval: 10 minutes.
  3. Grace period: 20 minutes.
  4. Label: Codefresh GitOps Argo CD Sync

If the application drifts out of sync, Argo CD reports OutOfSync status, and the heartbeat stops — alerting you to a GitOps drift before it causes production issues.


Step 6: SSL Certificate Alerts

For Codefresh On-Premises deployments, monitor SSL certificates on both the web UI and any Argo CD endpoints:

  1. Add Monitor → SSL Certificate.
  2. Domain: codefresh.yourdomain.com
  3. Alert when expiry is within: 30 days.
  4. Alert again: 14 days, 7 days, 3 days.
  5. Click Save.

Repeat for argocd.yourdomain.com if Argo CD runs on a separate subdomain. An expired certificate breaks webhook delivery from source control, causing pipelines to stop triggering on push events.


Step 7: TCP Port Check for On-Premises API

For Codefresh On-Premises, the API listens on port 443 via ingress. Monitor it at the TCP level:

  1. Add Monitor → TCP.
  2. Host: codefresh.yourdomain.com, Port: 443.
  3. Check interval: 60 seconds.
  4. Label: Codefresh On-Premises API Port
  5. Click Save.

A TCP failure before the HTTP monitor fires points to an ingress or certificate issue rather than the application — narrowing the blast radius during incidents.


Common Codefresh Failure Modes and What Vigilmon Catches

| Scenario | Vigilmon monitor | |---|---| | Build queue stall (no runner available) | Runner heartbeat stops; build completion heartbeat stops | | Runner pod crash-loop | Runner health heartbeat goes silent within grace period | | API key expiration | API availability heartbeat stops; builds stop triggering | | GitOps drift (OutOfSync) | Argo CD sync heartbeat stops | | On-premises UI down | HTTP UI monitor fires within 2 min | | On-premises API crash | API health monitor fires within 60 s | | SSL certificate expires | SSL monitor alerts at 30 days | | Webhook delivery failure | Build completion heartbeat stops (no new builds trigger) | | Pipeline step failure | Build completion heartbeat goes silent | | DNS misconfiguration | All HTTP and SSL monitors fire simultaneously |


Codefresh unifies fast Kubernetes-native pipelines with declarative GitOps delivery, giving teams velocity without sacrificing auditability. Vigilmon closes the observability gap — watching runners, build completion, API health, and GitOps sync — so you catch silent failures before they become incidents for your users.

Start monitoring Codefresh in under 5 minutes — register free at vigilmon.online.

Monitor your app with Vigilmon

Free plan — 5 monitors, no credit card required. Up and running in 60 seconds.

Start free →