# 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.

Original: https://fdetimes.net/en/tools/telegraf-opc-ua-three-traps/

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:

```bash
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.

**Key point:** An OPC UA configuration is only finished when it still runs correctly after a restart.

## 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.

**Try this week:**

- Set up a test OPC UA server, configure inputs.opcua with three nodes, then run telegraf --config config.toml --test and read each line of output
- Declare the same node two ways, by namespace index and by namespace_uri, and note when each one breaks
- Try all three timestamp values (gather, server, source) and compare the timestamps on the same measured value

## Sources

- [GitHub - influxdata/telegraf](https://github.com/influxdata/telegraf)

- [telegraf/LICENSE](https://raw.githubusercontent.com/influxdata/telegraf/master/LICENSE)

- [Release v1.16.0 · influxdata/telegraf](https://github.com/influxdata/telegraf/releases/tag/v1.16.0)

- [Collect industrial data from OPC UA](https://docs.influxdata.com/telegraf/v1/examples/collect-opcua/index.md)

- [Collect industrial data from OPC UA](https://docs.influxdata.com/telegraf/v1/examples/collect-opcua/)

- [OPC UA Client Reader Input Plugin (README)](https://raw.githubusercontent.com/influxdata/telegraf/master/plugins/inputs/opcua/README.md)

- [OPC UA Client Reader Input Plugin](https://docs.influxdata.com/telegraf/v1/input-plugins/opcua/index.md)

- [Issue with Telegraf OPC UA Input Plugin](https://community.influxdata.com/t/issue-with-telegraf-opc-ua-input-plugin/22177)

- [Telegraf Commands and Flags](https://raw.githubusercontent.com/influxdata/telegraf/master/docs/COMMANDS_AND_FLAGS.md)

- [Release v1.40.4 · influxdata/telegraf](https://github.com/influxdata/telegraf/releases/tag/v1.40.4)
