Sinks

Sinks control where your Rerun data goes. They are the output destinations for your logged data.

When you log data with Rerun, that data needs to flow somewhere, whether that's to a live viewer, a file on disk, memory, or multiple destinations at once. Sinks provide this routing layer, giving you flexible control over how and where your recordings are stored and displayed.

Available sink types available-sink-types

Rerun provides several built-in sink types, each designed for specific use cases:

GrpcSink grpcsink

Streams data to a Rerun Viewer over gRPC. This is the most common sink for live visualization.

"""Create and set a GRPC sink."""

import rerun as rr

rr.init("rerun_example_grpc_sink")

# The default URL is `rerun+http://127.0.0.1:9876/proxy`
# This can be used to connect to a viewer on a different machine
rr.set_sinks(rr.GrpcSink("rerun+http://127.0.0.1:9876/proxy"))

FileSink filesink

Writes data to .rrd files on disk.

"""Create and set a file sink."""

import rerun as rr

rr.init("rerun_example_file_sink")

rr.set_sinks(rr.FileSink("recording.rrd"))

Multiple sinks (Tee pattern) multiple-sinks-tee-pattern

One of the most powerful features of Rerun's sink system is the ability to send data to multiple destinations simultaneously. This "tee" pattern lets you both visualize data live and save it to disk in a single run.

"""Log some data to a file and a Viewer at the same time."""

import numpy as np
import rerun as rr

# Initialize the SDK and give our recording a unique name
rr.init("rerun_example_set_sinks")

rr.set_sinks(
    # Connect to a local viewer using the default URL
    rr.GrpcSink(),
    # Write data to a `data.rrd` file in the current directory
    rr.FileSink("data.rrd"),
)

# Create some data
SIZE = 10

pos_grid = np.meshgrid(*[np.linspace(-10, 10, SIZE)] * 3)
positions = np.vstack([d.reshape(-1) for d in pos_grid]).T

col_grid = np.meshgrid(*[np.linspace(0, 255, SIZE)] * 3)
colors = np.vstack([c.reshape(-1) for c in col_grid]).astype(np.uint8).T

# Log the data
rr.log(
    # name under which this entity is logged (known as "entity path")
    "my_points",
    # log data as a 3D point cloud archetype
    rr.Points3D(positions, colors=colors, radii=0.5),
)

This pattern is useful when:

  • You want to monitor a long-running process while archiving the data
  • You're debugging and want both live feedback and a recording to analyze later
  • You need to stream to multiple viewers or save to multiple files

See also see-also