-
Notifications
You must be signed in to change notification settings - Fork 5.7k
feat(inputs.opcua): Add namespace URI support #17906
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(inputs.opcua): Add namespace URI support #17906
Conversation
Add support for OPC UA namespace URIs (nsu=) as an alternative to namespace indices (ns=) in both inputs.opcua and inputs.opcua_listener plugins. This allows users to configure nodes using stable namespace URIs instead of numeric indices that can change on server restart.
Add namespace_uri field to sample configuration for both inputs.opcua and inputs.opcua_listener plugins.
|
Download PR build artifacts for linux_amd64.tar.gz, darwin_arm64.tar.gz, and windows_amd64.zip. 📦 Click here to get additional PR build artifactsArtifact URLs |
| ```toml | ||
| [[inputs.opcua.nodes]] | ||
| name = "ServerStatus" | ||
| namespace = "0" | ||
| identifier_type = "i" | ||
| identifier = "2256" | ||
| ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a question for understanding the matter. As we touch this part anyway, wouldn't it be easier do define something like
[inputs.opcua_listener.metric]
name = "my_metric"
[inputs.opcua_listener.metric.fields]
ServerStatus = "ns=0;i=2256"
MyInfo = "nsu=http://opcfoundation.org/UA/;s=foo"
[inputs.opcua_listener.metric.tags]
location = "main building"
device = "typesetter"This is more compact, less error prone (you cannot define duplicate fields) and easier to graps as it defines how a metric looks like and uses the notation used for Node IDs in OPCUA, isn't it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, let's implement the feature in the current form and add the more compact configuration later if we want to...
srebhan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @skartikey!
Summary
Adds support for OPC UA namespace URIs (
nsu=) as an alternative to namespace indices (ns=) in bothinputs.opcuaandinputs.opcua_listenerplugins.This enhancement allows users to configure nodes using stable namespace URIs instead of numeric indices that can change when OPC UA servers restart, making configurations more robust and portable.
New Configuration Option
namespace_urifield to node and group configurationsnamespace(index) field with mutual exclusion validationExample Usage
Before (using namespace index):
After (using namespace URI):
Breaking Changes
None - this is purely additive. Existing configurations using namespace continue to work unchanged.
Checklist
Related issues
resolves #14417