Kiến thức chung · Advanced · Operations

Vận hành bằng Core facts, không bằng suy đoán

Input chỉ nói ứng dụng muốn gì. Hãy đọc cấu hình CoAkka Runtime đã chấp nhận, health, counters và structured outcomes để biết instance đang làm gì; sau đó mới export những fact cần thiết sang hệ hệ thống vận hành hiện có.

01 · Configuration truth

Requested không phải effective

1. Requested

Intent do app/connector gửi. Field vắng, zero và giá trị explicit có thể có nghĩa khác nhau.

2. Validated

Core kiểm tra lifecycle, capability, bounds và combination. Refusal không tạo cấu hình mới.

3. Accepted

Core trả giá trị đã normalize cùng provenance: explicit hay defaulted. Đây là startup truth.

4. Effective

CoAkka Runtime view cho biết generation, bind port, route, overload và security thực sự đang áp dụng.

Một apply bị từ chối giữ nguyên cấu hình active trước đó. Đọc structured status, reason và validation của chính lần apply; đừng gọi getter sau đó rồi gán snapshot cũ cho proposal vừa thất bại.

Baseline Core hiện tại khi bỏ trống

Network participation
EMBEDDED: không listener và không nhận remote endpoint. Chọn peer mode một cách explicit khi deployment cần.
CPU policy
AUTO: Core chọn theo CPU được host cho phép; thường ưu tiên 2 logical CPU hoặc 1 khi bị giới hạn. Đây không phải CPU reservation.
Connection strategy
Current native startup dùng MULTIPLEXED. Frozen legacy constructor vẫn là PER_EXCHANGE; không gộp hai scope này.
Transport security
PLAINTEXT. Đây là absence semantic, không phải tuyên bố mạng hiện tại đủ an toàn.
Queue capacity
Request 0 hiện được Core chuẩn hoá thành 4096. Request khác có thể được làm tròn hoặc clamp; đọc accepted capacity thay vì lặp một bảng default trong connector.
Overload policy
REJECT cho ingress, local delivery và remote outbound; reply reserve là 0. Application vẫn sở hữu retry.
I/O opt-in
Tắt. Requested, compiled, probed và supported là các fact khác nhau; capability phải được đọc từ exact artifact.
Extra Monitor collection
Tắt. Health, counters và accepted settings vẫn đọc trực tiếp được; collection bổ sung chỉ mở lúc tạo instance.

Phạm vi. Đây là baseline của current native-startup contract đang được portal đối chiếu. Package hoặc constructor khác phải giữ presence semantics của nó và chiếu lại Core snapshot; đừng suy default chỉ từ object input ở connector.

02 · Health, stats và Monitor

Đọc snapshot trực tiếp; dùng Monitor như doorbell

Health

Trạng thái CoAkka Runtime, applied generation và readiness flags cho một instance. Dùng để biết lifecycle và dataplane có sẵn hay không.

Stats

Capacity, depth, high-watermark, rejection, deadletter, timeout và transport counters. Đọc xu hướng, không kết luận từ một điểm đơn.

Monitor update

Tín hiệu bounded rằng state có thể đã đổi. Refresh snapshot mới nhất; tín hiệu không phải event log hay request count.

Collection OFF
Direct health/stat/settings reads vẫn hợp lệ. API chờ Monitor update cần collection ON.
Collection ON
Chọn trước khi tạo instance. Không có live toggle; muốn đổi phải tạo instance thay thế và cut over theo lifecycle của app.
change_sequence
Monotonic trong lifetime của instance và có thể nhảy nhiều bước khi doorbell coalesce. Nó không hứa một record cho mỗi thay đổi.
observed_mono_ns
Monotonic observation time cục bộ. Không dùng nó như shared wall clock giữa nhiều máy.
Không có update
Chỉ nghĩa bounded wait hết hạn hoặc chưa có tín hiệu mới; không tự chứng minh healthy, unhealthy hay stopped.
Monitor drops
Là accounting của diagnostic signal/history, không phải số business request bị mất.

Đọc pressure có mục đích

03 · Observability ownership

Ba lớp bằng chứng trả lời ba câu hỏi khác nhau

CoAkka Runtime evidence

Target/source, generation, admission, queue pressure, reply, timeout, Deadletter, transport và lifecycle fact. Core phát hành structured truth.

Business logs

Order, account, domain outcome, user message, retry decision và audit meaning. Application sở hữu masking, retention và data policy.

Export và fleet view

Metrics backend, traces, dashboards, storage, alerts, SLO và cross-instance correlation. Platform/app-host sở hữu pipeline này.

Đừng biến CoAkka Runtime Core thành business logger hoặc telemetry backend. Tránh synchronous hot-path logging, payload dump, sink không có bound và loss không quan sát được. CoAkka Logger chỉ là lựa chọn khi cần một log boundary có bound, cross-language và pressure-aware; nó không thay Core facts hoặc hệ thống export của ứng dụng.

04 · Inspection surfaces

Chọn surface nhỏ nhất trả lời được câu hỏi

Connector snapshot API

Dùng trong app, health endpoint hoặc test. Nó chiếu typed copied values cho đúng instance và là lựa chọn đầu tiên để đọc accepted/effective state.

CoAkka Runtime Client

CLI script-first; executable là coakka-client. Dùng nó để hỏi exposed runtime-info route, gửi request thử và nhận JSON/exit code. version/doctor chỉ kiểm tra local binary.

CoAkka Runtime Inspect

Browser explorer coakka-runtime-inspect cho snapshot source, runtime identity, route/topology, connection provenance, nonsecret TLS, health/pressure và request/reply trial.

Ranh giới

Client/Inspect không phải admin dashboard, service discovery, topology authority, schema registry, observability backend hay TLS control plane.

Snapshot source và destination có thể khác nhau. Luôn ghi rõ instance nào cung cấp snapshot, target nào nhận trial request và thời điểm nào được quan sát. Private key, PEM content và credential path không được đưa ra inspection response.

Companion-product identity hiện tại. CoAkka Runtime Client và CoAkka Runtime Inspect 3.3.1 bundle Core 3.3 ABI 1. Archive hash, platform và loaded library vẫn phải được xác minh riêng cho lần chạy cụ thể.

05 · Evidence ladder

Một package tồn tại chưa chứng minh deployment sẵn sàng

01

Coordinate và bytes

Ghi package version, release channel, archive SHA-256 và inner native-library SHA-256.

02

Loaded identity

Process phải báo path/hash thực sự loaded, Core generation, build ID, ABI, capability và effective config.

03

Installed consumer

Chạy từ package tree ở ngoài build/source tree để phát hiện loader, manifest và bundled-byte drift.

04

Contract và failure paths

Chứng minh reply/deadletter, pressure, timeout/cancel, concurrent close, restart/reconnect và resource recovery.

05

Matching target host

Thực thi đúng OS/CPU/container hoặc device boundary. Cross-compile và bundled bytes không thay matching-host execution.

06

Deployment workload

Đo throughput cùng tail latency, RSS, allocation, thread/fd, wakeup, pressure và stop latency trên workload đã khai báo.

Source build, packaged-byte inspection, installed execution, portability, stress/soak và capacity là các loại evidence khác nhau. Ghi chính xác loại nào đã có; một pass không tự nâng cấp thành các loại còn lại. Benchmark chỉ có nghĩa khi source/artifact identity, host, effective config, warmup, workload và aggregation rule đều được ghi.

06 · Incident first response

Thu thập structured facts trước

  1. Ghi connector/package version, Core generation/build ID/ABI, archive và loaded-library hash.
  2. Ghi OS, CPU, container/VM/device boundary, framework và exact artifact profile.
  3. Chụp requested cùng accepted/effective config, default provenance, capability, route generation và trạng thái CoAkka Runtime.
  4. Giữ stable status/reason/validation, Deadletter metadata và transport failure; không branch theo error text.
  5. Thu queue depth/capacity/high-watermark và counters trong một cửa sổ thời gian, không chỉ một ảnh chụp.
  6. Giảm về reproduction nhỏ nhất nhưng vẫn giữ đúng package và loader path rồi mới escalate.
Apply bị từ chối
Kiểm tra lifecycle, capability, presence và validation. Previous active config vẫn còn hiệu lực.
Monitor không update
Xác nhận collection đã ON lúc tạo instance, bounded wait dùng sequence đúng, rồi đọc direct health. Timeout không phải health verdict.
Queue tăng hoặc reject
Đối chiếu route/generation, downstream availability và workload. Chỉ tune bound sau khi hiểu ai đang giữ work và outcome khi đầy.
Timeout hoặc transport failure
Không mặc định replay. Kiểm tra correlation, Deadletter, peer evidence và idempotency trước khi app quyết định retry.
Load sai artifact
So loaded path/hash với manifest, OS/CPU và inner-library digest; intended search path không phải bằng chứng file thực sự loaded.

07 · Review trước rollout

Handoff cùng fact, owner và giới hạn

Developer

  • Giữ default cho tới khi measurement cần đổi.
  • Expose direct health/settings read.
  • Map stable outcomes, không parse detail.
  • Bound waits và close theo lifecycle.
  • Tách business log khỏi CoAkka Runtime evidence.

Deployment

  • Pin package và artifact hash.
  • Verify loaded identity.
  • Ghi effective network/connection/security.
  • Test restart, reconnect và pressure.
  • Qualify đúng target host và workload.

Operations

  • Export ít fact cần cho SLO.
  • Label instance/generation/snapshot source.
  • Alert từ trend và terminal outcomes.
  • Giữ secret/payload ngoài telemetry.
  • Handoff known limits và untested boundaries.

Go projection hiện có

  • Chạy bài Monitor với package 3.2.1.
  • Đọc accepted startup config.
  • Đọc effective CoAkka Runtime config.
  • Giữ một host theo app lifetime.
  • Export ở app/platform, không trong Core.