Skip to content

PAB-31: add direct Axiom log ingestion#113

Merged
pablopunk merged 2 commits into
mainfrom
agent/orchestrator/3e3eda97
Jul 13, 2026
Merged

PAB-31: add direct Axiom log ingestion#113
pablopunk merged 2 commits into
mainfrom
agent/orchestrator/3e3eda97

Conversation

@pablopunk

@pablopunk pablopunk commented Jul 13, 2026

Copy link
Copy Markdown
Owner

Summary

This PR adds direct log ingestion to Axiom from the backend, removing the dependency on a Vercel Log Drain. It uses the @axiomhq/js SDK to ship structured JSON logs to a configured Axiom dataset. Logs are first written to stdout (as before), then asynchronously ingested into Axiom in the background.

What was changed

  • Dependencies

    • Added @axiomhq/js for log ingestion.
    • Upgraded @vercel/functions to a version that provides the waitUntil lifecycle hook.
  • Logging library (backend/src/lib/log.ts)

    • Reads AXIOM_TOKEN, AXIOM_DATASET, and optional AXIOM_EDGE environment variables to initialize the Axiom client.
    • After each log event is printed to the console, it is also sent to Axiom via axiom.ingest().
    • Exposes a new flushLogs() function that flushes the SDK’s in‑memory batch of log events.
  • Astro middleware (backend/src/middleware.ts – new file)

    • Uses onRequest middleware to call waitUntil(flushLogs()) after every request.
    • This ensures all log events generated during a request are flushed to Axiom before the serverless function terminates, without adding latency to the HTTP response.
  • Documentation (backend/README.md)

    • Added a new Axiom logs section explaining the required environment variables and how the middleware interacts with Vercel’s waitUntil() to guarantee log delivery.

The backend continues to always write structured JSON to stdout; Axiom ingestion is an optional, additive layer.

Co-authored-by: multica-agent <github@multica.ai>
@vercel

vercel Bot commented Jul 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nvm Ready Ready Preview, Comment Jul 13, 2026 12:30pm

@kody-ai

kody-ai Bot commented Jul 13, 2026

Copy link
Copy Markdown

Kody Review Complete

Great news! 🎉
No issues were found that match your current review configurations.

Keep up the excellent work! 🚀

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the @kody start-review command at the root of your PR.

  • Validate Business Logic: Ask Kody to validate your code against business rules by adding a comment with the @kody -v business-logic command.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug
Performance
Security
Business Logic

Access your configuration settings here.

@socket-security

socket-security Bot commented Jul 13, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​vercel/​functions@​3.7.5991007499100
Added@​axiomhq/​js@​1.8.01001008495100

View full report

Co-authored-by: multica-agent <github@multica.ai>
@pablopunk
pablopunk merged commit 2057b1b into main Jul 13, 2026
10 checks passed
@pablopunk
pablopunk deleted the agent/orchestrator/3e3eda97 branch July 13, 2026 12:39
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.

1 participant