Skip to content

feat(gs): add ALL_TRACES template for generic log queries#3757

Open
TaprootFreak wants to merge 3 commits into
developfrom
feature/gs-all-traces-template
Open

feat(gs): add ALL_TRACES template for generic log queries#3757
TaprootFreak wants to merge 3 commits into
developfrom
feature/gs-all-traces-template

Conversation

@TaprootFreak
Copy link
Copy Markdown
Collaborator

Summary

Adds a new ALL_TRACES = 'all-traces' template to /gs/debug/logs that returns all trace entries in the requested time window without requiring a messageFilter. Default limit is 500.

Why

The upcoming all-logs dashboard view in DFXswiss/services#1113 needs an unfiltered trace feed. The existing TRACES_BY_MESSAGE template requires a messageFilter and 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: add ALL_TRACES = 'all-traces' to LogQueryTemplate enum
  • src/subdomains/generic/gs/dto/gs.dto.ts: add ALL_TRACES entry to DebugLogQueryTemplates map

Self-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" passes
  • npx eslint "src/subdomains/generic/gs/**/*.ts" --no-fix passes
  • npx jest --testPathPattern 'gs.service' passes (29/29 tests)
  • npm run build passes
  • Manual smoke test on DEV: GET /gs/debug/logs?template=all-traces&hours=1 returns trace rows and excludes [GsService] Log query by audit lines
  • Dashboard consumer in DFXswiss/services wired up and validated against DEV

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).
…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.
@TaprootFreak TaprootFreak marked this pull request as ready for review May 23, 2026 17:09
@TaprootFreak TaprootFreak requested a review from davidleomay as a code owner May 23, 2026 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants