Skip to content

Conversation

@oasisk
Copy link
Contributor

@oasisk oasisk commented Nov 28, 2025

No description provided.

@github-actions
Copy link
Contributor

Failed to generate code suggestions for PR

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Nov 28, 2025

Greptile Overview

Greptile Summary

Migrated service graph configuration from main config module to enterprise config module. The ServiceGraph struct (33 lines) was removed from src/config/src/config.rs, and all references were updated to use o2_enterprise::enterprise::common::config::get_config().service_graph instead of cfg.service_graph.

  • Removed ServiceGraph struct and field from main Config in config.rs
  • Updated service graph initialization check in main.rs
  • Updated trace ingestion service graph check in service/traces/mod.rs
  • Updated API stats endpoint to use enterprise config in service/traces/service_graph/api.rs

This change correctly consolidates enterprise-feature configuration under the enterprise module, improving code organization and maintaining feature flag separation.

Confidence Score: 5/5

  • This PR is safe to merge - straightforward refactoring with consistent patterns
  • Clean config migration with no logic changes - all service graph config references consistently moved from main config to enterprise config module, following the existing pattern used by other enterprise features
  • No files require special attention

Important Files Changed

File Analysis

Filename Score Overview
src/config/src/config.rs 5/5 Removed ServiceGraph config struct and field from main Config struct - clean removal with no issues
src/main.rs 5/5 Updated service graph initialization to use enterprise config instead of main config - correct enterprise pattern
src/service/traces/mod.rs 5/5 Updated service graph check to use enterprise config - consistent with other enterprise features
src/service/traces/service_graph/api.rs 5/5 Updated stats endpoint to use enterprise config for enabled field - maintains API consistency

Sequence Diagram

sequenceDiagram
    participant App as Application
    participant MainConfig as config::get_config()
    participant EntConfig as o2_enterprise::...::get_config()
    participant ServiceGraph as Service Graph Module

    Note over App,ServiceGraph: Before PR (Old Pattern)
    App->>MainConfig: Check cfg.service_graph.enabled
    MainConfig-->>App: Returns bool
    App->>ServiceGraph: Initialize if enabled

    Note over App,ServiceGraph: After PR (New Pattern)
    App->>EntConfig: Check .service_graph.enabled
    EntConfig-->>App: Returns bool
    App->>ServiceGraph: Initialize if enabled
    
    Note over MainConfig,EntConfig: Config Migration
    Note over MainConfig: ServiceGraph struct removed
    Note over EntConfig: ServiceGraph config now here
Loading

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.

4 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@oasisk oasisk force-pushed the chore-move-service-graph-config branch 3 times, most recently from ad52b1a to f76cd4f Compare November 28, 2025 13:04
@oasisk oasisk force-pushed the chore-move-service-graph-config branch from f76cd4f to 65a416d Compare November 28, 2025 14:38
@oasisk oasisk merged commit e0aef96 into main Nov 28, 2025
37 checks passed
@oasisk oasisk deleted the chore-move-service-graph-config branch November 28, 2025 16:49
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.

3 participants