feat(gs): add ALL_TRACES template for generic log queries#3757
Open
TaprootFreak wants to merge 3 commits into
Open
feat(gs): add ALL_TRACES template for generic log queries#3757TaprootFreak wants to merge 3 commits into
TaprootFreak wants to merge 3 commits into
Conversation
Adds a new /gs/debug/logs template that returns all trace entries in the requested time window without a messageFilter. Default limit 500. Self-emitted audit lines from /gs/debug/logs (prefix "[GsService] Log query by ") are filtered at the template level to prevent the audit feedback loop that would otherwise dominate the result for any high-frequency caller (e.g. the upcoming all-logs dashboard view in DFXswiss/services).
9 tasks
…ntract The TRACES self-filter in the new ALL_TRACES template hardcoded the audit-log prefix emitted by gs.service.executeLogQuery. A refactor of either string would have silently broken the filter. Both sides now reference a shared LogQueryAuditPrefix constant from gs.dto.ts. The new spec verifies that the audit log and the template KQL stay in sync.
davidleomay
approved these changes
May 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new
ALL_TRACES = 'all-traces'template to/gs/debug/logsthat returns all trace entries in the requested time window without requiring amessageFilter. Default limit is 500.Why
The upcoming all-logs dashboard view in DFXswiss/services#1113 needs an unfiltered trace feed. The existing
TRACES_BY_MESSAGEtemplate requires amessageFilterand isn't suitable for a dashboard showing all recent traces.The dashboard consumer has no pre-filtering and processes more volume than
TRACES_BY_MESSAGE, hence the default limit of 500.What
src/subdomains/generic/gs/dto/log-query.dto.ts: addALL_TRACES = 'all-traces'toLogQueryTemplateenumsrc/subdomains/generic/gs/dto/gs.dto.ts: addALL_TRACESentry toDebugLogQueryTemplatesmapSelf-emitted audit lines from
/gs/debug/logs(prefix[GsService] Log query by) are filtered at the template level (in the KQL itself) to prevent the audit feedback loop that would otherwise dominate the result for any high-frequency caller.Test Plan
npx prettier --check "src/subdomains/generic/gs/**/*.ts"passesnpx eslint "src/subdomains/generic/gs/**/*.ts" --no-fixpassesnpx jest --testPathPattern 'gs.service'passes (29/29 tests)npm run buildpassesGET /gs/debug/logs?template=all-traces&hours=1returns trace rows and excludes[GsService] Log query byaudit lines