tutorial

Monitoring Dev Container Environments with Vigilmon: Catch Broken Developer Setups Before They Block Your Team

Use Vigilmon to monitor the health of Dev Container builds, container registries, and the services your devcontainer.json depends on — before a broken environment blocks your whole team.

Your team's Dev Container image build has been broken for three days. The base image pull fails, but only on cold-start — developers who already have the container running are fine. New teammates cloning the repo spend an hour debugging a broken environment before someone mentions it in Slack. By then, three people have lost productive time.

Dev Containers are excellent for reproducible development environments, but the infrastructure they depend on — container registries, feature endpoints, forwarded service ports — can fail silently. This tutorial shows you how to monitor that infrastructure with Vigilmon so broken dev environments get caught before they block your team.

What You'll Cover

  • Monitoring container registry availability for Dev Container base images
  • Heartbeat monitoring for Dev Container build pipelines
  • Tracking forwarded service ports inside running containers
  • Alerting on broken feature endpoints and postCreate commands
  • CI-based devcontainer health checks with Vigilmon

Prerequisites

  • A project using Dev Containers (devcontainer.json)
  • Familiarity with VS Code Dev Containers or GitHub Codespaces
  • A free account at vigilmon.online

The Problem: What Dev Container Failures Look Like

Dev Containers depend on several external and internal services:

  1. Base image registry — Docker Hub, GitHub Container Registry, or a private registry. If it's down or rate-limited, your container won't build.
  2. Dev Container features — fetched from ghcr.io/devcontainers/features. A network hiccup during devcontainer up breaks the whole setup.
  3. postCreate / postStart commands — run inside the container after it starts. If they fail silently, your dev environment starts in a broken state.
  4. Forwarded ports — databases, API servers, and other services your app needs. If a forwarded service crashes, developers notice only when they try to use it.

Vigilmon addresses these with two monitor types: HTTP monitors for endpoints that should always respond, and heartbeat monitors for pipelines that should run on a schedule.


Step 1: Monitor Your Container Registry

If your team uses a private container registry (or depends on a public one), add an HTTP monitor to detect outages before developers start their day.

Private registry

  1. Log in to Vigilmon and click New Monitor → HTTP.
  2. Set the URL to your registry's health or catalog endpoint:
    • GitHub Container Registry: https://ghcr.io/v2/ (returns 401 with a valid WWW-Authenticate header — this is the expected response, not a failure)
    • Docker Hub: https://hub.docker.com/
    • Harbor: https://your-registry.example.com/api/v2.0/health
  3. Set the expected status code (200 for Harbor health, or configure Vigilmon to accept 401 for registry v2 endpoints).
  4. Set the check interval to every 5 minutes.
  5. Name it Container Registry — ghcr.io or similar.

Now if the registry goes down, you know before your developers hit a broken devcontainer up.


Step 2: Monitor Services Forwarded by devcontainer.json

Dev Container port forwarding (forwardPorts) makes local services available inside and outside the container. If the underlying service crashes, developers get confusing connection errors.

Add HTTP monitors for each forwarded service's health endpoint:

// .devcontainer/devcontainer.json
{
  "image": "mcr.microsoft.com/devcontainers/base:ubuntu",
  "forwardPorts": [3000, 5432, 6379],
  "postStartCommand": "bash .devcontainer/start-services.sh"
}

For each forwarded port, create a Vigilmon HTTP monitor pointing to its health endpoint:

| Service | Port | Monitor URL | |---|---|---| | App server | 3000 | http://localhost:3000/health | | PostgreSQL | 5432 | TCP monitor on port 5432 | | Redis | 6379 | TCP monitor on port 6379 |

For TCP services (PostgreSQL, Redis), use Vigilmon's TCP monitor type:

  1. Click New Monitor → TCP.
  2. Enter localhost and the port number.
  3. Set the check interval to every 2 minutes.

This tells you when a forwarded service crashes inside the container — before a developer spends 30 minutes wondering why their app can't connect to the database.


Step 3: Heartbeat Monitoring for Dev Container Build Pipelines

Many teams rebuild their Dev Container image nightly or after dependency updates. Use a heartbeat monitor to detect when these builds stop completing.

GitHub Actions build pipeline

# .github/workflows/devcontainer-build.yml
name: Dev Container Image Build

on:
  schedule:
    - cron: "0 1 * * *"  # nightly at 01:00 UTC
  push:
    paths:
      - ".devcontainer/**"
  workflow_dispatch:

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v4

      - name: Build Dev Container image
        uses: devcontainers/ci@v0.3
        with:
          imageName: ghcr.io/${{ github.repository }}/devcontainer
          cacheFrom: ghcr.io/${{ github.repository }}/devcontainer
          push: always

      - name: Ping Vigilmon heartbeat
        if: success()
        run: |
          curl -fsS -X POST "${{ secrets.VIGILMON_DEVCONTAINER_BUILD_URL }}" \
            --max-time 10 \
            --retry 3 \
            --retry-delay 2

Create a heartbeat monitor in Vigilmon with a 25-hour interval (adds a 1-hour buffer for the nightly build). If the build breaks or the workflow stops triggering, you get alerted within one interval.


Step 4: Validate postCreate Commands with a Health Check Script

postCreateCommand runs after the container starts. If it fails silently, developers end up with a broken environment and no obvious error message. Add a validation script that confirms the environment is healthy and pings Vigilmon:

# .devcontainer/validate-env.sh
#!/bin/bash
set -euo pipefail

echo "Validating dev environment..."

# Check required tools
for tool in node npm git psql redis-cli; do
    if ! command -v "$tool" &>/dev/null; then
        echo "ERROR: $tool not found"
        exit 1
    fi
done

# Check database connection
psql "$DATABASE_URL" -c "SELECT 1;" > /dev/null 2>&1 || {
    echo "ERROR: Cannot connect to database"
    exit 1
}

# Check Redis connection
redis-cli ping > /dev/null 2>&1 || {
    echo "ERROR: Cannot reach Redis"
    exit 1
}

echo "All checks passed."

# Ping Vigilmon if running in CI (not in local dev)
if [ -n "${VIGILMON_DEVENV_URL:-}" ]; then
    curl -fsS -X POST "$VIGILMON_DEVENV_URL" --max-time 10 --retry 3
    echo "Heartbeat sent to Vigilmon."
fi

Update devcontainer.json to run this after creation:

{
  "image": "mcr.microsoft.com/devcontainers/base:ubuntu",
  "postCreateCommand": "bash .devcontainer/validate-env.sh",
  "forwardPorts": [3000, 5432, 6379],
  "secrets": {
    "VIGILMON_DEVENV_URL": {
      "description": "Vigilmon heartbeat URL for dev environment validation"
    }
  }
}

In GitHub Codespaces, secrets configured in devcontainer.json are injected automatically from your Codespaces secrets.


Step 5: Monitor Codespaces Availability

If your team uses GitHub Codespaces as the primary dev environment, you can monitor whether Codespaces itself is available using Vigilmon's HTTP monitor pointed at the GitHub status page API:

  1. Create an HTTP monitor for https://www.githubstatus.com/api/v2/components.json.
  2. Set the check interval to every 5 minutes.
  3. Add a keyword check: Vigilmon can alert if the response body changes — useful for detecting component degradation.

Alternatively, monitor your team's Codespaces usage dashboard endpoint if your organization has one.


Step 6: Set Up Alert Channels

In Vigilmon, go to Notifications → New Channel and configure:

  • Email — immediate alert when a monitor fails
  • Slack webhook — post to #dev-infra or #engineering

When your Dev Container build pipeline stops:

🔴 MISSED HEARTBEAT: Dev Container Build — nightly
Last ping: 26 hours ago
Expected interval: 24 hours

When the registry goes down:

🔴 DOWN: Container Registry — ghcr.io
Status: 503 Service Unavailable
Down for: 4 minutes

These alerts reach the team before anyone opens a new terminal and runs devcontainer up into a broken environment.


What You're Now Catching

| Silent failure mode | How Vigilmon detects it | |---|---| | Container registry outage | HTTP monitor detects non-2xx response | | Nightly image rebuild breaks | Heartbeat missed after grace period | | Forwarded database crashes inside container | TCP monitor detects connection failure | | postCreate script fails silently | Heartbeat not sent, alert fires | | Codespaces degraded performance | HTTP monitor on GitHub status API | | Dev Container feature endpoint unreachable | HTTP monitor on feature registry |


Dev Containers make reproducible environments possible — but the services they depend on can fail just like any other infrastructure. Vigilmon closes the gap between "it worked yesterday" and "why is everything broken today," giving your team an early warning system for dev environment failures.

Start monitoring your Dev Container infrastructure today — 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 →