Uploaded image for project: 'OpenNMS'
  1. OpenNMS
  2. NMS-13185

Kafka producer uses resource name instead of ifIndex as the instance for InterfaceLevelResource

    XMLWordPrintable

Details

    • Horizon 2021 - Feb 17 - Mar 3, Horizon 2021 - Mar 3 - Mar 17
    • Backlog CM

    Description

      When exporting metrics to Kafka, each resource type has an entity. For physical interfaces, it is defined like this:

      https://github.com/OpenNMS/opennms/blob/develop/features/kafka/producer/src/main/proto/collectionset.proto#L29

      Considering that interface resources are especial, and it is the ifIndex that identifies a resource (a.k.a., instance), that Protobuf field should be populated with:

      https://github.com/OpenNMS/opennms/blob/develop/features/collection/snmp-collector/src/main/java/org/opennms/netmgt/collectd/IfInfo.java#L267

      Unfortunately, that is not the case:

      https://github.com/OpenNMS/opennms/blob/develop/features/kafka/producer/src/main/java/org/opennms/features/kafka/producer/collection/CollectionSetMapper.java#L95

      I don't think there is any usefulness in using the interface label (which is what the "getInterfaceLabel" method provides) as the instance here.

      The correct behavior is that the instance should point to the ifIndex (i.e., use the "getInstance" method), to be consistent with the other resources (if you scroll down, you'll see that for Generic Index Resources, that is what it is used).

      If someone needs the interface name, assuming there is a need for that, it is better to add it as a new field in the Protobuf content.

      Attachments

        Activity

          People

            cgorantla Chandra Gorantla
            agalue Alejandro Galue
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: