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

49 lines
2.2 KiB
Go

package telemetrylogs
import "github.com/hanzoai/o11y/pkg/telemetryplane"
// Logs live in the ONE event database beside the other signals, as event.log:
// singular, because a row is one log line. It carries the same 15-column envelope as
// event.event / event.error / event.span, and is sorted (org, service, time) — the
// order a log read actually wants, with the tenant leading.
//
// There are no Distributed wrappers on this deployment, so the distributed and local
// name of a table are the same string. The pair is kept because the query builders
// distinguish the two roles.
const (
DBName = telemetryplane.DBName
LogTableName = "log"
LogLocalTableName = "log"
// SkipIndexTableName is the datastore's own introspection table, not ours.
SkipIndexTableName = "system.data_skipping_indices"
)
// The supporting tables of the logs signal — attribute and key autocomplete, resource
// fingerprints. Their shapes are defined in schema.sql beside this file, and the first
// four below are applied to the event database.
//
// The scheme: a table that SUPPORTS a signal is prefixed by that signal, which is what
// keeps log_attribute and span_attribute apart now that both planes share one database.
const (
LogAttributeTableName = "log_attribute"
LogAttributeLocalTableName = "log_attribute"
LogKeyTableName = "log_key"
LogResourceKeyTableName = "log_resource_key"
LogResourceTableName = "log_resource"
)
// These two are declared but NOT applied, because nothing reads them: log_path was
// distributed_json_path_types and log_promoted was distributed_json_promoted_paths,
// and neither had a SELECT against it before the rename either. The JSON-body
// promotion path reads telemetrymetadata.PromotedPathsTableName — a same-named
// constant in a different package, which is why a naive grep looks like this one has
// readers. Creating them would mean guessing a column set; a query through a missing
// table fails loudly, while a table with the wrong columns fails silently and corrupts
// the lens reading it. They are created the day a reader defines their shape.
const (
LogPathTableName = "log_path"
LogPromotedTableName = "log_promoted"
)