feat(logs): filter out Dokploy dashboard requests from logs processing

- Added a test case to ensure Dokploy dashboard requests are filtered out correctly.
- Updated the logs processing logic to exclude both Dokploy service app and dashboard requests, improving log clarity and relevance.
This commit is contained in:
Mauricio Siu
2025-12-09 23:16:04 -06:00
parent 9e20f66bf5
commit 7998b296a2
3 changed files with 22 additions and 12 deletions

View File

@@ -27,10 +27,6 @@ export function processLogs(
if (log.ServiceName === "dokploy-service-app@file") {
return null;
}
// Exclude Dashboard requests - they start with /dashboard
if (log.RequestPath?.startsWith("/dashboard")) {
return null;
}
const date = new Date(log.StartUTC);
if (dateRange?.start || dateRange?.end) {
@@ -101,12 +97,13 @@ export function parseRawConfig(
}
})
.compact()
.filter((log) => {
// Exclude Dashboard requests - they start with /dashboard
return !log.RequestPath?.startsWith("/dashboard");
})
.value();
// Filter out Dokploy dashboard requests
parsedLogs = parsedLogs.filter(
(log) => log.ServiceName !== "dokploy-service-app@file",
);
// Apply date range filter if provided
if (dateRange?.start || dateRange?.end) {
parsedLogs = parsedLogs.filter((log) => {

View File

@@ -163,10 +163,7 @@ export const readMonitoringConfig = async (readAll = false) => {
) {
const log = JSON.parse(trimmed);
// Exclude Dokploy service app and Dashboard requests
if (
log.ServiceName !== "dokploy-service-app@file" &&
!log.RequestPath?.startsWith("/dashboard")
) {
if (log.ServiceName !== "dokploy-service-app@file") {
content += `${line}\n`;
validCount++;
if (validCount >= 500) {