feat(md-exports): Add Sentry tracing for build observability#16081
Open
feat(md-exports): Add Sentry tracing for build observability#16081
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
5224c52 to
fa9e6b4
Compare
Add Sentry instrumentation to track markdown generation performance: - Initialize Sentry in main thread with build environment context - Wrap entire generation process in a traced span - Record cache metrics using the new Sentry metrics API: - md_export.cache_hit_rate (gauge, percent) - md_export.cache_hits (count) - md_export.cache_misses (count) - md_export.files_total (gauge) - Aggregate and log overall cache stats - Flush Sentry before exit to ensure data is sent This enables monitoring cache hit rates across builds to verify the stability improvements from the cache key fix. Co-Authored-By: Claude <noreply@anthropic.com>
fa9e6b4 to
bc15adf
Compare
Contributor
|
@BYK - still working on this? Looks like the builds are failing due to an incompatibility error |
@sentry/node is not a direct dependency, so pnpm's strict isolation prevents importing it on Vercel. @sentry/nextjs re-exports the Node APIs when running in a Node environment. Co-Authored-By: Claude <noreply@anthropic.com>
- Revert @sentry/nextjs back to @sentry/node (avoids worker thread issues) - Add @sentry/node as direct dependency - Replace Sentry.metrics.increment with Sentry.metrics.count (increment doesn't exist) - Update all Sentry packages to 10.42.0 Co-Authored-By: Claude <noreply@anthropic.com>
Contributor
|
@BYK Looks like there are still some errors. Want help with resolving, or still able to take on moving this branch forward? |
Member
|
im taking a look to resolve those errors, stay tuned |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
…s in workers Replace the static import with a conditional dynamic import so worker threads get a lightweight no-op stub instead of loading the full SDK and OpenTelemetry. Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds Sentry instrumentation to the markdown generation build script to track cache performance.
Changes
generate-md-exports)cache.hits- number of cache hitscache.misses- number of cache missescache.hit_rate- ratio of hits to totalfiles.total- total files processedWhy
This enables monitoring cache hit rates across builds to verify that the cache key stability fix from #16079 is working correctly. We can now track: