-
Notifications
You must be signed in to change notification settings - Fork 33
Improve otel export for serverless #132
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
Draft
ben-fornefeld
wants to merge
16
commits into
main
Choose a base branch
from
improve-otel-export-for-serverless
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
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
This PR enhances OpenTelemetry logging by adding comprehensive Vercel deployment context to improve observability and debugging in serverless environments. ### Changes - **Enhanced resource attributes**: Added function to parse `OTEL_RESOURCE_ATTRIBUTES` environment variable for additional context - **Vercel environment integration**: Automatically captures and includes Vercel-specific environment variables in telemetry data: - Deployment environment (`VERCEL_ENV`) - URL configurations (`VERCEL_URL`, `VERCEL_PROJECT_PRODUCTION_URL`, `VERCEL_BRANCH_URL`) - Deployment metadata (`VERCEL_REGION`, `VERCEL_DEPLOYMENT_ID`) - Git context (`VERCEL_GIT_COMMIT_SHA`, `VERCEL_GIT_COMMIT_MESSAGE`, `VERCEL_GIT_COMMIT_AUTHOR_NAME`) - Repository information (`VERCEL_GIT_REPO_SLUG`, `VERCEL_GIT_REPO_OWNER`, `VERCEL_GIT_PROVIDER`) - **Environment validation**: Extended `env.ts` schema to validate new Vercel environment variables - **Universal support**: Applied changes to both Node.js and Edge runtime instrumentation ### Impact Provides richer context in logs and traces, making it easier to: - Correlate issues with specific deployments and environments - Debug problems across different Vercel environments (development, preview, production) - Track performance and errors by Git commits and deployment metadata - Improve incident response with better deployment visibility This enhancement builds upon the existing OpenTelemetry setup while maintaining backward compatibility and following Vercel's environment variable conventions. <!-- START COPILOT CODING AGENT SUFFIX --> <!-- START COPILOT CODING AGENT TIPS --> --- 💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more [Copilot coding agent tips](https://gh.io/copilot-coding-agent-tips) in the docs. Co-authored-by: copilot-swe-agent[bot] <[email protected]>
The commit changes the logging approach by separating log metadata from human-readable messages across many files. The key changes are: - Adds descriptive message text to all log calls - Moves metadata into a separate object parameter - Consistently structures log keys and metadata fields - Improves error logging with serialized errors Subject: Add structured logging with human-readable messages Body: Enhances logging by separating structured metadata from human-readable message text. Makes logs more useful for both automated processing and manual review. Adds consistent error serialization and metadata structure.
and help with flushing correctly
The latest updates on your projects. Learn more about Vercel for GitHub.
|
0782d75
to
7f2fe03
Compare
7f2fe03
to
6ac9b20
Compare
- Add VercelRuntimeSpanExporter for custom span exporting in Vercel - Use SimpleLogRecordProcessor instead of BatchLogRecordProcessor - Disable HTTP instrumentation by default - Enable nodeMiddleware in next.config.mjs - Upgrade OpenTelemetry core and SDK packages to latest compatible versions
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.
No description provided.