diff --git a/apps/dokploy/components/dashboard/settings/servers/setup-monitoring.tsx b/apps/dokploy/components/dashboard/settings/servers/setup-monitoring.tsx
index 7aa33367a..3e4228608 100644
--- a/apps/dokploy/components/dashboard/settings/servers/setup-monitoring.tsx
+++ b/apps/dokploy/components/dashboard/settings/servers/setup-monitoring.tsx
@@ -244,8 +244,8 @@ export const SetupMonitoring = ({ serverId }: Props) => {
onValueChange={setSearch}
/>
No service found.
-
-
+
+ e.stopPropagation()}>
{availableServices?.map((service) => (
{
onValueChange={setSearchExclude}
/>
No service found.
-
-
+
+ e.stopPropagation()}>
{availableServicesToExclude.map((service) => (
{
try {
- const configJson = process.env.MONITORING_CONFIG;
+ const configJson = process.env.CONTAINER_MONITORING_CONFIG;
if (!configJson) {
return DEFAULT_CONFIG;
@@ -50,7 +50,7 @@ const loadConfig = (): MonitoringConfig => {
const config = loadConfig();
const REFRESH_RATE_CONTAINER = Number(
- process.env.CONTAINER_REFRESH_RATE || 8000,
+ process.env.CONTAINER_REFRESH_RATE || 10000,
);
interface Container {
diff --git a/apps/monitoring/src/monitoring/server.ts b/apps/monitoring/src/monitoring/server.ts
index f347fb85f..a34c62fb9 100644
--- a/apps/monitoring/src/monitoring/server.ts
+++ b/apps/monitoring/src/monitoring/server.ts
@@ -46,7 +46,7 @@ const getServerMetrics = async () => {
};
};
-const REFRESH_RATE_SERVER = Number(process.env.REFRESH_RATE_SERVER || 5000);
+const REFRESH_RATE_SERVER = Number(process.env.REFRESH_RATE_SERVER || 10000);
const MAX_FILE_SIZE_MB = Number(process.env.MAX_FILE_SIZE_MB || 10); // 10 MB por defecto
export const logServerMetrics = () => {
diff --git a/packages/server/src/setup/monitoring-setup.ts b/packages/server/src/setup/monitoring-setup.ts
index 9cc87e41f..e3a10fbed 100644
--- a/packages/server/src/setup/monitoring-setup.ts
+++ b/packages/server/src/setup/monitoring-setup.ts
@@ -12,7 +12,11 @@ export const setupMonitoring = async (serverId: string) => {
const settings: ContainerCreateOptions = {
name: containerName,
Env: [
- `REFRESH_RATE_SERVER=${server.refreshRateMetrics * 1000}`,
+ `REFRESH_RATE_SERVER=${server.serverRefreshRateMetrics * 1000}`,
+ `CONTAINER_REFRESH_RATE=${server.containerRefreshRateMetrics * 1000}`,
+ `CONTAINER_MONITORING_CONFIG=${JSON.stringify(
+ server?.containersMetricsDefinition,
+ )}`,
`PORT=${server.defaultPortMetrics}`,
],
Image: imageName,
@@ -31,6 +35,7 @@ export const setupMonitoring = async (serverId: string) => {
"/var/run/docker.sock:/var/run/docker.sock:ro",
"/sys:/host/sys:ro",
"/etc/os-release:/etc/os-release:ro",
+ "/etc/dokploy/monitoring:/etc/dokploy/monitoring",
// "/proc/cpuinfo:/proc/cpuinfo:ro",
// "/proc/cpuinfo:/host/proc/cpuinfo:ro",
],