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

Implement ngt Statistics API #2539

Merged
merged 2 commits into from
Jul 26, 2024
Merged

Implement ngt Statistics API #2539

merged 2 commits into from
Jul 26, 2024

Conversation

kpango
Copy link
Collaborator

@kpango kpango commented Jul 25, 2024

Description

Summary

This pull request introduces several significant updates and enhancements, primarily focusing on adding new API functionalities for index statistics and improving observability metrics.

The _test.go and pb.go diffs are just re-generated please ignore them.

Changes

  1. Protobuf Updates:

    • Added Info.Index.Statistics to apis/proto/v1/payload/payload.proto.
    • Introduced IndexStatistics and IndexStatisticsDetail APIs in apis/proto/v1/vald/index.proto to return Info.Index.Statistics.
  2. Handler Implementations:

    • Implemented IndexStatistics and IndexStatisticsDetail API handlers in pkg/gateway/lb/handler/grpc/handler.go.
    • Added the same API handlers in pkg/agent/core/ngt/service/ngt.go.
  3. Algorithm Enhancements:

    • Added GraphStatistics struct and GetGraphStatistics(m statisticsType) (stats *GraphStatistics, err error) function in internal/core/algorithm/ngt/ngt.go to enable retrieval of index statistics.
    • Incorporated logic to obtain GraphStatistics post CreateIndex based on options in pkg/agent/core/ngt/service/ngt.go.
  4. Metrics Export:

    • Added export processing for GraphStatistics metrics in internal/observability/metrics/agent/core/ngt/ngt.go.
    • Introduced type aliases for Int64ObservableGauge and Float64ObservableGauge in internal/observability/metrics/metrics.go.
  5. Configuration and Formatting:

    • Updated .github/workflows/format.yml to add ignore settings for Format and license.
    • Enhanced Makefile under format/go to include formatting of artifacts generated from Proto.

Additional Notes

  • These changes enhance the functionality of the Vald project by providing detailed index statistics, which are crucial for monitoring and performance tuning.
  • The observability improvements will facilitate better metric tracking and reporting, contributing to overall system stability and performance.

Related Issue

Versions

  • Go Version: 1.22.5
  • Rust Version: 1.77.2
  • Docker Version: 20.10.8
  • Kubernetes Version: v1.30.3
  • NGT Version: 2.2.3

Checklist

Special notes for your reviewer

@vdaas-ci
Copy link
Collaborator

[CHATOPS:HELP] ChatOps commands.

  • 🙆‍♀️ /approve - approve
  • 🍱 /format - format codes and add licenses
  • /gen-test - generate test codes
  • 🏷️ /label - add labels
  • 🔚 2️⃣ 🔚 /label actions/e2e-deploy - run E2E deploy & integration test

@vdaas-ci
Copy link
Collaborator

[WARNING:INTCFG] Changes in interal/config may require you to change Helm charts. Please check.

Copy link
Contributor

coderabbitai bot commented Jul 25, 2024

Important

Review skipped

More than 25% of the files skipped due to max files limit. The review is being skipped to prevent a low-quality review.

94 files out of 263 files are above the max files limit of 50. Please upgrade to Pro plan to get higher limits.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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 as 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 resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

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.

Copy link

codecov bot commented Jul 25, 2024

Codecov Report

Attention: Patch coverage is 0.83333% with 357 lines in your changes missing coverage. Please review.

Project coverage is 17.56%. Comparing base (76eb8d7) to head (4d9ae3e).
Report is 4 commits behind head on main.

Files Patch % Lines
apis/grpc/v1/payload/payload.pb.go 0.48% 205 Missing ⚠️
internal/core/algorithm/ngt/ngt.go 0.00% 62 Missing ⚠️
internal/client/v1/client/vald/vald.go 0.00% 42 Missing ⚠️
apis/grpc/v1/vald/index_vtproto.pb.go 0.00% 40 Missing ⚠️
apis/grpc/v1/payload/payload.pb.json.go 0.00% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2539      +/-   ##
==========================================
- Coverage   18.43%   17.56%   -0.88%     
==========================================
  Files         566      566              
  Lines       66342    68910    +2568     
==========================================
- Hits        12232    12104     -128     
- Misses      53320    55986    +2666     
- Partials      790      820      +30     

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

coderabbitai[bot]
coderabbitai bot previously approved these changes Jul 25, 2024
Copy link

cloudflare-workers-and-pages bot commented Jul 25, 2024

Deploying vald with  Cloudflare Pages  Cloudflare Pages

Latest commit: 4d9ae3e
Status: ✅  Deploy successful!
Preview URL: https://c7735d4b.vald.pages.dev
Branch Preview URL: https://feature-agent-ngt-statistics.vald.pages.dev

View logs

Copy link
Contributor

@vdaas-ci
Copy link
Collaborator

Profile Report

typevald-agent-ngtvald-lb-gatewayvald-discoverervald-manager-index
cpu
heap
other images

@kpango kpango dismissed stale reviews from coderabbitai[bot] and kmrmt via 33fd2fb July 26, 2024 03:13
@kpango kpango force-pushed the feature/agent/ngt-statistics-api branch from f5354cf to 33fd2fb Compare July 26, 2024 03:13
Signed-off-by: kpango <kpango@vdaas.org>
@kpango kpango merged commit 09258fb into main Jul 26, 2024
176 of 179 checks passed
@kpango kpango deleted the feature/agent/ngt-statistics-api branch July 26, 2024 06:36
vdaas-ci pushed a commit that referenced this pull request Jul 26, 2024
Signed-off-by: kpango <kpango@vdaas.org>
kpango added a commit that referenced this pull request Jul 26, 2024
Signed-off-by: kpango <kpango@vdaas.org>
Co-authored-by: Yusuke Kato <kpango@vdaas.org>
kpango added a commit that referenced this pull request Aug 8, 2024
fix: git add chart directory for release (#2356) (#2357)
[patch] release v1.7.11 (#2358)
:bookmark: :robot: Release v1.7.11 (#2360)
Change docker scan timeout longer (#2363) (#2364)
refactor code using golangci-lint (#2362) (#2365)
Create SECURITY.md (#2367) (#2368)
add commit hash build image (#2359) (#2371)
update docker build target platform selection rules (#2370) (#2374)
Make agent export index metrics to Pod k8s resource (#2319) (#2372)
backport ci deps others (#2386)
Update workflow to release readreplica chart (#2383) (#2387)
:green_heart: :recycle: Add Con-Bench helm chart to the Vald charts (#2388) (#2389)
Delete unnecessary code for mirror (#2366) (#2391)
change JP logo to EN logo (#2369) (#2392)
Add rotate-all option to rotator (#2305) (#2393)
fix: build error of internal kvs test (#2396) (#2398)
Resolve kvs already closed before last saving (#2390) (#2394)
:robot: Update license headers / Format Go codes and YAML files (#2397) (#2400)
create continous benchmark doc (#2352) (#2395)
fix: disable protobuf dispatch for client (#2401) (#2403)
update deps (#2404) (#2405)
[patch] release v1.7.12 (#2406)
:bookmark: :robot: Release v1.7.12 (#2408)
:pencil: Fix typo of file name (#2413) (#2415)
Fix agent-faiss build failed (#2418) (#2419)
Add tests for index information export (#2412) (#2414)
Fix the logic to determine docker image (#2410) (#2420)
Update build rule for nightly image (#2421) (#2422)
Fix output settings to determine-docker-image-tag action and release branch build tag name (#2423) (#2425)
Add `index-operator` template implementation (#2375) (#2424)
fix: typo of execution rule (#2426) (#2427)
Backport Flush API (#2434)
update deps & add validation for Flush API when agent is Read Only (#2433) (#2436)
docs: add hrichiksite as a contributor for doc (#2441) (#2442)
fix: bugfix version update for docker build (#2445) (#2446)
Fix index job logic to pass DNS A record (#2438) (#2448)
Added snapshot timestamp annotations to read replica agent (#2428) (#2443)
Fix operator-sdk version (#2447) (#2449)
add file name lint (#2417) (#2450)
fix: add extra option for ci-container build (#2451) (#2452)
Add base of benchmark operator dashboard (#2430) (#2453)
Implement index operator logic for read replica rotation (#2444) (#2456)
add inner product distance type for ngt (#2454) (#2458)
Fix e2e for read replica and add e2e for index operator (#2455) (#2459)
Add unit tests for index operator (#2460) (#2461)
Bugfix recreate benchmark job when operator reboot (#2463) (#2464)
Refactor k8s types (#2462) (#2465)
:robot: Automatically update PULL_REQUEST_TEMPLATE and ISSUE_TEMPLATE (#2457) (#2469)
Fix workflow trigger for backport pr creation (#2471) (#2472)
Automatically add backport main label for release-pr (#2473) (#2475)
update deps (#2468) (#2476)
Implement client metrics interceptor for continuous benchmark job (#2477) (#2480)
:chart_with_upwards_trend: Add client metrics panels for continuous benchmark job (#2481) (#2483)
Update continuous benchmark docs (#2485) (#2486)
Sync release/v1.7 to main (#2495)
add read replica and rotator docs (#2497) (#2499)
add reviewer guideline (#2507) (#2508)
update large top-K ratio handling logic (#2509) (#2511)
Change default image tag from latest to nightly (#2516) (#2518)
Bugfix that caused an error when argument has 3 or more nil arguments (#2517) (#2520)
add faiss in values.yaml & valdrelease.yaml (#2514) (#2519)
capitalize faq (#2512) (#2522)
Backport docs updates to release/v1.7 (#2521)
[CI] Add workflow to synchronize ubuntu base image (#2526) (#2527)
fix: update schedule (#2528) (#2530)
refactor index manager service add index service API to expose index informations (#2525) (#2532)
fix conflict bug (#2537)
fix: make format (#2534) (#2540)
Backport PR #2542, #2538 to release/v1.7 (#2543)
fix: add checkout option (#2545) (#2546)
Implement ngt Statistics API (#2539) (#2547)
Add workflow to check git conflict for backport PR (#2548) (#2550)
[create-pull-request] automated change (#2552) (#2556)
Update dependencies, C++ standard, and improve Dockerfiles for better build systems and localization (#2549) (#2557)
Backport #2559 (#2560)
[BUGFIX] index correction process (#2565) (#2566)
change external docker image reference to ghcr.io registry (#2567) (#2568)
[patch] Release v1.7.13 (#2569)
:bookmark: :robot: Release v1.7.13 (#2570)
add HTTP2 support for http.Client and Vald HTTP Server (#2572) (#2575)

Signed-off-by: kpango <kpango@vdaas.org>
kpango added a commit that referenced this pull request Aug 8, 2024
fix: git add chart directory for release (#2356) (#2357)
[patch] release v1.7.11 (#2358)
:bookmark: :robot: Release v1.7.11 (#2360)
Change docker scan timeout longer (#2363) (#2364)
refactor code using golangci-lint (#2362) (#2365)
Create SECURITY.md (#2367) (#2368)
add commit hash build image (#2359) (#2371)
update docker build target platform selection rules (#2370) (#2374)
Make agent export index metrics to Pod k8s resource (#2319) (#2372)
backport ci deps others (#2386)
Update workflow to release readreplica chart (#2383) (#2387)
:green_heart: :recycle: Add Con-Bench helm chart to the Vald charts (#2388) (#2389)
Delete unnecessary code for mirror (#2366) (#2391)
change JP logo to EN logo (#2369) (#2392)
Add rotate-all option to rotator (#2305) (#2393)
fix: build error of internal kvs test (#2396) (#2398)
Resolve kvs already closed before last saving (#2390) (#2394)
:robot: Update license headers / Format Go codes and YAML files (#2397) (#2400)
create continous benchmark doc (#2352) (#2395)
fix: disable protobuf dispatch for client (#2401) (#2403)
update deps (#2404) (#2405)
[patch] release v1.7.12 (#2406)
:bookmark: :robot: Release v1.7.12 (#2408)
:pencil: Fix typo of file name (#2413) (#2415)
Fix agent-faiss build failed (#2418) (#2419)
Add tests for index information export (#2412) (#2414)
Fix the logic to determine docker image (#2410) (#2420)
Update build rule for nightly image (#2421) (#2422)
Fix output settings to determine-docker-image-tag action and release branch build tag name (#2423) (#2425)
Add `index-operator` template implementation (#2375) (#2424)
fix: typo of execution rule (#2426) (#2427)
Backport Flush API (#2434)
update deps & add validation for Flush API when agent is Read Only (#2433) (#2436)
docs: add hrichiksite as a contributor for doc (#2441) (#2442)
fix: bugfix version update for docker build (#2445) (#2446)
Fix index job logic to pass DNS A record (#2438) (#2448)
Added snapshot timestamp annotations to read replica agent (#2428) (#2443)
Fix operator-sdk version (#2447) (#2449)
add file name lint (#2417) (#2450)
fix: add extra option for ci-container build (#2451) (#2452)
Add base of benchmark operator dashboard (#2430) (#2453)
Implement index operator logic for read replica rotation (#2444) (#2456)
add inner product distance type for ngt (#2454) (#2458)
Fix e2e for read replica and add e2e for index operator (#2455) (#2459)
Add unit tests for index operator (#2460) (#2461)
Bugfix recreate benchmark job when operator reboot (#2463) (#2464)
Refactor k8s types (#2462) (#2465)
:robot: Automatically update PULL_REQUEST_TEMPLATE and ISSUE_TEMPLATE (#2457) (#2469)
Fix workflow trigger for backport pr creation (#2471) (#2472)
Automatically add backport main label for release-pr (#2473) (#2475)
update deps (#2468) (#2476)
Implement client metrics interceptor for continuous benchmark job (#2477) (#2480)
:chart_with_upwards_trend: Add client metrics panels for continuous benchmark job (#2481) (#2483)
Update continuous benchmark docs (#2485) (#2486)
Sync release/v1.7 to main (#2495)
add read replica and rotator docs (#2497) (#2499)
add reviewer guideline (#2507) (#2508)
update large top-K ratio handling logic (#2509) (#2511)
Change default image tag from latest to nightly (#2516) (#2518)
Bugfix that caused an error when argument has 3 or more nil arguments (#2517) (#2520)
add faiss in values.yaml & valdrelease.yaml (#2514) (#2519)
capitalize faq (#2512) (#2522)
Backport docs updates to release/v1.7 (#2521)
[CI] Add workflow to synchronize ubuntu base image (#2526) (#2527)
fix: update schedule (#2528) (#2530)
refactor index manager service add index service API to expose index informations (#2525) (#2532)
fix conflict bug (#2537)
fix: make format (#2534) (#2540)
Backport PR #2542, #2538 to release/v1.7 (#2543)
fix: add checkout option (#2545) (#2546)
Implement ngt Statistics API (#2539) (#2547)
Add workflow to check git conflict for backport PR (#2548) (#2550)
[create-pull-request] automated change (#2552) (#2556)
Update dependencies, C++ standard, and improve Dockerfiles for better build systems and localization (#2549) (#2557)
Backport #2559 (#2560)
[BUGFIX] index correction process (#2565) (#2566)
change external docker image reference to ghcr.io registry (#2567) (#2568)
[patch] Release v1.7.13 (#2569)
:bookmark: :robot: Release v1.7.13 (#2570)
add HTTP2 support for http.Client and Vald HTTP Server (#2572) (#2575)

Signed-off-by: kpango <kpango@vdaas.org>
kpango added a commit that referenced this pull request Aug 8, 2024
fix: git add chart directory for release (#2356) (#2357)
[patch] release v1.7.11 (#2358)
:bookmark: :robot: Release v1.7.11 (#2360)
Change docker scan timeout longer (#2363) (#2364)
refactor code using golangci-lint (#2362) (#2365)
Create SECURITY.md (#2367) (#2368)
add commit hash build image (#2359) (#2371)
update docker build target platform selection rules (#2370) (#2374)
Make agent export index metrics to Pod k8s resource (#2319) (#2372)
backport ci deps others (#2386)
Update workflow to release readreplica chart (#2383) (#2387)
:green_heart: :recycle: Add Con-Bench helm chart to the Vald charts (#2388) (#2389)
Delete unnecessary code for mirror (#2366) (#2391)
change JP logo to EN logo (#2369) (#2392)
Add rotate-all option to rotator (#2305) (#2393)
fix: build error of internal kvs test (#2396) (#2398)
Resolve kvs already closed before last saving (#2390) (#2394)
:robot: Update license headers / Format Go codes and YAML files (#2397) (#2400)
create continous benchmark doc (#2352) (#2395)
fix: disable protobuf dispatch for client (#2401) (#2403)
update deps (#2404) (#2405)
[patch] release v1.7.12 (#2406)
:bookmark: :robot: Release v1.7.12 (#2408)
:pencil: Fix typo of file name (#2413) (#2415)
Fix agent-faiss build failed (#2418) (#2419)
Add tests for index information export (#2412) (#2414)
Fix the logic to determine docker image (#2410) (#2420)
Update build rule for nightly image (#2421) (#2422)
Fix output settings to determine-docker-image-tag action and release branch build tag name (#2423) (#2425)
Add `index-operator` template implementation (#2375) (#2424)
fix: typo of execution rule (#2426) (#2427)
Backport Flush API (#2434)
update deps & add validation for Flush API when agent is Read Only (#2433) (#2436)
docs: add hrichiksite as a contributor for doc (#2441) (#2442)
fix: bugfix version update for docker build (#2445) (#2446)
Fix index job logic to pass DNS A record (#2438) (#2448)
Added snapshot timestamp annotations to read replica agent (#2428) (#2443)
Fix operator-sdk version (#2447) (#2449)
add file name lint (#2417) (#2450)
fix: add extra option for ci-container build (#2451) (#2452)
Add base of benchmark operator dashboard (#2430) (#2453)
Implement index operator logic for read replica rotation (#2444) (#2456)
add inner product distance type for ngt (#2454) (#2458)
Fix e2e for read replica and add e2e for index operator (#2455) (#2459)
Add unit tests for index operator (#2460) (#2461)
Bugfix recreate benchmark job when operator reboot (#2463) (#2464)
Refactor k8s types (#2462) (#2465)
:robot: Automatically update PULL_REQUEST_TEMPLATE and ISSUE_TEMPLATE (#2457) (#2469)
Fix workflow trigger for backport pr creation (#2471) (#2472)
Automatically add backport main label for release-pr (#2473) (#2475)
update deps (#2468) (#2476)
Implement client metrics interceptor for continuous benchmark job (#2477) (#2480)
:chart_with_upwards_trend: Add client metrics panels for continuous benchmark job (#2481) (#2483)
Update continuous benchmark docs (#2485) (#2486)
Sync release/v1.7 to main (#2495)
add read replica and rotator docs (#2497) (#2499)
add reviewer guideline (#2507) (#2508)
update large top-K ratio handling logic (#2509) (#2511)
Change default image tag from latest to nightly (#2516) (#2518)
Bugfix that caused an error when argument has 3 or more nil arguments (#2517) (#2520)
add faiss in values.yaml & valdrelease.yaml (#2514) (#2519)
capitalize faq (#2512) (#2522)
Backport docs updates to release/v1.7 (#2521)
[CI] Add workflow to synchronize ubuntu base image (#2526) (#2527)
fix: update schedule (#2528) (#2530)
refactor index manager service add index service API to expose index informations (#2525) (#2532)
fix conflict bug (#2537)
fix: make format (#2534) (#2540)
Backport PR #2542, #2538 to release/v1.7 (#2543)
fix: add checkout option (#2545) (#2546)
Implement ngt Statistics API (#2539) (#2547)
Add workflow to check git conflict for backport PR (#2548) (#2550)
[create-pull-request] automated change (#2552) (#2556)
Update dependencies, C++ standard, and improve Dockerfiles for better build systems and localization (#2549) (#2557)
Backport #2559 (#2560)
[BUGFIX] index correction process (#2565) (#2566)
change external docker image reference to ghcr.io registry (#2567) (#2568)
[patch] Release v1.7.13 (#2569)
:bookmark: :robot: Release v1.7.13 (#2570)
add HTTP2 support for http.Client and Vald HTTP Server (#2572) (#2575)

Signed-off-by: kpango <kpango@vdaas.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment