Skip to content

Conversation

@icecrasher321
Copy link
Collaborator

Summary

Fix failing build on staging.

Type of Change

  • Bug fix

@icecrasher321 icecrasher321 merged commit dd8f633 into staging Sep 23, 2025
4 of 5 checks passed
@vercel
Copy link

vercel bot commented Sep 23, 2025

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

Project Deployment Preview Comments Updated (UTC)
sim Building Building Preview Comment Sep 23, 2025 6:07pm
1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
docs Skipped Skipped Sep 23, 2025 6:07pm

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greptile Overview

Summary

This PR simplifies the OpenTelemetry initialization by removing the custom BatchSpanProcessor configuration and switching to the NodeSDK's built-in traceExporter approach. The change reduces complexity while maintaining the same telemetry functionality.

Key Changes:

  • Removed manual BatchSpanProcessor creation and custom batch settings configuration
  • Simplified NodeSDK initialization to use traceExporter directly instead of spanProcessors
  • Eliminated dependency on @opentelemetry/sdk-trace-node import

Minor Issues Found:

  • Batch settings in both config files are now unused and could be removed for cleaner configuration

Confidence Score: 4/5

  • This PR is safe to merge with minimal risk - it simplifies code without introducing functional changes
  • The changes are straightforward simplifications that maintain the same OpenTelemetry functionality while reducing complexity. The only minor issue is unused configuration options that don't affect runtime behavior.
  • No files require special attention - the changes are simple refactoring

Important Files Changed

File Analysis

Filename        Score        Overview
apps/sim/instrumentation-node.ts 4/5 Simplified OpenTelemetry initialization by removing custom BatchSpanProcessor and using NodeSDK's built-in trace exporter

Sequence Diagram

sequenceDiagram
    participant App as Application
    participant Reg as register()
    participant Sentry as Sentry Init
    participant OTel as OpenTelemetry Init
    participant SDK as NodeSDK
    participant Exporter as OTLPTraceExporter

    App->>Reg: Call register()
    Reg->>Sentry: await initializeSentry()
    Sentry-->>Reg: Sentry initialized (prod only)
    
    Reg->>OTel: await initializeOpenTelemetry()
    
    OTel->>OTel: Check NEXT_TELEMETRY_DISABLED
    alt Telemetry disabled
        OTel-->>Reg: Early return
    else Telemetry enabled
        OTel->>OTel: Dynamic import telemetry.config.ts
        OTel->>OTel: Check serverSide.enabled
        alt Server-side disabled
            OTel-->>Reg: Early return
        else Server-side enabled
            OTel->>OTel: Import OpenTelemetry modules
            OTel->>Exporter: Create OTLPTraceExporter
            OTel->>SDK: Create NodeSDK with traceExporter
            OTel->>SDK: sdk.start()
            SDK-->>OTel: SDK started
            OTel->>OTel: Setup shutdown handlers (SIGTERM, SIGINT)
            OTel-->>Reg: Initialization complete
        end
    end
    
    Reg-->>App: Registration complete
Loading

1 file reviewed, 2 comments

Edit Code Review Bot Settings | Greptile

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