Skip to content
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

fix:improve_metrics_reporting #664

Merged
merged 1 commit into from
Mar 13, 2025
Merged

fix:improve_metrics_reporting #664

merged 1 commit into from
Mar 13, 2025

Conversation

JarbasAl
Copy link
Member

@JarbasAl JarbasAl commented Mar 13, 2025

ensure data is a json payload

Summary by CodeRabbit

  • New Features

    • Enhanced intent matching by collecting metrics for both recognized interactions and unhandled cases, delivering more accurate performance insights.
  • Documentation

    • Updated user-facing documentation to reflect the new metrics upload endpoint.

ensure data is a json payload
Copy link

coderabbitai bot commented Mar 13, 2025

Walkthrough

This pull request updates the intent matching process by enhancing metric reporting within the IntentService. It adds two distinct calls to _upload_match_data in the _emit_match_message method to handle both PipelineMatch and IntentHandlerMatch cases while relocating the unmatched case into an else block. The _upload_match_data method is now a static method with explicit type annotations and serializes the match_data using JSON. Documentation is updated to reflect the new server URL for metrics uploading.

Changes

File Change Summary
ovos_core/intent_services/init.py Updated _emit_match_message to add two new calls to _upload_match_data for handling PipelineMatch and IntentHandlerMatch. Moved the unmatched call into an else block. Converted _upload_match_data to a static method, added explicit types, serialized match_data with JSON, and updated documentation.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant IntentService
    participant MetricsServer

    Client->>IntentService: Send utterance
    IntentService->>IntentService: Check match type
    alt PipelineMatch
        IntentService->>IntentService: Call _upload_match_data (PipelineMatch)
    else IntentHandlerMatch
        IntentService->>IntentService: Call _upload_match_data (IntentHandlerMatch)
    else No Match
        IntentService->>IntentService: Call _upload_match_data (unmatched)
    end
    IntentService->>MetricsServer: Upload JSON serialized metrics data
Loading

Possibly related PRs

  • feat:opendata upload #660: Introduced the original _upload_match_data method, which is directly modified in the current changes.

Suggested labels

feature

Poem

I hopped through lines of code so bright,
With metrics and matches dancing in the light.
Pipeline or handler, each call is grand,
JSON strings prance across the land.
In every byte I see a joyful scene,
A rabbit cheers for updates so keen! 🐰
Hoppy coding to all, let’s keep it serene!

Tip

⚡🧪 Multi-step agentic review comment chat (experimental)
  • We're introducing multi-step agentic chat in review comments. This experimental feature enhances review discussions with the CodeRabbit agentic chat by enabling advanced interactions, including the ability to create pull requests directly from comments.
    - To enable this feature, set early_access to true under in the settings.

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0d98857 and bfdc51b.

📒 Files selected for processing (1)
  • ovos_core/intent_services/__init__.py (4 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: end2end_tests (3.11)
🔇 Additional comments (7)
ovos_core/intent_services/__init__.py (7)

15-15: Import added for JSON serialization

The addition of the json module import is necessary to support the JSON serialization of match data in the _upload_match_data method.


316-321: Improved metrics collection for PipelineMatch

Good addition of metrics collection for successful PipelineMatch cases. This enhances the system's ability to gather data about successfully matched intents, providing more comprehensive metrics for analysis.


329-334: Improved metrics collection for IntentHandlerMatch

Good addition of metrics collection for IntentHandlerMatch cases. Similar to the PipelineMatch addition, this ensures that metrics are captured for all types of successful matches, not just failures.


359-359: Restructured unmatched case logic

The code has been restructured to clarify that metrics upload for "complete_intent_failure" now occurs in an else block, making the flow more logical and easier to follow.


365-366: Improved method signature with type annotations

Converting _upload_match_data to a static method is appropriate since it doesn't use instance variables. The addition of type annotations enhances code readability and helps with static type checking.


372-372: Updated documentation reference

The documentation URL has been updated to point to the GitHub repository for the OpenVoiceOS open data server, providing users with the correct reference for more information.


386-386: Improved data serialization for metrics

The change to serialize match_data using JSON ensures that complex objects are properly converted to a format that can be transmitted as part of the HTTP request. Using ensure_ascii=False also helps with preserving non-ASCII characters.

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 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.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai 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:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @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

Documentation and Community

  • 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.

@github-actions github-actions bot added fix and removed fix labels Mar 13, 2025
Copy link

codecov bot commented Mar 13, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.59%. Comparing base (23f0bab) to head (bfdc51b).
Report is 214 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #664      +/-   ##
==========================================
- Coverage   75.33%   69.59%   -5.75%     
==========================================
  Files          15       15              
  Lines        3094     1674    -1420     
==========================================
- Hits         2331     1165    -1166     
+ Misses        763      509     -254     
Flag Coverage Δ
end2end 53.70% <100.00%> (?)
unittests 46.05% <60.00%> (-29.29%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@JarbasAl JarbasAl merged commit 52c6851 into dev Mar 13, 2025
6 of 8 checks passed
@JarbasAl JarbasAl deleted the fix/metricss branch March 13, 2025 05:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant