You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by "hanahmily (via GitHub)" <gi...@apache.org> on 2026/06/04 06:37:30 UTC

[PR] fix(trace): move storage metrics under trace.storage subscope [skywalking-banyandb]

hanahmily opened a new pull request, #1155:
URL: https://github.com/apache/skywalking-banyandb/pull/1155

   ## Summary
   
   The trace package's `StorageMetricsFactory` was using the root `trace`
   scope, so per-segment inverted-index metrics from `pkg/index/inverted`
   were emitted as `banyandb_trace_inverted_index_*`. The dashboard in
   `docs/operation/grafana-cluster.json` (and the sibling `stream` package)
   expect `banyandb_trace_storage_inverted_index_*`.
   
   Add a `storageScope` mirroring `banyand/stream/metrics.go:31` and wire
   it into `OpenDB`'s `TSDBOpts.StorageMetricsFactory`.
   
   ## Changes
   
   - `banyand/trace/metrics.go` — add `storageScope = streamScope.SubScope("storage")`
   - `banyand/trace/metadata.go` — use `storageScope` in `TSDBOpts.StorageMetricsFactory`
   - `banyand/trace/storage_scope_test.go` — new regression test that asserts the namespace chain (`banyandb_trace`, `banyandb_trace_tst`, `banyandb_trace_storage`)
   - `CHANGES.md` — Bug Fixes entry under 0.11.0
   
   ## Breaking change
   
   The metric name `banyandb_trace_inverted_index_*` is renamed to
   `banyandb_trace_storage_inverted_index_*`. The old series will disappear
   after this rolls out. Sibling metrics affected:
   - `banyandb_trace_inverted_index_total_updates` → `banyandb_trace_storage_inverted_index_total_updates`
   - `banyandb_trace_inverted_index_total_doc_count` → `banyandb_trace_storage_inverted_index_total_doc_count`
   - `banyandb_trace_inverted_index_total_term_searchers_started` → `banyandb_trace_storage_inverted_index_total_term_searchers_started`
   
   Other trace metrics (`trace_tst_*`, `trace_scheduler_*`, etc.) are
   unaffected.
   
   ## Verification
   
   Local CI (all checks pass):
   - `make license-check` ✅
   - `make check-req` ✅
   - `make build` ✅
   - `make lint` ✅ (31 linters, 0 issues)
   - `make check` ✅ (no auto-fix changes)
   - `./banyand/...` unit tests ✅ (33 suites, 6m 40s)
   - `./bydbctl/...` unit tests ✅ (88 specs, 6m 45s)
   - `./pkg/...` unit tests ✅ (47 suites, 1m 20s)
   - `./fodc/...` unit tests ✅ (19 suites, 2m 51s)
   - `./test/integration/standalone/...` ✅ (12 suites, 27m 51s)
   - `./test/integration/distributed/...` ✅ (12 suites, 19m 21s)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(trace): move storage metrics under trace.storage subscope [skywalking-banyandb]

Posted by "hanahmily (via GitHub)" <gi...@apache.org>.
hanahmily commented on PR #1155:
URL: https://github.com/apache/skywalking-banyandb/pull/1155#issuecomment-4619905087

   Good catch, Copilot — addressed in commit 2c858562.
   
   Removed the duplicate `streamScope` declaration in `banyand/trace/metrics.go` and now derive `tbScope` and `storageScope` from the canonical `traceScope` already defined in `banyand/trace/trace.go:51`. The smoke test `TestStorageScopeNamespace` was updated to assert the `traceScope` namespace chain (`banyandb_trace` → `banyandb_trace_tst` / `banyandb_trace_storage`).
   
   `go test -short ./banyand/trace/` and `./banyand/internal/storage/...` both pass.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(trace): move storage metrics under trace.storage subscope [skywalking-banyandb]

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #1155:
URL: https://github.com/apache/skywalking-banyandb/pull/1155#issuecomment-4620121139

   ## [Codecov](https://app.codecov.io/gh/apache/skywalking-banyandb/pull/1155?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :white_check_mark: All modified and coverable lines are covered by tests.
   :white_check_mark: Project coverage is 41.15%. Comparing base ([`3530dd9`](https://app.codecov.io/gh/apache/skywalking-banyandb/commit/3530dd9b5cefaa4fef60eec91ecbfbdfcaf243c5?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`2c85856`](https://app.codecov.io/gh/apache/skywalking-banyandb/commit/2c85856253bd318e43216cfb7fec5a65d8b77c39?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   :warning: Report is 275 commits behind head on main.
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@            Coverage Diff             @@
   ##             main    #1155      +/-   ##
   ==========================================
   - Coverage   45.97%   41.15%   -4.82%     
   ==========================================
     Files         328      196     -132     
     Lines       55505    20380   -35125     
   ==========================================
   - Hits        25520     8388   -17132     
   + Misses      27909    11141   -16768     
   + Partials     2076      851    -1225     
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/skywalking-banyandb/pull/1155/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [pkg](https://app.codecov.io/gh/apache/skywalking-banyandb/pull/1155/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `41.15% <ø> (?)` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
   </details>
   
   [:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/skywalking-banyandb/pull/1155?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(trace): move storage metrics under trace.storage subscope [skywalking-banyandb]

Posted by "hanahmily (via GitHub)" <gi...@apache.org>.
hanahmily merged PR #1155:
URL: https://github.com/apache/skywalking-banyandb/pull/1155


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(trace): move storage metrics under trace.storage subscope [skywalking-banyandb]

Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #1155:
URL: https://github.com/apache/skywalking-banyandb/pull/1155#discussion_r3354179413


##########
banyand/trace/metrics.go:
##########
@@ -26,8 +26,9 @@ import (
 )
 
 var (
-	streamScope = observability.RootScope.SubScope("trace")
-	tbScope     = streamScope.SubScope("tst")
+	streamScope  = observability.RootScope.SubScope("trace")
+	tbScope      = streamScope.SubScope("tst")
+	storageScope = streamScope.SubScope("storage")

Review Comment:
   `traceScope` is already defined in this package (trace.go) and is used for other sub-scopes (e.g., `metadataScope`). Defining a second root scope here (`streamScope = observability.RootScope.SubScope("trace")`) duplicates the source of truth and could lead to inconsistent namespaces if one is ever changed. Consider deriving `streamScope`, `tbScope`, and `storageScope` from the existing `traceScope` instead.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org