[RCA] Collect a bounded native-log incident window

オープン
#14,223 コメント 7 件 リアクション 0 件 担当者 1 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@UchihaIthachi がすでに取り組んでいます。

2026年11月18日 から。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
go, java

調査の方向性

Start with bydbctl/internal/cmd/root.go and stream.go, then inspect the native-log E2E fixtures and the ordinary stream query API. Build the proposed bydbctl rca collect --source=native-log operation around the stated bounds, local workspace manifest, and refusal cases; add hand-authored fixture tests before implementation. Done means the real CLI scenarios meet the acceptance criteria, including truthful partial status, interruption cleanup, and no server writes.

索引モデルが issue の本文から書いたものです。

説明

database enhancement logging

Umbrella: #14222

Summary

Collect a bounded native-log incident window. Deliver one usable operation, not a framework-only foundation.

Boundary

Proposed activation caller: bydbctl rca collect --source=native-log. Command names are proposed, not existing APIs.
Reporter collection runs with read-only source access; offline steps use local files only.
No source storage/wire-format changes are requested. The incident format is separately versioned.

Requirements

R1. Reuse the ordinary stream query API for _monitoring_log/log; require UTC start/end, selected nodes, levels, output path, byte budget and deadline. Do not enable logging or modify a cluster.
R2. Persist a private local workspace with schema version, collection interval, source status, hashes and tool build information. Decode searchable tags and binary JSON data.fields without dropping unknown fields; preserve source log_id.
R3. Query one bounded time/node/level selection and filter module/message locally. No adaptive time subdivision or automatic pagination. Mark coverage partial or unknown when scan limits prevent proving completeness, including timestamp ties.
R4. Bound per-query rows, cumulative bytes and elapsed time; no automatic retries in this first slice; record missing schema, unreachable nodes, truncation separately from an empty successful query. Verify retrieved rows rather than trusting producer written counters.

Acceptance criteria

  • A hand-authored three-row fixture includes two rows with the same timestamp, a nested secret in data.fields, and a module predicate whose server-side limit would hide a match. For an unsaturated fixture assert exact IDs and decoded fields; for a saturated fixture require an explicit partial/unknown status, never complete.
  • Invoke the real CLI against the native-log E2E deployment, then with an absent schema and an unavailable endpoint. Assert no server writes/config changes, bounded termination, private files, and a truthful manifest.
  • Interrupt a collection: no complete marker may be left. Existing stream query commands remain unchanged.
  • Use hand-authored or independently captured fixtures with documented provenance; do not generate expected values using the code under test.
  • Add focused behavioral tests before implementation and record the actual RED command/failure, then GREEN results.
  • Keep existing CLI/API behavior compatible. Never overwrite unrelated user files; output conflicts must be refused.

Scope and readiness audit

  • Boundary and behavior: the single operation above; independently observable output and refusal behavior.
  • Production activation: the named CLI or skill entry point above, included in the same PR.
  • Packages/callers: bydbctl/internal/cmd/root.go and stream.go; new internal RCA collector package; existing native-log E2E fixtures.
  • Dependencies: None. See the dependency contract below for the exact shared interfaces and runtime independence.
  • Classification: initial leaf candidate, NOT automation-ready until contract/RED audit.
  • RED evidence: not executed during this planning task; no claim of passing or failing implementation tests.
  • End-to-end proof: the real command/skill scenarios above, not source-text assertions.
  • Formats/lifecycle/fixtures: private workspace or public archive only; artifact-specific fixture family above.
  • Focused tests: CLI leaves should add TestRCA… coverage under bydbctl/internal/cmd and/or the introduced collector package;
    run go test ./bydbctl/internal/cmd -run TestRCA -count=1 plus the new package tests. Skill leaves must add a replayable evaluation harness
    with an exact command documented in the PR. Final test names/paths are fixed when the prerequisite seam merges.
  • Resource/concurrency checks: cancellation, bounded reads/output and cleanup on failure; use repository panic-aware goroutine wrappers if concurrency is introduced.
  • Decision: one proposed PR. If the named behavior requires an unimplemented server API or another lifecycle change, stop and split that prerequisite.

Required-only scope audit

Bounded export is required; exhaustive historical recovery is not.

Removed/deferred: Adaptive window splitting, automatic pagination, additional drop-metric endpoint collection, configurable retry engines and automatic resume.

Out of scope

Query-trace storage, schema changes, native receiver bug fixes, redaction, public archives, Kubernetes installation.

Concrete verification and closure gate

These are required acceptance tests, not examples that may be skipped. Artifact filenames and unsupported format handling must follow the merged prerequisite contracts. Before queueing, fix the tested schema version, configured limits, observable statuses and independent expected values; record any necessary interface decision in this issue rather than leaving it to an agent mid-run.

Fixed acceptance scenario

Use three independently authored native-log rows with IDs L1/L2/L3 inside [10:00, 10:05) UTC and a fourth outside. L2/L3 share a timestamp; one contains a nested data.fields value. With adequate limits, assert exactly L1/L2/L3 and the expected decoded values. With a two-row scan cap, assert partial/unknown coverage, never complete. Exercise absent schema, an unreachable endpoint and cancellation; no completed manifest marker or cluster mutation is allowed.

Executable regression

Proposed named regression: TestRCANativeLogCollect in bydbctl/internal/cmd exercising the registered command through an existing CLI test seam.
After normal repository generation, use:

go test ./bydbctl/internal/cmd -run '^TestRCANativeLogCollect$' -count=1 -v
make test-ci PKG=./bydbctl/internal/cmd

The exact selector must execute at least one test, not return “no tests to run.” If repository conventions require a different test harness or location, update this section with the real command before queueing; do not claim this proposed test already exists. Also run the actual changed internal package suites.

For GraphLoom, apply only the regression tests/fixtures to the chosen base: they must compile and fail by a relevant assertion. Apply the implementation: the same test must pass. Tests that import a new production package missing from the base are not valid assertion-based RED proof; use an existing command seam. Exercise the real CLI with fixture endpoints/files. If the issue requires deployment E2E, record its separate command and result; fixture-server tests alone do not satisfy it.

Evidence required to close this issue
  • Source/base revision, exact commands, fixture provenance and independently specified expected outcomes.
  • Actual positive and negative/partial-case results; explain failures and rerun after fixes.
  • Produced artifact/manifest/report samples with no real sensitive data, and the relevant size/coverage/privacy assertions.
  • Applicable repository checks and integration/evaluation results; explicitly list checks not run. A required check not run leaves acceptance incomplete, not passed.
  • For failures/cancellation, confirm no false completion marker and no unrelated user-file overwrite.

No verification execution is claimed by adding this section. Do not close the issue merely because code or documentation was submitted.

Dependency contract: implementation order versus runtime inputs

Implementation prerequisites mean merged interfaces needed to implement/test this issue. They do not mean that those evidence collectors must run or succeed for every incident.

No unmerged RCA issue prerequisite. Existing native-log storage is already implemented.

Runtime behavior and verification

This issue delivers the first usable native-log collector together with minimal shared RCA plumbing in the same PR; it is not a standalone framework project. Keep CLI registration, workspace/manifest, artifact writing and source statuses independent of the native-log adapter. Register artifact format/source identity explicitly so later collectors do not need a native-log schema, endpoint or record to create a valid workspace.

Add a source-neutral workspace/manifest test with no native-log artifact. The existing native-log CLI remains the production activation for this PR. Do not implement future collectors here.

Wait for prerequisite contracts to merge before queueing automated implementation, then revalidate the real interfaces. Do not add direct blockers for dependencies already covered transitively. No new issue or automation job is introduced by this clarification.

主要言語
Java
スター
25k
フォーク
6.6k
平均マージ
10時間 45分
マージ済み PR(30日)
49

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

apache/skywalking のほかの issue

apache/skywalking の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。