Files
zeekay c3dc2f1ecf Read the event plane, not what it replaced
HIP-0132 unified o11y_logs, o11y_traces and o11y_metrics into one `event`
database and dropped them. The commit that restored the reads repointed
three files and said so; it was thirty. The rest went on naming databases
that no longer exist, so trace funnels, the Kafka and queue panels, the
v3/v4 logs and traces builders and the PromQL adapter each answered
Code: 81 UNKNOWN_DATABASE, and the golden tests agreed with them because
they pinned the same dead SQL.

pkg/telemetryplane is the one address for the name, imports nothing, and
is reachable from every depth that needs it. Its test walks the tree and
fails the build on a literal that names a dropped database, tests
included — a golden encoding broken SQL is a second vote for the bug, not
coverage.

Two service views turned a failed read into an offer to instrument an
already-instrumented application. A failure now shows the failure, and
onboarding is offered on a successful empty read.

Cherry-picked from salvage/blue-wt-o11y-readers 83ecbec03c.
2026-09-08 23:07:06 -07:00

39 lines
1.6 KiB
Go

package implerrortracking
import (
"context"
"github.com/hanzoai/o11y/pkg/types/errortrackingtypes"
"github.com/hanzoai/o11y/pkg/valuer"
)
// OccurrenceSink is the OPTIONAL bridge that would also persist each occurrence to
// the shared telemetry store (event.log as an ERROR-severity record) for OTel-native
// drill-down. It is deliberately a seam, and the default is NoopSink:
//
// - Authoritative storage is o11y_issues — the grouped issue plus the latest
// occurrence sample. Error capture is fully viewable with the no-op sink; the
// sink is enrichment, not the source of truth.
// - When a real sink is wired, its write is fail-soft at the call site: a
// telemetry-store hiccup must never drop the durable issue upsert.
//
// NOTE (honest status): the Datastore logs sink is NOT implemented in this build —
// only NoopSink exists. A raw logs_v2 INSERT couples to resource-fingerprint /
// ts-bucket schema that must be byte-verified against a LIVE datastore, not
// reconstructed, so it is a deliberate fast-follow. Today occurrences are NOT
// written to the telemetry store; the count and the latest sample live on the
// issue row.
type OccurrenceSink interface {
Write(ctx context.Context, orgID valuer.UUID, occ *errortrackingtypes.Occurrence) error
}
// NoopSink discards occurrences. It is a complete, correct sink for the MVP: the
// authoritative issue (with its latest sample) is persisted independently.
type NoopSink struct{}
func NewNoopSink() OccurrenceSink { return NoopSink{} }
func (NoopSink) Write(context.Context, valuer.UUID, *errortrackingtypes.Occurrence) error {
return nil
}