Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,7 @@ otel_collector_benchmark/benchmark_results/
# e2esdkbench compiled binary
opentelemetry-app/e2esdkbench
deploy/scripts/__pycache__/

# Cross-language parity fixtures — generated locally via
# `GOLDEN_REGEN=1 go test -run TestGenerateGolden ./integration/parity/...`
integration/parity/golden/*.bin
2 changes: 1 addition & 1 deletion asap-precompute-go/observation.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// by `docs/adr/adr-0002-extract-precompute-runtime.md`.
//
// This package owns the windowing, snapshot caching, and delta
// encoding state machine that today lives inside each OTel
// encoding runtime logic that today lives inside each OTel
// processor in `opentelemetry-collector-contrib-patch/processor/`.
// Per-platform Adapter implementations (the Layer-4 shims) translate
// their host's native event into Observation, hand it to a
Expand Down
2 changes: 1 addition & 1 deletion asap-precompute-go/precompute.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ var (
ErrSketchTypeMismatch = errors.New("precompute: envelope sketch_type does not match config")
)

// Precompute is the host-neutral state machine described in
// Precompute is the host-neutral runtime described in
// design-doc §6.2. One Precompute instance owns one sketch type
// (see config.SketchType); a deployment with multiple sketch types
// runs multiple Precompute instances side-by-side.
Expand Down
2 changes: 1 addition & 1 deletion asap-precompute-go/sketches/countsketch.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ func (o CountSketchObserver) Observe(s precompute.Sketch, v precompute.Observati
}

// Compile-time assertions that CountSketchWrapper satisfies both the
// base Sketch trait (used by the runtime's window state machine) and
// base Sketch trait (used by the runtime's window logic) and
// the FrequencySketch query trait (used by adapter code that needs
// typed frequency queries).
var (
Expand Down
8 changes: 4 additions & 4 deletions asap-precompute-rs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ edge precompute runtime described in
[ADR-0002](../docs/adr/adr-0002-extract-precompute-runtime.md).

This crate owns the windowing, snapshot caching, and delta encoding
state machine that today lives inside `ASAPQuery-backend`'s ingest
runtime logic that today lives inside `ASAPQuery-backend`'s ingest
path (`asap-query-engine/src/precompute_operators/*.rs` and
`drivers/ingest/otel.rs::apply_modified_otlp_delta_bytes`).
Per-platform Adapter implementations (the Layer-4 shims) translate
Expand All @@ -20,10 +20,10 @@ back to the host's native event.

This PR is the **bootstrap**: types, traits, and basic struct
skeletons. The API surface mirrors `asap-precompute-go` 1:1 so the
state-machine migration from `ASAPQuery-backend`'s ingest path lands
runtime migration from `ASAPQuery-backend`'s ingest path lands
in subsequent PRs (Phase 3 step 2+) against a stable contract.

State-machine methods (`Precompute::observe`, `observe_envelope`,
Runtime methods (`Precompute::observe`, `observe_envelope`,
`tick`, `drain`, `WindowState::*`, `SnapshotCache::compute_delta`)
are `unimplemented!()` and reference the Go file they migrate from.

Expand Down Expand Up @@ -78,5 +78,5 @@ cargo fmt --check
```

All four must pass. Tests today are type-level (constructors, trait
impls, serde round-trip); behavioral tests for the state machine
impls, serde round-trip); behavioral tests for the runtime
arrive with the migration in Phase 3 step 2.
21 changes: 8 additions & 13 deletions asap-precompute-rs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,18 @@
//! `docs/design-asap-edge-framework.md` §6 and pinned by ADR-0002.
//!
//! This crate owns the windowing, snapshot caching, and delta encoding
//! state machine that today lives inside `ASAPQuery-backend`'s ingest
//! path (`asap-query-engine/src/precompute_operators/*.rs` +
//! `drivers/ingest/otel.rs::apply_modified_otlp_delta_bytes`).
//! runtime for the Rust **edge** runtime — a bit-identical
//! mirror of `asap-precompute-go`'s runtime. Future Rust-based
//! edge agents (Vector adapter, OTAP-Rust, Arrow-backed shims)
//! consume this crate. The backend's precompute engine inside
//! `ASAPQuery-backend` is a separate concern with its own design and
//! is **not** consumed by this crate.
//!
//! Per-platform Adapter implementations (the Layer-4 shims) translate
//! their host's native event into [`Observation`], hand it to a
//! [`Precompute`], and translate the runtime's emitted
//! [`SketchEnvelope`] back to the host's native event.
//!
//! # Bootstrap status (Phase 3 step 1)
//!
//! This module is currently the **bootstrap skeleton** — types and
//! trait surface only. State-machine methods (window rotate, observe
//! routing, snapshot/delta computation, scheduler) are defined as
//! `unimplemented!()` and migrate from `ASAPQuery-backend`'s ingest
//! path in subsequent PRs (Phase 3 step 2+). The API surface here is
//! the contract those migrations must hit so the cross-PR work stays
//! safe.
//!
//! # Mirror map to `asap-precompute-go`
//!
//! | Go file | Rust module |
Expand All @@ -47,6 +41,7 @@ pub mod envelope;
pub mod matchers;
pub mod observation;
pub mod precompute;
pub mod sketches;
pub mod snapshot_cache;
pub mod window;

Expand Down
Loading