# Topic statistics and libstatistics\_collector removed from rclcpp in Rolling (Makoa Mata-mata)

**URL:** <https://discourse.openrobotics.org/t/topic-statistics-and-libstatistics-collector-removed-from-rclcpp-in-rolling-makoa-mata-mata/59481>\
**Category:** Projects\
**Tags:** rclcpp, rolling, makoa\
**Created:** [November 3, 2026, 1:20pm UTC](https://discourse.openrobotics.org/t/topic-statistics-and-libstatistics-collector-removed-from-rclcpp-in-rolling-makoa-mata-mata/59481 "2026-11-03T13:20:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ahcorde](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/ahcorde/32/36216_2.png) [@ahcorde](https://discourse.openrobotics.org/u/ahcorde)\
**Post date:** [November 3, 2026, 1:20pm UTC](https://discourse.openrobotics.org/t/topic-statistics-and-libstatistics-collector-removed-from-rclcpp-in-rolling-makoa-mata-mata/59481/1 "2026-11-03T13:20:55Z")

</div>

Hi everyone,

Heads-up about an API removal that recently landed in Rolling and will be part of **ROS 2 Makoa Mata-mata** (May 23, 2027): built-in **topic statistics** have been removed from `rclcpp`, and **`libstatistics_collector`** is no longer part of the ROS 2 core.

## What changed

The following PRs were merged on October 5, 2026:

- [ros2/rclcpp#3203](https://github.com/ros2/rclcpp/pull/3203): removes the topic statistics implementation from `rclcpp`, `rclcpp_lifecycle` and `rclcpp_components`
- [ros2/ros2#1878](https://github.com/ros2/ros2/pull/1878): removes `libstatistics_collector` from `ros2.repos`
- [ros2/demos#812](https://github.com/ros2/demos/pull/812): removes the `topic_statistics_demo` package
- [ros2/examples#476](https://github.com/ros2/examples/pull/476): removes the `MinimalSubscriberWithTopicStatistics` example
- [ros2/ros2\_documentation#7245](https://github.com/ros2/ros2_documentation/pull/7245): removes the topic statistics tutorial and concept pages from the Rolling docs

## Why

- **Hardly anyone was using it.** Recent bug reports suggested the feature saw very little real-world use.
- **There’s a better way to get this data.** At ROSCon we discussed providing an interface so a third-party package could plug the old behavior back in. We decided not to: tooling that hooks into the existing tracepoints (`tracetools` / [ros2\_tracing](https://github.com/ros2/ros2_tracing)) can collect the same information without adding code and cost to every subscription.
- **Faster builds.** `rclcpp` no longer depends on `libstatistics_collector` and `statistics_msgs`, and fewer templates end up in every subscription. Compiling a simple node with one publisher and one subscription went from **6.32 s to 4.91 s** (about 22% faster, measured on a Ryzen 9900X).

Overall, the change removes around 2,400 lines of code.

## Am I affected?

Only if you use the C++ topic statistics API. In that case your code will **no longer compile against Rolling**. These are removed:

| Removed | Where |
| --- | --- |
| `NodeOptions::enable_topic_statistics()` (getter and setter) | `rclcpp/node_options.hpp` |
| `SubscriptionOptions::topic_stats_options` (`TopicStatisticsOptions`: `state`, `publish_topic`, `publish_period`, `qos`) | `rclcpp/subscription_options.hpp` |
| `rclcpp::TopicStatisticsState` | `rclcpp/topic_statistics_state.hpp` |
| `rclcpp::topic_statistics::SubscriptionTopicStatistics` | `rclcpp/topic_statistics/subscription_topic_statistics.hpp` |
| `NodeBaseInterface::get_enable_topic_statistics_default()`, and the `enable_topic_statistics_default` argument of the `NodeBase` constructor | `rclcpp/node_interfaces/` |
| The `enable_topic_statistics` extra argument when loading a component | `rclcpp_components` |

Note that the last two items also affect you if you implement your own `NodeBaseInterface`, or if your launch files pass `enable_topic_statistics` as an extra argument to a composable node.

Also, nothing publishes on the `/statistics` topic anymore. Tools or dashboards that subscribe to it will stop receiving data.

The `statistics_msgs` message package itself is **not** removed. It lives in `rcl_interfaces`, so existing tools that use those messages keep building.

## How to migrate

1. **Remove the API calls** listed above. For most users that’s deleting `options.topic_stats_options.state = rclcpp::TopicStatisticsState::Enable;` (or `.enable_topic_statistics(true)`) and the related includes.
2. **Collect statistics from tracepoints instead.** `rclcpp` already emits tracepoints on every publish and every subscription callback, which give you message rates, periods and latencies without changing your nodes:
  - [ros2\_tracing](https://github.com/ros2/ros2_tracing) to record traces and analyze them offline.
  - Community tools built on the same instrumentation are already appearing. For example, [ros2\_pulse](https://github.com/TanayK07/ros2_pulse) reports live topic rates, can export to Prometheus and Grafana, and can even publish `statistics_msgs` on `/statistics` if you have tooling that depends on it.

3. **Need it on older distros?** Nothing changes for Humble, Jazzy, Kilted or Lyrical: topic statistics are still there. The removal only applies to Rolling and to Makoa Mata-mata onwards.

## Feedback welcome

During review, @tomoyafujita raised good points: whether this should have gone through a deprecation period first, and whether a longer-term statistics hook should live at the `rcl` level, so `rclpy` and other client libraries, plus services and actions, could share one mechanism.

We went with a direct removal because the feature had so few users and we’re early in the Makoa cycle, which leaves plenty of time to react before the release. **If you depend on topic statistics in production, please reply here.** We’d like to hear what you’re using it for, so we can point you to the right replacement or document a migration path.

Thanks to @jmachowinski for driving this cleanup, and to everyone who reviewed it and joined the discussion at ROSCon.

Alejandro
