Repository navigation
impl(028): OTLP export and the endpoint allowlist - #164
Conversation
AI review (findings)Reading through the diff, I'll focus on the endpoint parser, the OTLP exporter logic, the HTTP connector, and the stat-accounting changes in the sink worker.
|
01146e8 to
d4d98ac
Compare
be6f412 to
76bad2a
Compare
AI review (no-findings)Reviewing the PR, which adds OTLP export (gRPC and HTTP) to Endpoint allowlist ( OTLP exporter ( HTTP client ( Sink changes ( Spec increment: The prose in No concrete defects found. {"head": "76bad2adead48cbe1336d8049db632d9d47aea55", "verdict": "no-findings", "findings": []}Subject: d4d98ac...76bad2a, diff digest 4f250312622996f0f2fda388695d30f694fccf3ce169a2b79fd47e02314f7de7, 1 call(s). An AI comment is not an approval. |
AI review (no-findings)I'll review the PR carefully, focusing on security, correctness, and consistency.
The The two-stage design (allowlist construction accepts HTTP non-loopback entries;
Header secret containment
The connector performs no redirect logic; a 307 response propagates as an error from the exporter. The test
The
Spans and logs are now exported in separate calls; each signal is counted by what happened to it. The decision-loss accounting (
Spec increment text vs. code The spec text is consistent with the implementation: endpoint checked before any connection or DNS, env vars checked, redirect not followed, each signal counted separately, histograms delivered via No concrete defects found. {"head": "76bad2adead48cbe1336d8049db632d9d47aea55", "verdict": "no-findings", "findings": []}Subject: d4d98ac...76bad2a, diff digest 4f250312622996f0f2fda388695d30f694fccf3ce169a2b79fd47e02314f7de7, 1 call(s). An AI comment is not an approval. |
6b8fdae to
e7ec0ab
Compare
Spec 028, split from the single PR #151 (its AI review timed out at 15 minutes three times) into #151, #158 and #159 (merging in that order), then #160 (increment 5), #164 (increment 6) and #165 (increment 7). Each part is one signed commit and builds on its own; later parts are stacked on the branch below and rebased onto `main` after each merge. - Increment 5, `rustev trace tail` (3.11, amends spec 006): `--file`, `--trace-id`, `--redaction`, `--follow`, `--timeout-ms`, `--text`, with `rustev-contract` alone and no new CLI dependency; the reader's policy applies on top of the line's, and keys outside the catalogue are counted, never echoed. End-to-end tests through the binary over the goldens. Review responses (from the earlier #160 round on 6bf3bcd): `node` recursed with no cycle or depth bound; a span reached twice or deeper than 64 levels is now `invalid_input` naming the line, tested in `a_cyclic_or_too_deep_span_tree_is_invalid_input_not_a_crash`. Local verification on this head: `make gate`, `spec-spine couple` and `bash scripts/check-authored-content.sh` pass. CI runs code, verify and boundaries. Review response (round on 01146e8): the resource's withheld and uncatalogued attributes were counted into locals and dropped; the resource object now carries its own `withheld_by_reader` and `not_in_catalogue`, tested in `a_key_outside_the_catalogue_is_withheld_with_a_notice`.
76bad2a to
230e1eb
Compare
AI review (findings)Reviewing the OTLP export implementation added to Endpoint allowlist logic ( Header handling in Hardcoded
Redirect behaviour:
{"head": "230e1ebd14a3eaffaad0c62e9f900b30fb961559", "verdict": "findings", "findings": [{"path": "integrations/rustev-otel/src/otlp.rs", "line": null, "summary": "In http::build, config.headers is first validated by iterating the Vec but then converted to a HashMap that silently deduplicates on key; a caller with duplicate header names sees all entries validated but only the last value actually sent, so validation and export are inconsistent."},{"path": "integrations/rustev-otel/src/otlp.rs", "line": null, "summary": "OtlpExporter::export_logs hardcodes r.set_severity_number(Severity::Warn) for every log record while l.severity_text is taken from the record; if any LogRecord carries a severity_text that does not correspond to Warn level the exported OTLP data will have an inconsistent severity_number/severity_text pair."}]}Subject: 21a00fc...230e1eb, diff digest d13a42fac9c623d3d5842641540e7d932aa8ea3140056463986dda5cd70f00d6, 1 call(s). An AI comment is not an approval. |
230e1eb to
0b09035
Compare
AI review (findings)ReviewSecurity and design: endpoint allowlist (
|
0b09035 to
ad34aa9
Compare
Spec 028 increment 6 (3.2.3, 3.9.1 to 3.9.3): opentelemetry, opentelemetry_sdk and opentelemetry-otlp 0.33 behind the otlp-grpc and otlp-http features of rustev-otel, and the endpoint allowlist checked before anything is built or dialed.
ad34aa9 to
f256e34
Compare
AI review (no-findings)I reviewed the PR, which adds OTLP export over gRPC and HTTP ( Allowlist / security model (
Sink worker separation ( Spans and logs now export in separate calls; each signal is counted independently, and a decision is marked lost once under the first failing signal. The waiter receives
The helper silently maps invalid or short hex to 0. Applied to trusted internal span-line data, this produces
Findings summary: no concrete security vulnerabilities or logic defects found. All security-sensitive paths (allowlist enforcement before any DNS/socket, secret suppression, TLS choice, plaintext restriction, redirect non-follow) are correctly implemented and exercised by tests. {"head": "f256e345341388fe6454a29f14ae318ed7b642f3", "verdict": "no-findings", "findings": []}Subject: c103390...f256e34, diff digest 61e2342677f9746129690ba0cb55c84ba2ca5b875695189524919a7816bec25c, 1 call(s). An AI comment is not an approval. |
…on (#165) Spec 028, split from the single PR #151 (its AI review timed out at 15 minutes three times) into #151, #158 and #159 (merging in that order), then #160 (increment 5), #164 (increment 6) and #165 (increment 7). Each part is one signed commit and builds on its own; later parts are stacked on the branch below and rebased onto `main` after each merge. - Increment 7 (3.14, Acceptance): the redaction property test (200 seeded decisions, canaries in every text and identifier slot, generated policies; no canary of a `drop` field in any exported byte, raw or cut, and no raw canary of a `digest` field), the overhead benchmark `examples/overhead.rs` with its 100-decision smoke test, and the `verify:cli` block. Benchmark (`cargo run -p rustev-otel --release --all-features --example overhead`), 10 000 decisions per configuration alternating the two reference plans after 1 000 warm-up, concurrency 4 under `backpressure` (64 pending). CPU and RSS are the whole process, which also hosts the fake collector. No threshold is asserted (3.14.3). | Configuration | Decision p50 / p95 / p99 ms | `deliver` p50 / p99 ms | CPU ms per decision | Exported bytes per decision | Peak RSS KiB | Loss | |---|---|---|---|---|---|---| | (a) in-memory sink | 0.197 / 0.254 / 0.276 | 0.0001 / 0.0001 | 0.153 | 0 | 12 704 | 0 | | (b) no-op exporter | 0.180 / 0.234 / 0.250 | 0.603 / 0.846 | 0.722 | 0 | 14 672 | 0 | | (c) JSONL file | 0.206 / 0.427 / 0.536 | 0.730 / 1.595 | 1.336 | 22 657 | 28 784 | 0 | | (d) OTLP/gRPC, loopback | 0.187 / 0.249 / 0.266 | 0.633 / 0.885 | 0.874 | 13 566 | 31 008 | 0 | | (e) OTLP/HTTP, loopback | 0.188 / 0.252 / 0.279 | 0.623 / 0.904 | 0.834 | 13 561 | 32 464 | 0 | Loss is zero everywhere: no decision failure, no runtime sink failure, timeout or drop, no telemetry lost and none in flight at the end. Local verification on this head: `make gate`, `spec-spine couple` and `bash scripts/check-authored-content.sh` pass. CI runs code, verify and boundaries. Review response (round on b1ad15f): the finding read `exported_bytes_per_decision` as dividing warm-up-inclusive bytes by the wrong count. It does not: `bytes_start` is read before the warm-up, so the bytes cover all 11 000 decisions and dividing by 11 000 is right. The real inconsistency was the CPU figure: `cpu_start` is also read before the warm-up, but CPU time was divided by the 10 000 measured decisions. Both now divide by every decision run (a comment in `overhead.rs` says so). The CPU column above is the earlier run's CPU time divided by 11 000 instead of 10 000 (each value times 10/11), not a new run; bytes, latency and RSS are unchanged.
Spec 028, split from the single PR #151 (its AI review timed out at 15 minutes three times) into #151, #158 and #159 (merging in that order), then #160 (increment 5), #164 (increment 6) and #165 (increment 7). Each part is one signed commit and builds on its own; later parts are stacked on the branch below and rebased onto
mainafter each merge.opentelemetry,opentelemetry_sdkandopentelemetry-otlp0.33 withdefault-features = false, used only byrustev-otelbehindotlp-grpcandotlp-http; noreqwest, nointernal-logs, default features empty.endpointrefuses, before anything is built or dialed, an origin not exactly in the list, an empty list, user information, wildcards, plaintext to anything but a loopback IP literal, and anOTEL_*endpoint variable naming an origin outside the list. Redirects are never followed. Loopback fake collectors on h2 and hyper.Owner decisions:
ca_pem, HTTP with given roots or the Web PKI roots) are compiled and type-checked but not exercised by a test: the workspace has no certificate generator. The tests run plaintext to loopback only. The spec record says so.Local verification on this head:
make gate,spec-spine coupleandbash scripts/check-authored-content.shpass. CI runs code, verify and boundaries.Review response (round on be6f412): an unbracketed IPv6 literal (
http://::1:4318) parsed, its last colon read as the port separator; a colon left in the host outside brackets is nowMalformed("an IPv6 literal outside brackets"), tested inendpoint::tests::refusals. Bracketed literals (http://[::1]:4317) are unchanged.Review responses (round on 230e1eb):
HeaderMap::insertoverwrote), so one value was silently dropped. A name given twice, compared case-insensitively, is nowOtlpError::DuplicateHeaderbefore anything is built; tested inheader_values_never_appear_in_errors_or_debug.export_logssetSeverity::Warnregardless of the record. It now maps the record's ownseverity_number(1 to 24) to the OpenTelemetry severity, leaving an out-of-range number unspecified; unit-tested inotlp::tests. The sink writes onlyWARN/13 today, so exported bytes are unchanged.Review response (round on 0b09035): the finding read "3.12" in the workspace
Cargo.tomlcomment as a typo. It is not: spec 028 3.12 is "Dependency boundary", the amendment of spec 001 3.5 that forbids everyopentelemetry*package outsideintegrations/(the rulemake boundariesenforces). The comment now names both cited sections by title so the citation is checkable from the diff.