Telegraf's OPC UA plugin is simple. The customer's server is not
One user's string node IDs kept failing until the vendor switched them to numbers, and certificates, namespace indexes and timestamps hide further traps.
In brief
- Telegraf runs as a single static binary, is configured in TOML, and has shipped an OPC UA plugin since v1.16.0, released in 2020.
- On each cycle the plugin reads every node and emits one metric per node, with an id tag and a Quality field.
- Before writing real data, run the --test flag and use namespace_uri and a fixed certificate so the configuration survives a restart.
A user called OdneOksavik once turned to InfluxData’s community forum because Telegraf’s OPC UA plugin kept returning StatusBadNodeIDUnknown for nodes with string IDs. According to the post, dated January 19, 2022, the eventual fix was nowhere in the configuration file. The vendor had to change the identifier type from string to numeric.
The case shows that the tooling exists and is fairly compact, but whether the data actually flows depends on the client’s OPC UA server, which you do not control.
If your job at a plant is to pull process values out of PLCs, historians or SCADA gateways for analysis, InfluxData publishes an official guide for doing precisely that with Telegraf. Its traps are therefore worth knowing before the first client meeting.
One binary, one TOML file
InfluxData describes Telegraf as an agent for collecting, processing, aggregating and writing metrics, logs and other data. Telegraf compiles to a single static binary with no external dependencies, is configured in TOML and is released under the MIT license. The GitHub README lists more than 300 plugins; InfluxData’s product page says 400+.
On a factory floor, a static binary is a genuine advantage. If the client’s industrial PC is locked down or has no internet access, a single file that runs without extra installs spares you from asking the IT team to add a runtime.
The inputs.opcua plugin (its full name in the documentation is the OPC UA Client Reader Input Plugin) was contributed by InfluxData and has been available since v1.16.0, released on October 21, 2020.
The company’s official guide sums up the data flow in one sentence: read process values from an OPC UA server, whether a PLC, historian or SCADA gateway, and write them to InfluxDB 3.
Every read, every node becomes a metric
On each collection cycle, Telegraf reads every node that has been declared or discovered and emits one metric per node. The node ID goes in the id tag, and the OPC UA status goes in the Quality field.
Take a hypothetical packaging line with 40 nodes to monitor and a 10-second collection interval. That is six reads a minute, or 240 metrics, and 14,400 metrics an hour.
To count like this before writing anything to a database, use the --test flag. It runs only the inputs, prints the results to stdout and exits:
telegraf --config config.toml --test
Do not just count lines and forget to read Quality. A node that returns a reading with a bad status is more dangerous than one that fails loudly, because the wrong value slips quietly into dashboards and models.
Once the node count reaches the thousands, listing each one by hand stops being practical. Since v1.39.0 (June 2026), the [inputs.opcua.browse] section lets you discover nodes with glob patterns over browse paths.
The plugin’s README notes that large systems often have thousands of nodes named by a regular convention, and that the feature is designed for that case.
Three traps to clear before handover
The first trap is the certificate. When the security mode is anything other than None and no certificate is specified, Telegraf generates a self-signed client certificate in a temporary directory on every start. As a result, the OPC UA server has to re-authorize the client after every restart. If that authorization requires someone on the client’s side to act, data stops flowing until they do.
The second trap is the namespace index. Declaring nodes by index is more compact, but the documentation warns that the index can change when the server restarts or its configuration changes. namespace_uri is more stable, and each node may use only one of the two.
Choose the URI from the start, because switching once thousands of nodes are declared is far more work.
The third trap is the timestamp. The timestamp option takes three values: “gather” uses the moment Telegraf receives the data, “server” uses the timestamp the server assigns, and “source” uses the timestamp from the data source itself.
When an incident has to be matched against second-by-second sensor data, the wrong choice can skew the conclusion about its cause. Ask the client’s operations engineers which clock they trust before choosing.
Polling or subscription?
inputs.opcua reads on a fixed interval. For servers that support subscriptions, InfluxData points to the inputs.opcua_listener plugin, which receives value changes as they happen instead of polling. If the client cares about events such as machine stops or alarms, subscriptions make more sense. If they need a steady series of numbers to chart trends, polling is easier to verify.
The plugin is still under active development. v1.40.4, released on November 23, 2026, added handling for node values of type LocalizedText. Pin the Telegraf version when deploying for a client, and read the release notes before every upgrade.
What to learn first, and what to put on a CV
Learn the OPC UA node and namespace model first, then the TOML syntax. The string node ID case above shows that some failures can only be fixed on the server side, so bring a list of questions to the first client meeting: the node identifier type, the security mode, who can authorize certificates, and whether the server supports subscriptions.
If an FDE job posting you are targeting mentions OPC UA, PLCs, historians or SCADA, have a case like this ready to tell in the interview, even if it is only a self-built project against a test server.
On a CV, be specific: how many nodes you connected, which timestamp you chose and why, and how you handled the regenerated certificate. Those lines persuade far more than one saying you know Telegraf.
Getting data out of a PLC is only the first step. The hard part is keeping it correct after the client’s next maintenance window.
Was this article useful?
Thanks for the feedback!
10 sources
- GitHub - influxdata/telegraf
- telegraf/LICENSE
- Release v1.16.0 · influxdata/telegraf · 2020-10-21
- Collect industrial data from OPC UA · 2026-08-14
- Collect industrial data from OPC UA · 2026-08-14
- OPC UA Client Reader Input Plugin (README)
- OPC UA Client Reader Input Plugin · 2026-09-21
- Issue with Telegraf OPC UA Input Plugin · 2021-10-21
- Telegraf Commands and Flags
- Release v1.40.4 · influxdata/telegraf · 2026-11-23