Skip to content
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

fix(inputs.opcua): Auto fan out array nodes into individual fields #16359

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

inhinias
Copy link

Summary

Reading an entire OPC-UA array results in the metric creation to fail silently and reading an individual array element result in a bad node ID.

This PR detects an array and fans it out. So a read array results in each index being collected as a separate metric e.g: MetricName + Index.

This is just a simple way to get it to work. Maybe there is a way to store entire array as a metric, but I'm not all too familiar with the codebase as a whole. Options welcome.

Also Note:

  • Reading an array structure e.g: NodeId.Foo[1].bar works
  • Reading a single index does not work as mentioned above. (This PR does not fix this) For that OpcUa indexRange must be used together with some parsing of the node id so classical [index] notation can be used. See: https://reference.opcfoundation.org/Core/Part4/v104/docs/7.24

Checklist

  • No AI generated code was used in this PR

Related issues

resolves #11898

@telegraf-tiger telegraf-tiger bot added area/opcua fix pr to fix corresponding bug plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins labels Dec 31, 2024
@telegraf-tiger
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/opcua fix pr to fix corresponding bug plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OPCUA - Read the data of an array
1 participant