|
| 1 | +# DDS Consumer Input Plugin |
| 2 | + |
| 3 | +The DDS consumer plugin reads metrics over DDS by creating readers defined in [XML App Creation](https://community.rti.com/static/documentation/connext-dds/5.3.1/doc/manuals/connext_dds/xml_application_creation/RTI_ConnextDDS_CoreLibraries_XML_AppCreation_GettingStarted.pdf) configurations. This plugin converts received DDS data to JSON data and adds to a Telegraf output plugin. |
| 4 | + |
| 5 | +## Configuration |
| 6 | + |
| 7 | +```toml |
| 8 | +[[inputs.dds_consumer]] |
| 9 | + ## XML configuration file path |
| 10 | + config_path = "example_configs/ShapeExample.xml" |
| 11 | + |
| 12 | + ## Configuration name for DDS Participant from a description in XML |
| 13 | + participant_config = "MyParticipantLibrary::Zero" |
| 14 | + |
| 15 | + ## Configuration name for DDS DataReader from a description in XML |
| 16 | + reader_config = "MySubscriber::MySquareReader" |
| 17 | + |
| 18 | + # Tag key is an array of keys that should be added as tags. |
| 19 | + tag_keys = ["color"] |
| 20 | + |
| 21 | + # Override the base name of the measurement |
| 22 | + name_override = "shapes" |
| 23 | + |
| 24 | + ## Data format to consume. |
| 25 | + data_format = "json" |
| 26 | +``` |
| 27 | + |
| 28 | +## Prerequisites |
| 29 | + |
| 30 | +- RTI Connext DDS Connector for Go must be installed on the system |
| 31 | +- Valid DDS XML configuration file with defined participants, topics, and data readers |
| 32 | +- Network connectivity to DDS domain |
| 33 | + |
| 34 | +## How it Works |
| 35 | + |
| 36 | +1. The plugin creates a DDS participant using the specified XML configuration |
| 37 | +2. It establishes a DataReader using the configured reader settings |
| 38 | +3. The plugin continuously waits for and processes incoming DDS samples |
| 39 | +4. Each DDS sample is converted to JSON format |
| 40 | +5. The JSON data is parsed into Telegraf metrics using the configured tag keys |
| 41 | +6. Metrics are forwarded to configured Telegraf output plugins |
| 42 | + |
| 43 | +## XML Configuration |
| 44 | + |
| 45 | +The plugin requires an XML configuration file that defines: |
| 46 | + |
| 47 | +- Domain participants |
| 48 | +- Publishers and subscribers |
| 49 | +- Topics and data types |
| 50 | +- QoS settings |
| 51 | +- DataReaders and DataWriters |
| 52 | + |
| 53 | +Example XML structure: |
| 54 | +```xml |
| 55 | +<?xml version="1.0"?> |
| 56 | +<dds> |
| 57 | + <types> |
| 58 | + <!-- Define your data types here --> |
| 59 | + </types> |
| 60 | + |
| 61 | + <domain_participant_library name="MyParticipantLibrary"> |
| 62 | + <domain_participant name="Zero" domain_ref="MyDomainLibrary::MyDomain"> |
| 63 | + <subscriber name="MySubscriber"> |
| 64 | + <data_reader name="MySquareReader" topic_ref="Square"/> |
| 65 | + </subscriber> |
| 66 | + </domain_participant> |
| 67 | + </domain_participant_library> |
| 68 | +</dds> |
| 69 | +``` |
| 70 | + |
| 71 | +## Tag Processing |
| 72 | + |
| 73 | +The `tag_keys` configuration allows you to specify which fields from the DDS data should be treated as tags rather than fields in the resulting metrics. This is useful for: |
| 74 | + |
| 75 | +- Categorizing data by source, type, or other identifiers |
| 76 | +- Creating time series with different tag combinations |
| 77 | +- Filtering and grouping data in downstream processing |
| 78 | + |
| 79 | +## Example Usage |
| 80 | + |
| 81 | +Example configuration files are provided in this directory: |
| 82 | +- `example_config.xml` - Sample DDS XML configuration |
| 83 | +- `example_telegraf.conf` - Sample Telegraf configuration using the DDS plugin |
| 84 | + |
| 85 | +### Generate config with DDS input & InfluxDB output plugins: |
| 86 | + |
| 87 | +```bash |
| 88 | +./telegraf --input-filter dds_consumer --output-filter influxdb config |
| 89 | +``` |
| 90 | + |
| 91 | +### Generate a config file with DDS input & file output plugins: |
| 92 | +```bash |
| 93 | +./telegraf --input-filter dds_consumer --output-filter file config > dds_to_file.conf |
| 94 | +``` |
| 95 | + |
| 96 | +### Run Telegraf with DDS consumer: |
| 97 | +```bash |
| 98 | +./telegraf --config ./dds_to_file.conf |
| 99 | +``` |
| 100 | + |
| 101 | +When running with the `dds_consumer` plugin, ensure that the XML file for DDS configurations is located at the `config_path` specified in your Telegraf TOML config. |
| 102 | + |
| 103 | +## Testing |
| 104 | + |
| 105 | +You can test the plugin with the [RTI Shapes Demo](https://www.rti.com/free-trial/shapes-demo) by: |
| 106 | + |
| 107 | +1. Publishing data with "Square" topic using Shapes Demo |
| 108 | +2. Configuring the plugin to read from the "Square" topic |
| 109 | +3. Observing metrics in your configured output |
| 110 | + |
| 111 | +## Troubleshooting |
| 112 | + |
| 113 | +### Common Issues |
| 114 | + |
| 115 | +1. **DDS Domain Connectivity**: Ensure all participants are on the same DDS domain |
| 116 | +2. **XML Configuration**: Verify XML file path and participant/reader names |
| 117 | +3. **Topic Matching**: Confirm topic names and data types match between publishers and subscribers |
| 118 | +4. **QoS Compatibility**: Check that QoS settings are compatible between writers and readers |
| 119 | + |
| 120 | +### Debug Tips |
| 121 | + |
| 122 | +- Enable debug logging in Telegraf to see detailed plugin operation |
| 123 | +- Use RTI tools like `rtiddsping` to verify DDS connectivity |
| 124 | +- Validate XML configuration with RTI tools before using with Telegraf |
| 125 | +- Check that the RTI Connext DDS environment is properly configured |
| 126 | + |
| 127 | +## Metrics |
| 128 | + |
| 129 | +The plugin generates metrics based on the DDS data received. The metric name can be: |
| 130 | +- Automatically derived from the DDS topic name |
| 131 | +- Overridden using the `name_override` configuration |
| 132 | +- Dynamically set based on data content (if using `json_name_key`) |
| 133 | + |
| 134 | +Fields are created from all numeric data in the DDS samples, while configured tag keys become metric tags for categorization and filtering. |
0 commit comments