Skip to content

event-exporter-rs (2/3): add pure-Rust HTTP/gRPC transport, GKE auth, batch pipeline, and dual sinks - #1304

Draft
zxqlxy wants to merge 2 commits into
GoogleCloudPlatform:masterfrom
zxqlxy:event-exporter-rs-pr2
Draft

zxqlxy wants to merge 2 commits into
GoogleCloudPlatform:masterfrom
zxqlxy:event-exporter-rs-pr2

Conversation

@zxqlxy

@zxqlxy zxqlxy commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary (Part 2 of 3)

Adds pure-Rust HTTP/2 + gRPC networking, GKE credential rotation, the byte-bounded micro-batching pipeline, and dual Cloud Logging v2 (/v2/entries:write) + OpenTelemetry OTLP (LogsService/Export) export sinks to event-exporter-rs.

Review note: Stacked on #1303. Until #1303 merges into master, review only the Part 2 commit (27f5c95).

Included in Part 2

  • src/transport.rs & src/otlp_proto.rs: Pure-Rust reqwest + rustls HTTP/2 client (preserving localhost, 169.254.0.0/16, and metadata.google.internal NO_PROXY bypasses on private GKE nodes) and tonic/prost OTLP LogsService/Export gRPC client.
  • src/auth.rs: GKE NodeTokenBroker external-account STS token exchange (GOOGLE_APPLICATION_CREDENTIALS), direct token-broker URL support, GCE Metadata Server fallback, K8s ServiceAccount bearer rotation, and --universe-domain endpoint resolution.
  • src/sink.rs & src/pipeline.rs: Byte-bounded (16 MiB default) batch export queue with jittered backoff, gzipped Cloud Logging /v2/entries:write JSON sink, and OTLP gRPC/HTTP sink mapping gRPC statuses (0 -> 200, 7 -> 403, 8 -> 429) onto stackdriver_sink_request_count.
  • tests/: OTLP protobuf round-trip tests, live tonic gRPC server + partial_success integration test, NodeTokenBroker STS + Metadata discovery tests, and event-to-sink freshness latency tests.

Stack

  1. Part 1 (event-exporter-rs (1/3): add core crate, CLI/sharding, 24B PodOwnerTable, enricher, and metrics #1303): Core crate, CLI/sharding, PodOwnerTable, enricher, and metrics
  2. Part 2 (event-exporter-rs (2/3): add pure-Rust HTTP/gRPC transport, GKE auth, batch pipeline, and dual sinks #1304, this PR): Pure-Rust HTTP/gRPC transport, GKE auth, batch pipeline, and dual sinks
  3. Part 3 (event-exporter-rs (3/3): add streaming K8s WatchList, binary entrypoint, Dockerfile, and E2E tests #1305): Streaming K8s WatchList reflector + 410 Gone recovery, binary entrypoint, Dockerfile, and multi-shard E2E suite

…nricher, and metrics

Part 1 of 3 introducing `event-exporter-rs`, a `#![forbid(unsafe_code)]` pure-Rust
Kubernetes Event exporter for GKE:

- `src/cli.rs` & `src/shard.rs`: Drop-in parser for GKE single-dash Go flags
  (`-sink-opts`, `-universeDomain`, `-system-namespaces`, `-event-label-selector`)
  plus KEP-5866 `--shard-mode=server` and Jump Consistent Hash `--shard-mode=client`
  Pod/Event co-partitioning.
- `src/pod_cache.rs`: Lock-sharded open-addressed 24-byte/slot `PodOwnerTable`
  (`16B PodKey` + `8B CompactOwner`) resolving `Deployment`, `StatefulSet`,
  `DaemonSet`, `CronJob`, `Job`, and `JobSet` (`restart-attempt` + `jobset-uid`)
  owners while holding 1,000,000 active Pods in ~50.4 MiB RSS delta (~58.8 MiB
  total process RSS vs. >1.2 GiB in Go `client-go`).
- `src/enricher.rs` & `src/metrics.rs`: Cloud Logging `k8s_pod`/`k8s_node`/`k8s_cluster`
  routing, cross-namespace RBAC spoofing guard, `fieldBlacklist` filtering,
  Gregorian RFC3339 validation, and 100% LOrIS Prometheus metric compatibility.
- Formal state-machine refinement, sharding bijection, and 1,000,000-pod memory
  benchmark suites, wired into GitHub Actions (`ci-rust-event-exporter`).
… pipeline, and dual sinks

Part 2 of 3 adding networking, GKE credential rotation, bounded batching, and
Cloud Logging v2 + OpenTelemetry OTLP export sinks:

- `src/transport.rs` & `src/otlp_proto.rs`: Pure-Rust `reqwest` + `rustls` HTTP/2
  client (honoring GKE private-node `HTTP_PROXY`/`NO_PROXY` exemptions for
  `169.254.0.0/16` and `metadata.google.internal`) and `tonic`/`prost` OTLP
  `LogsService/Export` gRPC client.
- `src/auth.rs`: GKE `NodeTokenBroker` external-account STS exchange
  (`GOOGLE_APPLICATION_CREDENTIALS`), direct token-broker URL support, GCE
  Metadata Server fallback, K8s SA bearer rotation, and `--universe-domain`
  endpoint resolution.
- `src/sink.rs` & `src/pipeline.rs`: Byte-bounded (`16 MiB` default) micro-batch
  export queue with retry/jitter backoff, gzipped Cloud Logging `/v2/entries:write`
  JSON sink, and OTLP gRPC/HTTP sink preserving LOrIS status & freshness metrics.
@zxqlxy
zxqlxy force-pushed the event-exporter-rs-pr2 branch from 27f5c95 to 3274185 Compare November 11, 2026 02:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant