Skip to content

Server Monitoring

BRIDGEPORT collects server-level metrics (CPU, memory, disk, load, swap, TCP connections, and file descriptors) via SSH polling or a lightweight push agent, stores them as time-series data, and visualizes them in interactive charts.

Server monitoring with interactive CPU, memory, swap, and disk time-series charts across multiple servers

  1. Navigate to Servers and select a server.
  2. In the Monitoring card, choose a metrics mode:
    • SSH — BRIDGEPORT polls the server over SSH on a schedule.
    • Agent — A lightweight Go binary runs on the server and pushes metrics.
  3. Go to Monitoring > Servers to see your first data points.
sequenceDiagram
    participant S as Scheduler
    participant BP as BRIDGEPORT
    participant SRV as Your Server
    participant A as Agent (optional)
    participant DB as SQLite

    alt SSH Polling Mode
        S->>BP: Timer fires (every SCHEDULER_METRICS_INTERVAL)
        BP->>SRV: SSH: top, free, df, /proc/loadavg, /proc/uptime
        SRV-->>BP: Raw output
        BP->>DB: Save ServerMetrics row
    end

    alt Agent Push Mode
        A->>BP: POST /api/metrics/ingest (every ~15s)
        Note over A,BP: Server metrics + service metrics<br/>+ containers + top processes<br/>+ TCP/cert checks
        BP->>DB: Save ServerMetrics + ServiceMetrics rows
        BP->>DB: Upsert AgentContainerSnapshot + AgentProcessSnapshot
    end

The SSH collector runs a series of shell commands in a single SSH session:

MetricCommandFields
CPUtop -bn1cpuPercent
Memoryfree -mmemoryUsedMb, memoryTotalMb
Swapfree -mswapUsedMb, swapTotalMb
Diskdf -BG /diskUsedGb, diskTotalGb
Load/proc/loadavgloadAvg1, loadAvg5, loadAvg15
Uptime/proc/uptimeuptime (seconds)

The agent collects everything SSH mode collects, plus:

Additional DataDescription
openFds / maxFdsOpen and max file descriptors
tcpEstablished, tcpListen, tcpTimeWait, tcpCloseWait, tcpTotalTCP socket breakdown
Top processes (by CPU and memory)PID, name, state, CPU%, memory MB, threads
Container snapshotsFull container list with image, state, ports, labels, mounts
TCP check resultsAgent-performed TCP port connectivity checks
Certificate check resultsTLS certificate expiry, issuer, subject

Navigate to Monitoring > Servers (/monitoring/servers).

  • CPU Usage — Percentage over time
  • Memory Usage — Used vs total (MB and percentage)
  • Swap Usage — Used vs total (MB and percentage)
  • Disk Usage — Used vs total (GB and percentage)
  • Load Average — 1, 5, and 15 minute averages
  • TCP Connections — Established, listen, time-wait, close-wait, total
  • File Descriptors — Open vs max (agent mode only)

Use the time range selector to zoom in or out:

RangeData Points
1h~12 (SSH) or ~240 (agent)
6h~72 (SSH) or ~1440 (agent)
24h~288 (SSH) or ~5760 (agent)
7d (max)~2016 (SSH) or ~40320 (agent)

Charts auto-refresh every 30 seconds. Toggle auto-refresh on or off with the checkbox in the top-right corner.

When you set a server’s metrics mode to agent:

  1. BRIDGEPORT generates a unique agent token for the server.
  2. BRIDGEPORT SSHs into the server and deploys the agent binary.
  3. The agent starts pushing to POST /api/metrics/ingest using the token.
  4. The server’s agentStatus transitions from waiting to active.
stateDiagram-v2
    [*] --> waiting: Agent token created
    waiting --> deploying: SSH deploy starts
    deploying --> waiting: Deploy complete
    waiting --> active: First metrics push
    active --> stale: No push for staleThreshold
    stale --> offline: No push for offlineThreshold
    stale --> active: Push received
    offline --> active: Push received
  • active — Agent is pushing metrics regularly.
  • stale — No push received within the stale threshold (configurable in System Settings).
  • offline — No push received within the offline threshold. A system.server_offline notification is sent.

If you need to rotate the agent token:

  1. Go to Monitoring > Agents & SSH.
  2. Click Regenerate Token on the server.
  3. BRIDGEPORT generates a new token and redeploys the agent automatically.

The server detail page and the Monitoring > Agents page show an “Update available” badge when the deployed agent version differs from the bundled version in BRIDGEPORT.

Set in your environment or .env file:

VariableDefaultDescription
SCHEDULER_METRICS_INTERVAL300 (5 min)SSH metrics collection interval (seconds)
SCHEDULER_SERVER_HEALTH_INTERVAL60 (1 min)Server health check interval (seconds)

Collection cadence is global, set by env vars (not per-environment) — see Configuration Reference → Scheduler:

Env varDefaultDescription
SCHEDULER_METRICS_INTERVAL300 (5 min)How often SSH metrics are collected
SCHEDULER_SERVER_HEALTH_INTERVAL60 (1 min)How often server health is checked

Per-environment metric toggles let you disable collection of specific metric types. All are enabled by default. Configure in Settings > Monitoring:

ToggleControls
collectCpuCPU percentage
collectMemoryMemory usage
collectSwapSwap usage
collectDiskDisk usage
collectLoadLoad averages
collectFdsFile descriptors
collectTcpTCP socket counts
collectProcessesTop processes (agent only)
collectTcpChecksTCP port checks (agent only)
collectCertChecksTLS certificate checks (agent only)

Metrics are automatically cleaned up based on retention settings:

SettingDefaultScope
METRICS_RETENTION_DAYS7Global env var (see Configuration Reference)
Cleanup cadenceHourlyGlobal (scheduler runs cleanup every hour)

Old ServerMetrics and ServiceMetrics rows older than the retention period are deleted automatically.

  1. Verify SSH connectivity: Go to Monitoring > Agents & SSH and click Test SSH for the server.
  2. Check metrics mode: Ensure the server is set to ssh mode, not disabled.
  3. Check scheduler: Verify SCHEDULER_ENABLED=true in your environment.
  4. Check SSH user: The SSH user must have permission to run top, free, df, and read /proc/.
  1. Check agent status: Go to Monitoring > Agents & SSH. The agent should show active.
  2. If status is waiting: The agent may not have connected yet. Check the server’s Docker logs or system journal.
  3. If status is offline: The agent stopped pushing. SSH into the server and check if the agent process is running.
  4. Check firewall: The agent needs outbound HTTPS access to your BRIDGEPORT instance.
  5. Regenerate token: If the token is compromised or lost, use Regenerate Token to redeploy.
  • Check the Metrics Mode is not disabled.
  • Verify the scheduler is running (check BRIDGEPORT container logs for [Scheduler] messages).
  • For SSH mode, large collection intervals mean fewer data points. Decrease SCHEDULER_METRICS_INTERVAL for more granularity.

This typically means the metric value is genuinely stable. Check the Y-axis scale — it may be zoomed in to a narrow range.