Skip to content

feat: add project filter to free monitoring dashboard - #5003

Open
sagarchhetribird wants to merge 2 commits into
Dokploy:canaryfrom
sagarchhetribird:feat/project-monitoring-filter
Open

feat: add project filter to free monitoring dashboard#5003
sagarchhetribird wants to merge 2 commits into
Dokploy:canaryfrom
sagarchhetribird:feat/project-monitoring-filter

Conversation

@sagarchhetribird

@sagarchhetribird sagarchhetribird commented Aug 7, 2026

Copy link
Copy Markdown

Summary

  • Adds a project filter dropdown on the free Monitoring page (default: All Server)
  • When a project is selected, shows live aggregated CPU / memory / block / network usage for that project's running containers
  • Includes a per-service breakdown table; host-only Disk / Docker Disk cards are hidden in project view
  • New project.resourceStats tRPC endpoint (monitoring:read) with org/member access checks

Test plan

  • Open /dashboard/monitoring and confirm All Server view still shows host CPU/memory/disk charts
  • Use the project dropdown and select a project with running services
  • Confirm aggregated metrics update and services breakdown lists services with container counts
  • Confirm Disk Space / Docker Disk Usage cards are hidden in project view
  • Select an empty project and confirm zeroed metrics / empty or zero-container services
  • Confirm unauthenticated/unauthorized access to project.resourceStats is rejected
  • Confirm services breakdown does not show a loading spinner while polling

Greptile Summary

The PR adds project-scoped monitoring to the free dashboard, including aggregated live metrics and a per-service breakdown.

  • Adds a project selector and switches between host and project monitoring views.
  • Adds an authorized project.resourceStats endpoint.
  • Collects container statistics per local or remote server and attributes them to project services.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Reviews (3): Last reviewed commit: "fix: tighten project monitoring containe..." | Re-trigger Greptile

Context used:

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@dosubot dosubot Bot added the size:XL This PR changes 500-999 lines, ignoring generated files. label Aug 7, 2026
Comment on lines +217 to +225
return (
name === appName ||
name.startsWith(`${appName}.`) ||
name.startsWith(`${appName}_`) ||
name.startsWith(`${appName}-`) ||
name.includes(`/${appName}`) ||
name.includes(`_${appName}_`) ||
name.includes(`.${appName}.`)
);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 security Ambiguous container ownership matching

When service app names have a delimiter-separated prefix relationship such as myapp and myapp-api, the broad prefix checks assign the longer-named service's container to the first matching shorter name, causing incorrect project totals and potentially exposing another project's live resource metrics. How this was verified: The matcher accepts prefix-related names, selects the first match, and processes daemon-wide container statistics.

Knowledge Base Used: Monitoring and Live Terminal/Log Streaming

): Promise<ProjectResourceStats> => {
const project = await findProjectById(projectId);
const services = collectProjectServices(project, options?.accessedServices);
const containers = (await getAllContainerStats()) as Container[];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Remote service statistics omitted

When a project has services deployed to remote servers, calling getAllContainerStats() without their serverId queries only the local Docker daemon, causing those services to show zero containers and zero resource usage and producing incomplete project totals.

Knowledge Base Used: Monitoring and Live Terminal/Log Streaming

@sagarchhetribird
sagarchhetribird force-pushed the feat/project-monitoring-filter branch from 805085d to 784d6e9 Compare August 7, 2026 07:15
Allow filtering server monitoring by project to show aggregated
CPU/memory/I/O usage and a per-service breakdown for that project's
running containers.
@sagarchhetribird
sagarchhetribird force-pushed the feat/project-monitoring-filter branch from 784d6e9 to d5ba58f Compare August 7, 2026 07:16
Prefer exact/longest delimiter-bounded appName matches and collect
docker stats from each service's server so remote deployments are
included and prefix collisions cannot misattribute usage.
@sagarchhetribird

Copy link
Copy Markdown
Author

Addressed the Greptile findings:

  1. Container ownership — matching now uses exact appName or delimiter-bounded Swarm/Compose forms (appName.*, appName_*). Hyphen prefixes were removed so myapp cannot claim myapp-api. When multiple services match, the longest appName wins.
  2. Remote servers — stats are fetched per unique service serverId (local + remote) and containers are only attributed to services on the same server.

@greptile-apps

greptile-apps Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Want your agent to iterate on Greptile's feedback? Try greploops.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant