Skip to content

feat: structured logs /api/markets#549

Merged
greatest0fallt1me merged 1 commit into
Predictify-org:mainfrom
Opulencechuks:task/markets-logs-v7
Jul 26, 2026
Merged

feat: structured logs /api/markets#549
greatest0fallt1me merged 1 commit into
Predictify-org:mainfrom
Opulencechuks:task/markets-logs-v7

Conversation

@Opulencechuks

Copy link
Copy Markdown
Contributor

Closes #389

Description

This PR addresses the backend issue for the GrantFox FWC26 campaign (Stellar Wave) by implementing structured access logs on /api/markets with correlation IDs.

Changes Made

  • src/middleware/accessLog.ts: Updated the middleware logic to explicitly match the /api/markets route prefix and emit logs under the specific markets_access_log name. The logic correctly preserves correlation IDs utilizing the current priority chain and fallback mechanisms.
  • src/routes/markets/index.ts: Integrated the accessLog middleware at the top level of the router to guarantee all market routes are correctly logged with correlation IDs before rate-limiting or sub-routing.
  • tests/usersAccessLog.test.ts: Added focused unit tests validating the /api/markets path and verifying that the correct markets_access_log is emitted with correlation IDs and other necessary metadata.

Acceptance Criteria

  • Implementation matches the description.
  • Tests added and passing (with > 90% coverage on changed lines).
  • Code review approved.
  • Docs updated (inline comments matching the updated behaviors).

Technical Notes

  • Input boundaries validate correctly; exceptions generated throw a standardized error envelope as previously handled by the existing API routers.
  • Used correlation ID propagation correctly without modifying existing AsyncLocalStorage behavior.

@drips-wave

drips-wave Bot commented Jul 26, 2026

Copy link
Copy Markdown

@Opulencechuks Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@greatest0fallt1me

Copy link
Copy Markdown
Contributor

Merged via direct push to main (admin)

@greatest0fallt1me
greatest0fallt1me merged commit 2b254f1 into Predictify-org:main Jul 26, 2026
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.

Add structured logs on /api/markets (v7)

2 participants