Skip to content

Service Monitoring

BRIDGEPORT collects container-level metrics (CPU, memory, network I/O, and block I/O) for every discovered Docker service, visualizes them in time-series charts, and tracks restart counts to help you spot unstable containers.

  1. Ensure the server running your containers has metrics enabled (SSH or agent mode).
  2. Verify the service has discoveryStatus: found (auto-discovered or manually created and linked to a running container).
  3. Navigate to Monitoring > Services to see container metrics.
sequenceDiagram
    participant A as Agent
    participant D as Docker Daemon
    participant BP as BRIDGEPORT
    participant DB as SQLite

    A->>D: docker stats (API)
    D-->>A: Per-container metrics
    A->>BP: POST /api/metrics/ingest<br/>{services: [...]}
    BP->>BP: Match containerName → Service
    BP->>DB: Save ServiceMetrics rows
    BP->>DB: Update Service status

The agent runs docker stats via the Docker API, collects per-container metrics, and includes them in its periodic push to /api/metrics/ingest. BRIDGEPORT matches each entry by containerName to its corresponding Service record.

MetricFieldUnitDescription
CPUcpuPercent%Container CPU usage percentage
Memory UsedmemoryUsedMbMBCurrent memory consumption
Memory LimitmemoryLimitMbMBContainer memory limit (from Docker)
Network RXnetworkRxMbMBCumulative data received
Network TXnetworkTxMbMBCumulative data transmitted
Block ReadblockReadMbMBCumulative disk reads
Block WriteblockWriteMbMBCumulative disk writes
Restart CountrestartCountcountTotal container restarts

In addition to metrics, the agent reports each container’s state and Docker health status on every push:

StateHealthOverall Status
runninghealthyhealthy
runningunhealthyunhealthy
runningnone (no healthcheck)running
exited / deadstopped
otherunknown

BRIDGEPORT updates each service’s containerStatus, healthStatus, and status fields based on this data.

Navigate to Monitoring > Services (/monitoring/services).

  • CPU Usage — Per-container CPU percentage over time
  • Memory Usage — Memory consumption vs limit
  • Network RX — Received bytes over time
  • Network TX — Transmitted bytes over time

Each chart shows data grouped by service, with the server name displayed for context.

Use the time range selector to pick a window:

RangeDescription
1hRecent activity, good for debugging
6hShort-term trend
24hDaily pattern
7dWeekly trend (max retention)

Charts auto-refresh every 30 seconds. The toggle is in the top-right corner of the monitoring page.

The services metrics history endpoint filters to services with discoveryStatus: found in the current environment, so you only see actively running containers.

  1. Go to Servers and select the server running your containers.
  2. Set Metrics Mode to agent.
  3. Wait for agent status to become active (usually under 30 seconds).
  4. Go to Monitoring > Services. Container metrics appear on the next agent push.

In SSH mode, BRIDGEPORT collects:

  • Container health status (running/stopped, Docker health)
  • Container state transitions (crash detection)
  • URL health check results (if configured)

It does not collect per-container CPU/memory/network metrics in SSH mode. For those, use agent mode.

  1. Go to Servers and select the server.
  2. Set Metrics Mode to ssh.
  3. Container health data appears in Monitoring > Services after the next collection cycle.

The agent pushes metrics approximately every 15 seconds. This is not currently configurable per-environment — it is built into the agent binary.

Service metrics follow the same retention settings as server metrics:

SettingDefaultWhere
METRICS_RETENTION_DAYS7 daysGlobal env var (see Configuration Reference)

The scheduler cleans up old ServiceMetrics rows hourly.

Configure a URL health check per service to get richer health data:

  1. Go to the service detail page.
  2. Set the Health Check URL field (e.g., http://localhost:8080/health).
  3. The agent (or SSH collector) curls this URL and reports the result.
  1. Check agent status: Go to Monitoring > Agents & SSH. Status should be active.
  2. Verify container names match: The agent matches metrics by containerName. If the service’s containerName in BRIDGEPORT does not match the Docker container name, metrics will not be linked.
  3. Check discovery status: The service must have discoveryStatus: found. Run container discovery from the server detail page if needed.
  • Verify the time range includes the period when metrics were collected.
  • Check that the service belongs to the currently selected environment.

This means Docker is restarting the container. Check:

  1. Container logs: Use the Logs action on the service to see why it is crashing.
  2. Memory limits: If memoryUsedMb is near memoryLimitMb, the container may be OOM-killed.
  3. Health check: If the container has a Docker HEALTHCHECK and it keeps failing, Docker may restart it.

This happens when BRIDGEPORT cannot determine the container state:

  • The server may be unreachable (check server health first).
  • The container may have been removed but the service record still exists. Run container discovery to update statuses.