Skip to content

bookingcom/nanotube

Repository files navigation

Nanotube: data router for Graphite

CI Go Report Card

This is the router (or relay, or reverse-proxy) for Graphite. It routes incoming records according to the specified rules. The Nanotube is designed for high-load systems. It is used at Booking.com to route up to a million incoming records/sec on a single box with a typical production config.

Build and run

  1. Clone the repo.
  2. Navigate to it and run make to build.
  3. Run it with
./nanotube -config config/config.toml

Command line options:

-config string
    Path to config file.
-validate
    Validate configuration files.
-version
    Print version info.
-confighash
    Print config hash info.

Go version

The supported Go version is 1.21 or newer. We're usually support current go version and two previous releases.

Supported platforms

are Linux and Darwin.

Record structure

The main supported protocol is line. The records have the structure:

path.path.path value datetime

See here for more details.

The support of Open Telemetry gRPC is experimental.

Zero-downtime reload

Nanotube supports zero-downtime reload that can be triggered with USR2 signal. It will update the binary and try to load updated config. If the config is invalid, the old instance will keep running.

Tags support

Tags are not supported. See [here]](#4) for details.

Design

Design details are in the design doc.

OpenTelemetry

We support OpenTelemetry by using v0.7.0 of protobuf protocol.

K8s support

Nanotube can run as a daemonset in k8s. It can play a role of the submission sidecar by injecting ports into tagged pods. See Nanokube doc for more info.

Acknowledgment

This program was originally developed for Booking.com. With approval from Booking.com, the code was generalized and published as Open Source on GitHub, for which the authors would like to express their gratitude.