-
-
Notifications
You must be signed in to change notification settings - Fork 8
feat: add log sampling with configurable rates #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Thank you for following the naming conventions! 🙏 |
commit: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Adds configurable log sampling (percentage-based per log level) to reduce log volume, and wires the configuration through the Nuxt/Nitro integration and documentation.
Changes:
- Introduces
SamplingConfig/SamplingRatestypes and exposes them from the public API. - Implements per-level head sampling in the server logger and passes sampling config through the Nitro plugin.
- Adds docs + README updates and Vitest coverage for sampling scenarios.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/evlog/src/logger.ts | Adds sampling logic (shouldSample) and applies it when emitting wide events. |
| packages/evlog/src/types.ts | Defines SamplingConfig/SamplingRates and adds sampling to LoggerConfig. |
| packages/evlog/src/index.ts | Re-exports sampling types from the package entrypoint. |
| packages/evlog/src/nuxt/module.ts | Extends Nuxt module options to accept sampling. |
| packages/evlog/src/nitro/plugin.ts | Plumbs runtime sampling config into initLogger(). |
| packages/evlog/test/logger.test.ts | Adds sampling-focused unit tests (0%, 100%, default error behavior, probabilistic sampling). |
| apps/docs/content/1.getting-started/2.installation.md | Documents Nuxt sampling configuration and explains default error behavior. |
| README.md | Updates usage/config examples to include sampling. |
| AGENTS.md | Updates Nuxt configuration example/options table to include sampling. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This pull request introduces a new log sampling feature to the logging system, allowing users to configure what percentage of logs are kept per log level (info, warn, debug, error).
The sampling configuration is now supported throughout the logger, Nuxt, and Nitro integrations, and is fully documented and tested.
By default, error logs are always kept unless explicitly configured otherwise. This helps reduce log volume at scale while ensuring important logs are retained.