Skip to content

Commit c233ddb

Browse files
authored
Merge pull request #3214 from Dokploy/3197-requests-page-started-showing-my-own-dashboard-requests
3197 requests page started showing my own dashboard requests
2 parents 1dc943e + 0cfe87c commit c233ddb

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

apps/dokploy/__test__/requests/request.test.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,22 @@ describe("processLogs", () => {
5454
const result = parseRawConfig(entryWithWhitespace);
5555
expect(result.data).toHaveLength(2);
5656
});
57+
58+
it("should filter out Dokploy dashboard requests", () => {
59+
const dokployDashboardEntry = `{"ClientAddr":"172.71.187.131:9485","ClientHost":"172.71.187.131","ClientPort":"9485","ClientUsername":"-","DownstreamContentSize":14550,"DownstreamStatus":200,"Duration":57681682,"OriginContentSize":14550,"OriginDuration":57612242,"OriginStatus":200,"Overhead":69440,"RequestAddr":"hostinger.dokploy.com","RequestContentSize":0,"RequestCount":20142,"RequestHost":"hostinger.dokploy.com","RequestMethod":"GET","RequestPath":"/_next/data/cb_zzI4Rp9G7Q7djrFKh0/en/dashboard/traefik.json","RequestPort":"-","RequestProtocol":"HTTP/2.0","RequestScheme":"https","RetryAttempts":0,"RouterName":"dokploy-router-app-secure@file","ServiceAddr":"dokploy:3000","ServiceName":"dokploy-service-app@file","ServiceURL":"http://dokploy:3000","StartLocal":"2025-12-10T05:10:41.957755949Z","StartUTC":"2025-12-10T05:10:41.957755949Z","TLSCipher":"TLS_AES_128_GCM_SHA256","TLSVersion":"1.3","entryPointName":"websecure","level":"info","msg":"","time":"2025-12-10T05:10:42Z"}`;
60+
61+
// Test with only Dokploy dashboard entry - should be filtered out
62+
const resultOnlyDokploy = parseRawConfig(dokployDashboardEntry);
63+
expect(resultOnlyDokploy.data).toHaveLength(0);
64+
expect(resultOnlyDokploy.totalCount).toBe(0);
65+
66+
// Test with mixed entries - Dokploy should be filtered, others should remain
67+
const mixedEntries = `${dokployDashboardEntry}\n${sampleLogEntry}`;
68+
const resultMixed = parseRawConfig(mixedEntries);
69+
expect(resultMixed.data).toHaveLength(1);
70+
expect(resultMixed.totalCount).toBe(1);
71+
expect(resultMixed.data[0]?.ServiceName).not.toBe(
72+
"dokploy-service-app@file",
73+
);
74+
});
5775
});

packages/server/src/utils/access-log/utils.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,11 @@ export function parseRawConfig(
9999
.compact()
100100
.value();
101101

102+
// Filter out Dokploy dashboard requests
103+
parsedLogs = parsedLogs.filter(
104+
(log) => log.ServiceName !== "dokploy-service-app@file",
105+
);
106+
102107
// Apply date range filter if provided
103108
if (dateRange?.start || dateRange?.end) {
104109
parsedLogs = parsedLogs.filter((log) => {

packages/server/src/utils/traefik/application.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ export const readMonitoringConfig = async (readAll = false) => {
162162
trimmed.endsWith("}")
163163
) {
164164
const log = JSON.parse(trimmed);
165+
// Exclude Dokploy service app and Dashboard requests
165166
if (log.ServiceName !== "dokploy-service-app@file") {
166167
content += `${line}\n`;
167168
validCount++;

0 commit comments

Comments
 (0)