Skip to content

chore: test next-logger with pino#2973

Merged
eduardoformiga merged 8 commits intodevfrom
chore/structured-log-test
May 4, 2026
Merged

chore: test next-logger with pino#2973
eduardoformiga merged 8 commits intodevfrom
chore/structured-log-test

Conversation

@gabpaladino
Copy link
Copy Markdown
Member

@gabpaladino gabpaladino commented Aug 4, 2025

What's the purpose of this pull request?

This pull request introduces instrumentation and logging enhancements to the core package, primarily enabling experimental instrumentation hooks in Next.js and conditionally loading logging libraries in production node environments.

References

https://vercel.com/docs/environment-variables/system-environment-variables#VERCEL
https://nextjs.org/docs/app/guides/instrumentation
https://nextjs.org/docs/app/api-reference/file-conventions/instrumentation

@gabpaladino gabpaladino requested a review from a team as a code owner August 4, 2025 19:06
@gabpaladino gabpaladino requested review from emersonlaurentino and lucasfp13 and removed request for a team August 4, 2025 19:06
@codesandbox-ci
Copy link
Copy Markdown

codesandbox-ci Bot commented Aug 4, 2025

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@matheusps matheusps changed the base branch from main to dev October 27, 2025 17:30
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 24, 2026

Warning

Rate limit exceeded

@eduardoformiga has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 39 minutes and 56 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 56d76413-fe91-4aaf-b28c-e7810a00351f

📥 Commits

Reviewing files that changed from the base of the PR and between 054d086 and 9228268.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml and included by none
📒 Files selected for processing (2)
  • packages/core/package.json
  • packages/core/src/instrumentation.ts

Walkthrough

This PR adds instrumentation and logging support to FastStore core by enabling Next.js's experimental instrumentation hook, adding the Pino logging dependency, and implementing a conditional registration function that loads Pino and next-logger in production Node.js environments outside of Vercel.

Changes

Instrumentation Setup

Layer / File(s) Summary
Configuration
packages/core/next.config.js
Enables experimentalInstrumentationHook: true in Next.js config to activate instrumentation hook processing.
Dependencies
packages/core/package.json
Adds pino (^9.7.0) as a production dependency for structured logging.
Implementation
packages/core/src/instrumentation.ts
Exports async register() function that conditionally requires pino and next-logger only when running in Node.js runtime, production environment, and not on Vercel platform.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

📝 A logger hooks in place,
Pino traces the production race,
Configuration unlocked with care,
Instrumentation meets the air! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'chore: test next-logger with pino' accurately describes the main changes: adding instrumentation configuration and dependencies to test next-logger with pino.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/structured-log-test

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 0/1 reviews remaining, refill in 39 minutes and 56 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

@eduardoformiga eduardoformiga changed the title test next-logger with pino chore: test next-logger with pino Apr 24, 2026
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Apr 24, 2026

Open in StackBlitz

@faststore/api

yarn add https://pkg.pr.new/vtex/faststore/@faststore/api@9228268.tgz

@faststore/cli

yarn add https://pkg.pr.new/vtex/faststore/@faststore/cli@9228268.tgz

@faststore/components

yarn add https://pkg.pr.new/vtex/faststore/@faststore/components@9228268.tgz

@faststore/core

yarn add https://pkg.pr.new/vtex/faststore/@faststore/core@9228268.tgz

@faststore/graphql-utils

yarn add https://pkg.pr.new/vtex/faststore/@faststore/graphql-utils@9228268.tgz

@faststore/lighthouse

yarn add https://pkg.pr.new/vtex/faststore/@faststore/lighthouse@9228268.tgz

@faststore/sdk

yarn add https://pkg.pr.new/vtex/faststore/@faststore/sdk@9228268.tgz

@faststore/ui

yarn add https://pkg.pr.new/vtex/faststore/@faststore/ui@9228268.tgz

commit: 9228268

@eduardoformiga eduardoformiga force-pushed the chore/structured-log-test branch from 32d5700 to ccecd25 Compare April 24, 2026 18:40
…larity

- Introduced boolean variables for runtime checks: isNodeRuntime, isProduction, and isVercel.
- Updated the conditional logic in the register function to enhance readability and maintainability.
- Updated "@faststore/core", "@faststore/graphql-utils", and "@faststore/lighthouse" to version 3.99.0-dev.4 in pnpm-lock.yaml.
- Updated "next-logger" to version 5.0.2 in package.json.
- Adjusted peer dependencies and integrity checks accordingly.
- Simplified the runtime checks by removing unnecessary boolean variables.
- Enhanced readability by directly using environment variables in the conditional statements.
@eduardoformiga eduardoformiga merged commit dd714ca into dev May 4, 2026
6 of 7 checks passed
@eduardoformiga eduardoformiga deleted the chore/structured-log-test branch May 4, 2026 19:03
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