Explainer
Why an MQTT collector ignores Sparkplug dataset objects
Short answer
A Sparkplug dataset object carries several rows and columns under one metric name, while the collector's path into the historian maps one typed value to one tag name, so the table has nowhere to go. For the Canary MQTT Collector in release 22.3.0.22342 the documented answer is that dataset objects are unsupported. Flatten the table into individual typed metrics at the publisher, or store the whole payload as one string tag.
On this page
- What a dataset object puts inside one metric
- Why one value per tag name leaves no room for a table
- The documented answer for one collector release
- The JSON path has the same single-value limit
- Flattening the 2-row, 4-column dataset into single-value metrics
- Deciding between flattened metrics and one string tag
- Questions asked
A collector that stores ordinary Sparkplug metrics and skips dataset objects is not dropping messages: it is declining a data type. A dataset object packs multiple rows and columns under a single metric name, while the collector's path into the historian maps one typed value to one tag name, so the table has nowhere to go. For the Canary MQTT Collector in the reported release 22.3.0.22342, the vendor's answer was direct: dataset objects are unsupported. The workable fixes are publisher-side — flatten the table into individual typed metrics, or accept the whole payload as one string tag.
What a dataset object puts inside one metric #
Sparkplug B sends each measurement as a metric: a named, typed object whose datatype travels as an unsigned integer — 9 is Float — with one value in the payload. Identity is scalar too: one name and one alias per metric, and after BIRTH the alias alone can carry an update.
A dataset metric keeps the same envelope of name, timestamp, datatype and properties, but its datatype is DataSet and the value holds a table described by rows, numberOfColumns, columnNames and types. The sample published in the reported case: name Site/Area/Device/datasettag, numberOfColumns 4, columnNames Col1 through Col4, types Int32, Float, Boolean and String, and two rows — [10, 10.1, true, "one"] and [20, 20.2, false, "two"]. One name, one timestamp, eight typed cells.
The construct is in the specification, not a vendor extension: the reported case cites rev. 2.2, chapter 15.1.7. The publisher is standards-compliant; the limitation sits with whatever has to store it. An MQTT broker forwards those bytes without interpreting them — MQTT broker support is not Sparkplug support — so broker-side checks tell you nothing about payload-type handling.
Why one value per tag name leaves no room for a table #
A historian tag is a name bound to a series of single values, each stamped with time and quality. Turning the table into history means deciding, for every cell, its tag name, value, timestamp and quality. The dataset supplies one name and one timestamp for eight cells of four different types; that mapping is simply not defined. Column names do not become child tags below the dataset name — in the reported exchange that hierarchy was a question the capability answer never reached, because the object is not collected at all.
This is also why transport checks mislead. Ordinary Sparkplug metrics landing in the historian proves the broker path, the subscription and metric deserialization all work, and a payload-type limit survives every one of those checks. The failure that does respond to flow tracing is a different animal — why an MQTT collector logs DBIRTH but ignores DDATA — so confirm ordinary metrics still store, then stop debugging connectivity.
The documented answer for one collector release #
For the Canary MQTT Collector in version 22.3.0.22342, the reported picture is consistent: regular SparkplugB messages were picked up and stored automatically, dataset objects were not, and the vendor's support response stated that dataset objects are not supported, with no plans at that time to add them. No required property, naming convention, omitted field or collector option was identified that would enable collection — which makes varying the sample payload's properties to find a magic combination wasted effort.
Scope that answer to the release. Capabilities change across versions, so confirm with the vendor for the exact release you have deployed before designing around the limit, and ask specifically whether dataset objects are collected and how rows, columns, timestamps and quality map into tags. Generic Sparkplug support is not dataset support.
The decision for that release: choose a supported payload model at the publisher or put a transformation step in between. No collector setting changes the outcome.
The JSON path has the same single-value limit #
The collector's JSON route deserializes messages using an identifier key and a value key, with the key names set in the collector configuration, one pair per tag. The vendor's clarification was plain: the collector expects a single value per tag name and has no known way to parse nested content into a multi-value structure. It is the same limit wearing a different payload, and it is why SCADA MQTT points go blank with nested JSON payloads elsewhere in the plant.
The tested workaround: placing the entire table content inside quotation marks after the value key stored reliably — as one large string on a single tag. That is string storage, not typed points. The publisher's difficulty escaping quotation marks inside that string is a serialization chore, and fixing the escaping creates no nested parser.
Flattening the 2-row, 4-column dataset into single-value metrics #
Inputs:
- Rows: 2, from the sample dataset in the reported case.
- Columns: 4 (numberOfColumns 4), typed Int32, Float, Boolean and String, same sample.
- Dataset name: Site/Area/Device/datasettag, same sample.
- Timestamps: one for the whole object; the rows carry none.
- Collector constraint: one value per tag name per message.
Rule in words: a cell becomes historian history only when it owns a tag name, so the metrics per publish equal rows times columns.
Arithmetic:
- Cells per publish: 2 rows × 4 columns = 8.
- Rows as concurrent slots: 4 columns × 2 slots = 8 tags, named from the dataset name, column and slot; each publish writes 8 values.
- Rows as successive samples: 4 tags, one per column, with the 2 rows sent as 2 publishes at distinct timestamps — otherwise the second row overwrites the first at one timestamp.
- Type per column: Col1 lands as Int32, Col2 as Float, Col3 as Boolean, Col4 as String; the String column trends as states, not numbers.
- Metric count per publish: 1 DataSet metric becomes 8 typed metrics.
On the JSON route the same points look like this, with illustrative key names — the real names are whatever the collector's identifier and value configuration defines:
{ "id": "Site/Area/Device/datasettag/Col1/0", "value": 10 }
Result: a collector that already stores ordinary Sparkplug metrics stores all 8 with no configuration change; on the JSON route it stores 8 tags through the identifier and value mapping.
Decision, with its threshold: any dataset larger than a single cell — rows × columns above 1 — cannot ride one tag name, so flatten at the publisher. Use the 8-slot layout when the rows are concurrent items, such as one row per position or item. Use 4 tags with sequenced timestamps when the rows are samples in time. If the intact table is the deliverable, publish the string copy instead and accept untyped storage.
Deciding between flattened metrics and one string tag #
Flatten when anything downstream trends, alarms, aggregates or reports on the values: you get typed tags, per-column history, and quality handled the way the collector already handles ordinary metrics. The cost is namespace and payload — 8 metrics where 1 object was, growing with rows × columns — plus naming discipline at the publisher.
Keep the string when the deliverable is the table itself: audit copies, downstream parsing, archival. You keep the exact payload and lose typed history — no per-column trends, no numeric aggregates.
Publishing both is legitimate: flatten the columns that matter and send the string copy alongside, at roughly double the publish. If quality-bearing values feed calculations or reports that must show data quality, flatten rather than bury quality inside a string.
Questions asked
Is a Sparkplug dataset object the same as a template metric?
No. A dataset is a table: rows, a column count, column names and per-column types carried as one metric value. A template metric instead carries member metrics that make up a reusable structure, each with its own name and type, inside the one value. Both are composite types, and both meet the same wall in a collector that maps one value per tag name, so neither reaches the historian as separate typed points without flattening at the publisher.
Will storing the dataset as one string tag keep it usable?
It keeps the payload, not the analytics. The documented test stored the entire quoted table as one large string on a single tag, reliably. You retain the exact serialized rows and columns for later parsing, but there are no per-column trends, no numeric aggregates, and data quality sits inside the string where historian queries cannot reach it. Use the string as an archive copy and flatten any column that must be trended or reported.
What happens if the rows are samples at different times?
The sample dataset carries one timestamp for the whole object. Two rows published in that one message arrive at the same time, so flattened tags would overwrite each other and the second row wins. Either publish each row as its own message with its own timestamp and keep four tags, or treat rows as concurrent items and keep the row slot in the tag name, giving eight tags for the two-row, four-column case.
Can collector or broker settings enable dataset collection?
No. When ordinary Sparkplug metrics still store, the broker path, subscription and metric deserialization already work, and a payload-type limit is not a connectivity setting. The documented no-dataset answer is for Canary MQTT Collector release 22.3.0.22342; capabilities change between releases, so confirm your exact deployed release with the vendor before closing the door. Ask specifically how rows, columns, timestamps and quality would map into tags.