Weibo
SDK

Errors and Observability

Failure policies, backpressure metrics, and the dashboard.

Process errors

Use Process when a transform can fail.

stream.Process(fn,
    operator.WithProcessFailurePolicy(operator.ProcFailureDLQ),
    operator.WithProcessDLQ(dlqSink),
)

Use Fail policies for data that must not be skipped. Use DLQ policies when bad records should be retained for later inspection.

Sink errors

Kafka and Postgres sinks support retry and failure policy options. After retries are exhausted, the configured policy decides whether the record is dropped, sent to DLQ, or fails the pipeline.

Backpressure

Weibo uses bounded channels between execution stages. If a sink is slow, its input edge fills. The previous stage blocks while sending, and that pressure propagates back to the source. This bounds memory without dropping records.

Tune the edge capacity with:

env := weibo.NewEnv().WithBufferSize(2048)

Metrics

Weibo records Prometheus metrics for pipeline, stages, edges, operators, and workers.

Important metrics:

MetricMeaning
weibo_edge_queue_sizeCurrent buffered records on an edge.
weibo_edge_queue_capacityEdge capacity.
weibo_stage_records_in_totalRecords entering a stage.
weibo_stage_records_out_totalRecords leaving a stage.
weibo_stage_send_block_seconds_totalTime blocked on downstream backpressure.
weibo_stage_workersActive worker count for a stage.
weibo_stage_errors_totalStage errors.

Dashboard

The dashboard package exposes pipeline structure and metrics for live inspection. Labels passed to SDK operators are used in dashboard metadata:

stream.Filter(isCompleted, "completed-orders")

On this page