Skip to content
Stand with Ukraine flag

Gateway custom statistics

  • Widget
  • v1.0.0
  • Sep 1, 2026
  • MIT license
  • v4.2+ | Built-in

Allows users to create and display custom statistic data for the gateway in real-time.

Widget Type
  • Timeseries
Category
  • Charts & Graphs
Use Cases
  • Industrial Automation

Who it’s for

Engineers running a ThingsBoard IoT Gateway who have defined their own statistic beyond the built-in service metrics — a per-connector message count, a queue depth, a protocol-specific error tally. The built-in gateway charts cover the standard measures; this one charts whatever the gateway has been configured to publish.

What it does

The Gateway custom statistics widget plots custom statistic data the gateway publishes, in real time, on a time series chart. Once the gateway is configured to report a counter, pointing this widget at that key charts it exactly as the built-in statistics are charted, with a legend, a configurable axis and stacking where the parts add up.

  • Custom counters get first-class treatment — the same charting as the built-in metrics, without a bespoke widget.
  • Several custom series share one chart, so related counters are compared rather than scattered across tiles.
  • Stacking is available where the series are components of a total, such as messages per connector.
  • The chart follows the dashboard’s time window, so it serves both a live watch and an investigation.
  • The Gateway custom statistics widget only charts what the gateway sends: defining the statistic is a gateway configuration task, not a widget setting.

How to set up

Data keys

The Gateway custom statistics widget takes one series per data key from the gateway device.

KeyRoleTypeDescription
Custom statistic keysOne plotted seriesTimeseriesThe telemetry keys the gateway publishes for its custom statistics. Point the datasource at the gateway device and select the keys it reports.

Configure the custom statistic on the gateway first, then confirm the key appears in the gateway device’s telemetry. The widget charts a key that exists and renders an empty series for one that does not, so a blank chart usually means the gateway side is incomplete rather than the widget being misconfigured.

How to customize

  • To read a total and its parts together — turn on stacking for counters that sum, such as per-connector message counts.
  • To fix the scale — set the Y axis minimum and maximum so a quiet period does not look as busy as a loaded one.
  • To label the axis — set its title and tick formatting to the unit the counter is in.
  • To move or drop the legend — set the legend position, or turn it off when a single counter is charted.
  • To show every series at one moment — switch the tooltip to report all series rather than the hovered one.

Tips

  • Name the custom statistic keys on the gateway the way they should read on the chart. The key name becomes the series label, and renaming it later on the gateway side breaks the widget’s key selection rather than just relabelling it.
  • Chart custom counters against a built-in metric such as bytes sent. A connector counter that keeps climbing while transfer stays flat points at the gateway’s queue rather than at the connection, and that comparison needs both series on one time axis.

Share Your Widget with the Community

Built a custom widget? Export it as a JSON from ThingsBoard and publish it to the IoT Hub through a simple 4-step wizard (Upload, Listing, Readme, Review & Submit). Share it with thousands of ThingsBoard developers worldwide and get featured in the catalog.