Skip to content

Conversation

@JivusAyrus
Copy link
Member

@JivusAyrus JivusAyrus commented Aug 28, 2025

Summary by CodeRabbit

  • Bug Fixes

    • Improved accuracy of monthly request counts in analytics by aligning aggregation with the authoritative data source, resolving discrepancies seen in recent months.
    • Ensures totals and trends are consistent across dashboards and reports.
  • Chores

    • Updated backend query to use the current metrics source and aggregation field without changing public interfaces.

Checklist

  • I have discussed my proposed changes in an issue and have received approval to proceed.
  • I have followed the coding standards of the project.
  • Tests or benchmarks have been added or updated.
  • Documentation has been updated on https://github.com/wundergraph/cosmo-docs.
  • I have read the Contributors Guide.

@coderabbitai
Copy link

coderabbitai bot commented Aug 28, 2025

Walkthrough

The repository method that queries monthly request counts was updated to read from a new metrics table and aggregate a different column while keeping the alias and filtering logic unchanged.

Changes

Cohort / File(s) Summary of Changes
Analytics Repository
controlplane/src/core/repositories/analytics/MonthlyRequestViewRepository.ts
SQL updated: FROM table changed from operation_request_metrics_5_30 to gql_metrics_router_requests; aggregation changed from sum(TotalRequests) to sum(RequestCount). Alias totalRequests, WHERE clause, and result handling unchanged.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 5b323e7 and b6a5d78.

📒 Files selected for processing (1)
  • controlplane/src/core/repositories/analytics/MonthlyRequestViewRepository.ts (1 hunks)
🔇 Additional comments (1)
controlplane/src/core/repositories/analytics/MonthlyRequestViewRepository.ts (1)

12-13: Switch to RequestCount on gql_metrics_router_requests looks correct.

Column and table change aligns with the PR objective. Proceed once schema parity with the old source is confirmed (same granularity and semantics).

Would you run a quick one-off comparison in staging to ensure sum(RequestCount) over the same month matches the legacy query within expected deltas?

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbit in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbit in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbit gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbit read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbit help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbit ignore or @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbit summary or @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbit or @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@StarpTech StarpTech left a comment

Choose a reason for hiding this comment

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

LGTM

@JivusAyrus JivusAyrus merged commit 85e2b60 into main Aug 28, 2025
9 checks passed
@JivusAyrus JivusAyrus deleted the suvij/eng-8008-use-gql_metrics_router_requests-instead-of branch August 28, 2025 15:05
@Noroth Noroth mentioned this pull request Sep 30, 2025
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants