forked from mtusi2026/mtusi2026lab6
Prepare verified laboratory 6 implementation and evidence
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
> Checkpoint update: the approved559001001-byte Grafana/plugin download, native18-panel UI/42-span links, bounded response contract and real DB/worker alerts now have evidence in ../../REPORT.md. Historical preparation/gate wording below is retained as provenance; fresh-volume/source/package completion is tracked in ../../REPORT.md.
|
||||
|
||||
# OpenObserve migration checkpoint
|
||||
|
||||
The owner approved replacing Prometheus, Loki and Tempo with OpenObserve. Grafana and the separate OTel Collector remain mandatory. The authoritative shared boundary is `../reference/OPENOBSERVE-BOUNDARY.md`. Backend95 stays byte-identical; its native OTLP HTTP/protobuf interface does not depend on the former storage stack.
|
||||
|
||||
The implementation uses one isolated OpenObserve single-node instance with a persistent local data/metadata volume. This is an explicitly temporary engineering default. It does not reuse Azur credentials, S3, Litestream, Kubernetes resources or runtime metadata. The application database, broker and S3 remain separate failure domains. The existing core application and historical VP5 archive remain available.
|
||||
|
||||
## Preserved baseline
|
||||
|
||||
Before changes, 49 configuration, helper, report and evidence files were copied and SHA-256 verified under `.local/history/pre-openobserve-2026-11-15T224455797Z`. This private snapshot is historical, not evidence for the new stack. Existing backend source95, VP5 ZIP and lab7 source112 are outside this migration's write boundary.
|
||||
|
||||
## Case table before implementation
|
||||
|
||||
| Situation or input | Concrete example | Observable expected result | Level |
|
||||
|---|---|---|---|
|
||||
| Valid all-signal ingestion | Actual current API request and worker image processing | Collector delivers metrics, structured logs and related API/producer/consumer/worker spans to isolated OpenObserve; native query content verified | Integration |
|
||||
| Metric naming and units | Request counter, duration histogram, immutable readiness SLO gauges | Measured native names and units; histogram percentiles agree with controlled observations; no assumed `messenger_` exporter prefix | Integration |
|
||||
| Trace field compatibility | Actual accepted OTLP spans, including nonzero worker duration and parent | Native trace columns match plugin canonical nanosecond start/end/duration path; correct hierarchy and positive duration | Integration and browser |
|
||||
| Grafana drill-down | Log containing trace_id and response request_id | Native metrics panel, structured log and actual waterfall render; log-to-trace and trace-to-log resolve the same trace | Browser |
|
||||
| Query identity scope | Dedicated principal's required query and forbidden write/admin path | Intended queries succeed, write/admin/other organization paths denied; root credential never provisioned to Grafana | Integration |
|
||||
| Bounded query | Oversized or long-range request, excessive result limit | Explicit query/time/result and data-proxy response limits enforced, ordinary bounded query succeeds | Integration |
|
||||
| High error alert | Controlled application DB failure plus healthy positive control | Actual rule engine changes normal → firing → resolved and keeps observation-availability separate | Integration |
|
||||
| Queue and readiness SLO | Short/sustained worker pause and matured initial-acceptance cohort | Queue-age and two SLO multiwindow rules use measured series, fire and resolve at their declared windows | Integration |
|
||||
| Telemetry storage failure | Own OpenObserve unavailable while core requests continue | Application remains available, SDK/Collector retry queues and memory stay bounded, stop finishes within deadline | Fault integration |
|
||||
| Collector recovery | Delivery resumes after bounded outage | New signals arrive after recovery; losses/retries reported from measured counters, no claim of unlimited durability | Fault integration |
|
||||
| Persistence | Restart only owned telemetry services with named volume retained | Previously queried synthetic application signals survive restart | Integration |
|
||||
| Both API failures | Stop each owned API replica separately while history is used | Other replica serves confirmed state through load balancer; bounded failover verified for both | Integration |
|
||||
| Cache identity | Exact public OCI digest and size in stopped node | Regular blob, expected size and raw SHA-256; no runtime metadata read, source mutation or new pull | Operational integration |
|
||||
| Native archive boundary | Final Compose bind files and new configuration | Complete canonical archive with hashes, no `.local`, credentials, cache or builds | Artifact integration |
|
||||
|
||||
Failures include auth rejection, native schema mismatch, exporter retry/queue overflow, unavailable storage, absent metric names, trace query truncation, failed rule evaluation and restart loss. They are tested at the actual boundary, rather than by asserting configuration text. Config parsing/dry-run and source probes are recorded separately from runtime acceptance. Storage loss during an outage is not called zero-loss without measured delivery evidence.
|
||||
|
||||
## Current evidence and gates
|
||||
|
||||
Registry metadata only: OpenObserve v1.1.2 pinned index `sha256:4a154849432f75c4fb024de32fe34163c02406c905dab22bf8d213d2e3386392`; linux/amd64 manifest `sha256:26618f379c86b253c0d91624c487dd14b71293699845ecbc8457c94dca14819f`. Config and compressed layers total 161,811,141 bytes. Collector-k8s0.163.2 totals51,500,993 bytes; Grafana13.3.1 totals506,207,527 bytes. Raw index/manifest SHA-256 matches the registry descriptors. This is not a layer download or runtime PASS.
|
||||
|
||||
A ready-made third-party Grafana plugin is being independently reviewed by root/SII. No authored plugin, protocol shim or upstream modification is authorized. Actual OpenObserve ingestion must establish the canonical timestamp path before Grafana acceptance. OpenObserve root/admin credentials must not enter Grafana. Large new layer downloads remain gated on owner approval; current work first inspects exact known public OCI content in the stopped node read-only.
|
||||
|
||||
## Contract6 → 7
|
||||
|
||||
The backend OTLP interface and source bytes remain unchanged. Collector receives HTTP/protobuf on4318 and gRPC on4317 only where explicitly bound internally; all three signals forward through native OTLP HTTP to the isolated OpenObserve organization. The exact endpoint/auth header, stream names, native metric names/units and trace columns will be emitted as a narrow measured contract only after ingestion. Lab7 keeps its TLS/mTLS gateways and updates only its own infra/provisioning. No bulk backend or lab6 configuration synchronization is permitted.
|
||||
|
||||
Full readiness remains gated on the runtime, Grafana, alert, persistence/failover and independent review rows above. Historical source/unit/core-runtime checks do not satisfy the replacement stack's acceptance.
|
||||
|
||||
## Targeted parser boundary cases
|
||||
|
||||
After the first21 native gateway cases, independent review requested explicit duplicate JSON/query parameters, encoded parameter names, fractional ranges, SQL LIMIT versus requested size, and incomplete/chunked bodies. The expected contract rejects ambiguous duplicate protected fields/parameters and ranges beyond the declared upper bound; it must keep complete legitimate chunked JSON usable and reject oversized/incomplete bodies within the transport deadline. A benign SQL LIMIT2/query.size1 probe establishes the native engine's precedence without a large response. These are additional cases, not already covered by the first21 receipt. The current Prometheus epoch converter floors fractional seconds, so its measured effective bound must be stated or tightened; a config text comparison cannot establish that behavior.
|
||||
|
||||
Repeated bootstrap/render is part of the start contract: existing byte-identical dedicated credential files must be preserved and reused, and a changed credential must fail closed instead of silently rotating it. The renderer's initial exclusive-create-only behavior is exercised as RED before adding this repeat path. Provisioning captures each one-time service-account response in its owned private operation directory before readback; partial creation remains distinguishable from a fresh start.
|
||||
|
||||
Fresh start must not require the not-yet-rendered Grafana query environment while its profile is disabled. Grafana's env_file is therefore optional at Compose parse time; `up.sh` renders its dedicated account before a later explicit Grafana start. PostgreSQL readiness uses TCP127.0.0.1 rather than the temporary initialization server's Unix socket, consistent with the already confirmed adjacent lab7 initialization race. The installed PostgreSQL18.6 TCP readiness invocation is verified; current-volume startup does not by itself prove every fresh-volume path.
|
||||
|
||||
Independent pre-freeze review found that a Grafana process on the shared private network could bypass the query gateway using its otherwise broad native SA. The corrective contract isolates Grafana on a query-front network; only the existing HAProxy joins query-front and telemetry-data, while raw OpenObserve and Collector never join query-front. Separate existing edge membership preserves host-loopback publications; Grafana joins only the dedicated noninternal query-front network. A cached unprivileged client with the actual dedicated query credential must demonstrate the old raw read/write route as RED, then gateway-positive/raw-IP+host-loopback-published-route+Collector-negative behavior on the new network. It is a network-principal equivalence check while the Grafana image remains gated, not a claim that Grafana rendered anything.
|
||||
|
||||
Account bootstrap must checkpoint each received credential before creating the next account. On a retained intent, it recovers only through captured native JSON and live credential/role checks; ambiguous partial bytes fail closed without repeating account POST. Existing tokens must prove expected search200/ingest200/admin-rotation403 before canonical/derived publication or a successful start. Required-port regressions cover a second-create failure, replay from one persisted account, captured-response recovery, uncertain attempt/no-retry, stale401, unavailable503 and unexpected administration status.
|
||||
|
||||
Native positive-query controls on the retained workload exposed different `start_time` labels per OTLP instrument. SLO arithmetic must use `on(service_name,service_instance_id)` for both subtraction and division as well as observer matching. The actual provisioned panel16 and ready-burn were empty in RED despite matured=timely=1; after the configuration fix all17 controls are finite/nonempty with healthy ratios0. No new smoke or producer was needed.
|
||||
@@ -0,0 +1,3 @@
|
||||
# Historical storage configuration
|
||||
|
||||
These byte-preserved files belong to the previous Prometheus/Loki/Tempo preparation. No current Compose service, startup helper, dashboard or alert evaluator consumes them. Current storage is OpenObserve and current rules are Grafana-managed provisioning under `config/grafana/provisioning/alerting/`. Historical source/runtime receipts do not prove the replacement stack.
|
||||
@@ -0,0 +1 @@
|
||||
{groups: [{name: messenger,interval: 1s,rules: [{record: messenger:api_error_ratio:10s,expr: "(sum(rate(messenger_http_requests_total{status_class=\"5xx\"}[10s])) or vector(0)) / clamp_min(sum(rate(messenger_http_requests_total[10s])),0.001)"},{record: messenger:api_error_ratio:30s,expr: "(sum(rate(messenger_http_requests_total{status_class=\"5xx\"}[30s])) or vector(0)) / clamp_min(sum(rate(messenger_http_requests_total[30s])),0.001)"},{alert: MessengerHighErrorRate,expr: messenger:api_error_ratio:10s > 0.05,for: 10s,labels: {severity: warning},annotations: {summary: Business API 5xx ratio exceeds 5 percent,runbook: "See RUNBOOK.md, database and HTTP trace checks"}},{alert: MessengerFastErrorBudgetBurn,expr: messenger:api_error_ratio:10s / 0.01 > 14.4 and messenger:api_error_ratio:30s / 0.01 > 14.4,for: 15s,labels: {severity: critical},annotations: {summary: Both windows exceed the 99 percent API error budget,runbook: "See RUNBOOK.md, distinguish short spikes from sustained DB errors"}},{alert: MessengerQueueLag,expr: max(messenger_queue_oldest_age_seconds) > 10,for: 5s,labels: {severity: warning},annotations: {summary: Oldest accepted attachment exceeds 10 seconds,runbook: "See RUNBOOK.md, check worker saturation and consumer spans"}},{record: messenger:ready_error_ratio:10s,expr: "max(((messenger_ready_slo_matured_10s-messenger_ready_slo_timely_10s) / clamp_min(messenger_ready_slo_matured_10s,1)) and on(job,instance) (messenger_database_observer_up == 1))"},{record: messenger:ready_error_ratio:30s,expr: "max(((messenger_ready_slo_matured_30s-messenger_ready_slo_timely_30s) / clamp_min(messenger_ready_slo_matured_30s,1)) and on(job,instance) (messenger_database_observer_up == 1))"},{alert: MessengerReadyErrorBudgetBurn,expr: messenger:ready_error_ratio:10s / 0.01 > 14.4 and messenger:ready_error_ratio:30s / 0.01 > 14.4,for: 15s,labels: {severity: critical},annotations: {summary: Matured accepted-file cohorts exceed both readiness error-budget windows,runbook: See RUNBOOK.md; distinguish immutable acceptance/first-ready from latest pipeline status}},{alert: MessengerDatabaseObserverUnavailable,expr: max(messenger_database_observer_up) == 0,for: 5s,labels: {severity: warning},annotations: {summary: Database-derived gauges are unavailable; HTTP/process metrics remain independent,runbook: See RUNBOOK.md; do not interpret cached cohort gauges as a healthy database}}]}]}
|
||||
@@ -0,0 +1,31 @@
|
||||
auth_enabled: false
|
||||
server:
|
||||
http_listen_port: 3100
|
||||
log_level: warn
|
||||
common:
|
||||
instance_addr: 127.0.0.1
|
||||
path_prefix: /loki
|
||||
storage:
|
||||
filesystem:
|
||||
chunks_directory: /loki/chunks
|
||||
rules_directory: /loki/rules
|
||||
replication_factor: 1
|
||||
ring:
|
||||
kvstore:
|
||||
store: inmemory
|
||||
schema_config:
|
||||
configs:
|
||||
- from: 2024-04-01
|
||||
store: tsdb
|
||||
object_store: filesystem
|
||||
schema: v13
|
||||
index:
|
||||
prefix: index_
|
||||
period: 24h
|
||||
limits_config:
|
||||
allow_structured_metadata: true
|
||||
reject_old_samples: true
|
||||
reject_old_samples_max_age: 24h
|
||||
analytics:
|
||||
reporting_enabled: false
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
global:
|
||||
scrape_interval: 2s
|
||||
evaluation_interval: 1s
|
||||
rule_files:
|
||||
- /etc/prometheus/alerts.yaml
|
||||
scrape_configs:
|
||||
- job_name: messenger-collector
|
||||
honor_labels: true
|
||||
static_configs:
|
||||
- targets: ['otel-collector:8889']
|
||||
- job_name: collector-health
|
||||
static_configs:
|
||||
- targets: ['otel-collector:8888']
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
stream_over_http_enabled: true
|
||||
server:
|
||||
http_listen_port: 3200
|
||||
log_level: warn
|
||||
distributor:
|
||||
receivers:
|
||||
otlp:
|
||||
protocols:
|
||||
grpc:
|
||||
endpoint: 0.0.0.0:4317
|
||||
http:
|
||||
endpoint: 0.0.0.0:4318
|
||||
storage:
|
||||
trace:
|
||||
backend: local
|
||||
wal:
|
||||
path: /var/tempo/wal
|
||||
local:
|
||||
path: /var/tempo/blocks
|
||||
usage_report:
|
||||
reporting_enabled: false
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
# OpenObserve migration boundary
|
||||
|
||||
User scope: replace Prometheus/Loki/Tempo storage in lab6 and lab7. Keep the original mandatory OTel Collector, Grafana, OpenBao, business API, PostgreSQL, Valkey, S3, worker and security criteria. Existing immutable archives/receipts remain historical; new configuration requires its own acceptance.
|
||||
|
||||
## Ownership
|
||||
|
||||
- Lab6 author: builtin VP, including its isolated remote6 and vp/STATUS.md.
|
||||
- Lab7 author: HC t67, infrastructure only; backend112 and protected19 remain byte-identical.
|
||||
- Root: this boundary, cross-subject plan and native Grafana integration acceptance.
|
||||
- Independent source reviewer: builtin SII; no implementation writes.
|
||||
|
||||
## Shared configuration defaults
|
||||
|
||||
Use one isolated single-node OpenObserve instance per lab, persistent local data/metadata volume independent of application PostgreSQL. This is a temporary engineering default for the coursework, not the S3/Litestream topology of azur-games. Do not add NATS/etcd or copy Azur credentials/configuration blindly. No telemetry data migration is required from the not-yet-run old storage stack; retain historical source and manifests.
|
||||
|
||||
API and worker keep their current OTLP HTTP/protobuf interface and W3C propagation. The Collector forwards logs, metrics and traces through native OTLP to OpenObserve. Authentication is file/environment based outside Git, images and diagnostics. No OpenObserve secret belongs to application code or API/worker OpenBao KV. Start with the isolated native default organization; record exact stream names and native normalized metric names after live ingestion instead of assuming the old Prometheus exporter namespace/suffixes.
|
||||
|
||||
Native lab6 export confirmed that the Collector file provider preserves terminal newlines in a header scalar. Generated Authorization header files must contain no CR/LF; configuration validation alone did not detect the invalid wire header. Keep prior failed bytes private and validate authenticated positive export after writing the corrected file.
|
||||
|
||||
Lab6 implements the shared OTLP routes/field names and sends a narrow checked artifact contract to lab7. Lab7 retains its TLS/mTLS gateway architecture and updates the declared telemetry matrix, identity allow/deny tests and any actual provisioning consumer. Do not bulk-copy backend or all lab6 configs into lab7.
|
||||
|
||||
## Grafana query path
|
||||
|
||||
Grafana remains in both labs. Metrics use its native Prometheus data source against the documented OpenObserve Prometheus-compatible organization endpoint. Logs and trace rendering use an existing OpenObserve data source plugin, not an authored protocol shim/plugin.
|
||||
|
||||
The official openobserve/openobserve-grafana-plugin current source confirms logs/metrics, not a native trace frame. The ready-made third-party Windforce17/openobserve-grafana-plugin v1.0.1 candidate is pinned to commit e10214739827dda9318705d49db262b28d67bcfe, Apache-2.0, requires Grafana>=12.4.0 and is unsigned. It is not an official OpenObserve release. Its actual frontend trace_id path creates a canonical Grafana trace frame and internal log/trace links; its generic backend table frames are not a substitute for that frontend route. Independent authentication/limits review and a native Grafana rendering check remain required before accepting it.
|
||||
|
||||
Independent source probes confirm the canonical nanosecond span path, but exposed conditional defects in the microsecond `_timestamp` fallback (factor1000) and ignored custom duration-field setting. Inspect actual native OpenObserve trace columns and enforce a correctly rendered canonical start/end/duration path; do not accept an empty or zero-duration waterfall and do not add a custom shim or silently patch the dependency. Bound Grafana data-proxy response size/time and actual query results as well as the Collector.
|
||||
|
||||
The pinned OpenObserve1.1.2 decoder (commit d16d693ba99bc20621a58b948ecbcad7ec7fa882) preserves native `start_time`/`end_time` in nanoseconds, `_timestamp` and `duration` in microseconds. The plugin's normal native start/end path is source-proven compatible; inspect real rows before acceptance. Its optional duration-search shortcut applies nanoseconds to the native microsecond `duration` column; do not use that shortcut for acceptance. Native SQL such as `duration > 5000` means greater than5ms and can be used through the existing SQL mode when such a filter is needed. No upstream code patch is part of this migration.
|
||||
|
||||
Provisioning from the actual pinned plugin consumers: data source `type: openobserve`, top-level URL/access proxy, `basicAuth: true`, `basicAuthUser` and `secureJsonData.basicAuthPassword`. The declared TypeScript `apiKey` is not read by the backend. Actual jsonData keys include `timestamp_column`, `default_organization`, `default_log_stream`, `default_trace_stream`, `log_message_field`, `trace_id_field`, `span_id_field`, `service_name_field`, `span_name_field` and `status_field`; there are no configurable start/end keys. Set values from measured native schema, not invented aliases.
|
||||
|
||||
Trace lookup target uses `queryType: trace_id`, `streamType: traces`, actual stream/organization, both `traceId` and `query` equal to the actual trace ID, `sqlMode: false`, `displayMode: trace`. Optional explicit start/end bounds are microseconds; use Grafana's actual time range. Set a positive `GF_DATAPROXY_RESPONSE_LIMIT` in bytes (default/unset0 disables it). The plugin overrides backend total/search timeouts to210/180s; jsonData.timeout is not proof of a shorter bound. Lab7's native query gateway must enforce its documented transport budget; native engine/resource bounds remain explicit.
|
||||
|
||||
Native lab6 parser probes established that search `query.size=1` with SQL `LIMIT 2` returns two rows: a size-field guard is not a hard returned-row cap. Use explicit bounded provisioned SQL and verify the actual Grafana response-byte cap and native engine/resource budgets separately. Do not claim a universal1000-row limit from request validation. Native duplicate JSON keys are rejected422; duplicate or percent-encoded GET parameter names and fractional range bounds need their own native gateway controls and positive cases. The initial21-case receipt does not establish those later guards. Provision the native Prometheus data source HTTP method explicitly to match the gateway, rather than assuming Grafana's default.
|
||||
|
||||
Use a dedicated query principal restricted to the isolated lab organization and needed read paths. Never put OpenObserve root/admin credentials into Grafana. If native community roles cannot enforce the required read boundary, enforce exact actual query paths with the existing native gateway and verify allow/deny; do not claim a role restriction that the product does not implement. Limit unsigned loading to the exact checked plugin ID. Preserve standard TLS verification on each declared network hop.
|
||||
|
||||
Pinned1.1.2 OSS source forces ordinary POST `/api/default/users` creations to Admin even when viewer/user was requested. Do not use that route for the Grafana principal. The actual nonadmin initializer candidate is POST `/api/{org}/service_accounts` with email/first_name/last_name and a one-time token response; native auth and admin denial must be verified before final provisioning. Initial owner password policy is8..128 Unicode characters with lower/upper/digit ASCII and one other character. Capture issued service tokens privately in the same process; publish only safe shape/status evidence.
|
||||
|
||||
Native lab6 verification created two service accounts through that exact route: HTTP200 with code/message/token/user; both list as `service_account`. Both can search and ingest JSON, while both receive403 for admin token rotation. They are nonadmin identities, not native read-only or ingest-only roles. Enforce the query/ingest separation with the existing native HAProxy method/path boundary and closed raw listener; test the actual forbidden requests, not the account label. Never provision the initial owner credential to Collector or Grafana in the final configuration.
|
||||
|
||||
## Acceptance gates
|
||||
|
||||
1. Real current application emits all three signals; OpenObserve queries return their content and shared trace/span identifiers.
|
||||
2. Grafana displays metrics/histogram percentiles, structured logs and an actual trace waterfall including API, producer/consumer and worker spans; log/trace navigation resolves the same trace.
|
||||
3. Provisioned dashboards and alerts use the measured names/units and actual rule engine; high error rate, queue lag, SLO windows and firing/resolved transitions are tested with positive controls.
|
||||
4. Persistence/restart and storage outage preserve core API behavior with bounded SDK/Collector queues. Old on-disk evidence never becomes new PASS without execution.
|
||||
5. Lab7 additionally proves updated TLS/mTLS/identity/least-privilege and required native OpenBao lifecycle/rotation acceptance. Cached operator heartbeat evidence does not stand for OpenBao.
|
||||
6. Preserve initial source/config generation through build, runtime and packaging; exclude caches and verify the exact canonical archive boundary.
|
||||
|
||||
The user approved up to600 MB of new downloads on omarchy for the pinned Grafana13.3.1 image and existing OpenObserve plugin1.0.1. Lab6 performs one digest/SHA-verified download; lab7 reuses those exact cached artifacts without another download. The budget is our measured image/plugin size plus margin, not an assignment requirement. OpenBao image downloads and model downloads for SII remain separately pending and are not covered by this approval. Preserve earlier unapproved checkpoints as historical evidence.
|
||||
@@ -0,0 +1,3 @@
|
||||
# Shared boundary provenance
|
||||
|
||||
OPENOBSERVE-BOUNDARY.md is a byte-identical read-only copy of the canonical workspace source /Users/rey/mtuci/vp/OPENOBSERVE-BOUNDARY.md at this checkpoint. SHA-256: b44f91f0d9a41e04f1fcabb4424af98cad23a7f3d66ba304628517fd1095ce7f. The in-package copy makes the lab6 archive self-contained. Cross-subject ownership and later changes remain coordinated at the canonical source.
|
||||
Reference in New Issue
Block a user