Files
68ce98920a feat(zap): native ZAP-transport OTLP receiver + exporter (#4)
* feat(zap): native ZAP-transport OTLP receiver + exporter

Adds ZAP-native telemetry ingestion/forwarding over github.com/zap-proto/http
(the Hanzo ZAP wire — capnp frames, X-Wing PQ-KEM handshake), NOT OTLP-HTTP
(:4318) or OTLP-gRPC (:4317). The payload stays standard OTLP protobuf so full
OTel fidelity + pipeline interop are preserved; only the transport is ZAP.

- receiver/zapreceiver: runs a zaphttp.Server on :4319, terminates OTLP over
  the ZAP wire on /v1/{traces,logs,metrics}, decodes to pdata, pushes to the
  pipeline (-> ClickHouse exporters -> hanzoai/datastore). ObsReport transport
  label is "zap". One listener serves all three signals.
- exporter/zapexporter: pdata -> OTLP proto -> zaphttp POST to a peer collector's
  ZAP receiver (used by the filelog log-agent to ship node logs over ZAP).
- Registered in components.go alongside otlpreceiver (OTLP retained as an
  interop endpoint for third-party SDKs).

Tests: TestZapReceiverAllSignals (traces+logs+metrics e2e over the real ZAP
wire) and TestExportTracesOverZAP both green; full ./components build clean.

* build(zap): self-building multi-stage Dockerfile for in-cluster Kaniko/BuildKit

The default Dockerfile COPYs a CI-prebuilt binary; this compiles in-image so an
in-cluster BuildKit/Kaniko job (platform.hanzo.ai) can produce the ZAP-enabled
image without the (currently broken) GitHub reusable workflow.

---------

Co-authored-by: hanzo-dev <[email protected]>
2026-07-03 14:56:33 -07:00

29 lines
959 B
Go

package zapexporter
import (
"errors"
"go.opentelemetry.io/collector/config/configoptional"
"go.opentelemetry.io/collector/config/configretry"
"go.opentelemetry.io/collector/exporter/exporterhelper"
)
// Config configures the ZAP-native OTLP exporter.
type Config struct {
// Endpoint is the host:port of the target collector's ZAP receiver
// (zap-proto/http wire). e.g. "otel-collector.hanzo.svc:4319".
Endpoint string `mapstructure:"endpoint"`
TimeoutConfig exporterhelper.TimeoutConfig `mapstructure:",squash"`
BackOffConfig configretry.BackOffConfig `mapstructure:"retry_on_failure"`
QueueBatchConfig configoptional.Optional[exporterhelper.QueueBatchConfig] `mapstructure:"sending_queue"`
}
// Validate implements component.ConfigValidator.
func (c *Config) Validate() error {
if c.Endpoint == "" {
return errors.New("zapexporter: endpoint must be set")
}
return nil
}