[RCA] Collect a bounded native-log incident window

Đang mở
#14,223 7 bình luận 0 reaction 1 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@UchihaIthachi đang làm issue này rồi.

Từ ngày 18/11/2026.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
go, java
Lĩnh vực
backend, cli, observability

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Java
Star
25k
Fork
6.6k
Merge trung bình
10 giờ 45 phút
Pull request đã merge (30 ngày)
49

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của apache/skywalking

Tất cả issue của apache/skywalking

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.