Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Aug 28, 2025

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.


💡 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 in the docs.

Copy link

vercel bot commented Aug 28, 2025

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

Project Deployment Preview Comments Updated (UTC)
web Ready Ready Preview Comment Aug 28, 2025 7:15pm
web-juliett Ready Ready Preview Comment Aug 28, 2025 7:15pm

@Copilot Copilot AI changed the title [WIP] analyze the changes from this branch to main of this repo and give me a pr title and description based on past prs and commits, in mardown codeblocks Improve: Add Vercel context to OpenTelemetry logs Aug 28, 2025
Copilot finished work on behalf of ben-fornefeld August 28, 2025 19:20
@Copilot Copilot AI requested a review from ben-fornefeld August 28, 2025 19:20
@ben-fornefeld ben-fornefeld marked this pull request as ready for review August 28, 2025 19:24
@ben-fornefeld ben-fornefeld merged commit 74b1e9f into feature-prometheus-metrics Aug 28, 2025
4 checks passed
@ben-fornefeld ben-fornefeld deleted the copilot/fix-e6babf4f-9fdb-4ade-918c-6d6129d6c18f branch August 28, 2025 19:24
ben-fornefeld pushed a commit that referenced this pull request Aug 29, 2025
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] <198982749+Copilot@users.noreply.github.com>
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