Skip to content

NMS-12669: IPC and Kafka docs - #9004

Merged
joseanesONMS merged 6 commits into
developfrom
jira/NMS-12669-ipc-docs
Oct 23, 2026
Merged

joseanesONMS merged 6 commits into
developfrom
jira/NMS-12669-ipc-docs

Conversation

@joseanesONMS

@joseanesONMS joseanesONMS commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Documents the Minion IPC and the Kafka producer, split out of #8984; content checked against the code on develop, one commit per ticket.

Ticket Topic Page(s) added/changed Source of truth
NMS-12669 Sink and RPC patterns deployment/…/minion/ipc.adoc (new) core/ipc/sink/api, core/ipc/rpc/api
NMS-13800 Twin API deployment/…/minion/ipc.adoc, minion/message-broker/kafka.adoc core/ipc/twin/api, AbstractTwinPublisher.java
NMS-13814 Kafka producer .proto definitions operation/…/kafka-producer/kafka-producer.adoc features/kafka/producer/src/main/proto/*.proto, OpennmsKafkaProducer.java
NMS-14886 Kafka producer filter examples operation/…/kafka-producer/configure-kafka.adoc OpennmsKafkaProducer.java (SpEL filters)
NMS-14033 Sentinel settings for Kafka multi-tenancy reference/…/tuning-kafka.adoc, system-properties.adoc blueprint-ipc-server.xml, KafkaTopicProvider.java

The Kafka event-record key is also corrected.

Not addressed

  • NMS-13414: AWS SQS is gone from develop and gRPC is a supported transport, so marking them experimental would be inaccurate.

The docs build adds no warnings (develop's two existing ones remain).

External References

The Minion docs described installation per broker but not the Sink and RPC patterns that carry Core, Minion, and Sentinel traffic. The new page follows the core/ipc sink and rpc APIs and the strategy selection in SinkStrategy and RpcStrategy.
The Twin pattern that replicates configuration from Core to Minions was only mentioned by name in the Kafka setup. The section follows the core/ipc/twin publisher and subscriber APIs, the keys registered by Trapd, telemetryd, and the IPFIX provider, and the twin-subscribe shell command.
The page pointed readers at the source distribution for the .proto files without naming them or their message types. It now lists the file paths, the key and message type of each topic, and how to generate consumer classes, following OpennmsKafkaProducer and KafkaPersister; it also corrects the event record key, which is not set.
The page had one sample expression per filter. It now lists tested sample expressions for events, alarms, and metrics, explains how alarm filtering treats cleared and deleted alarms, and notes that nodes follow the event and alarm filters; the expressions match the getters of Event, OnmsAlarm, and KafkaPersister.ResourceFilterContext under the producer's SimpleEvaluationContext.
The tuning page said Sentinel needs the instance ID but only showed Core and Minion, and did not explain why the Sentinel setup also sets group.id. It now names the Sentinel files and explains both properties, following SystemInfoUtils, OnmsKafkaConfigProvider, and the sink Kafka consumer blueprint.
[[kafka-producer-schema]]
== Schema

The Kafka Producer encodes record values with the following Protocol Buffers (proto3) definitions in the {page-component-title} source tree:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It feels excessive to have this level of detail in the documentation as opposed to linking to the proto, but there's not really anything wrong with it, I suppose.

@marshallmassengill marshallmassengill Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah... we haven't really made a lot of changes to it though so I think it's probably ok to leave it for now? If we do make changes then we can change this section to be more of an example reference and remove some of it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trimmed in 8c30ec4 per Chandra's comments: the source paths, generated class details and the Python example are gone; the topic table stays.

@@ -0,0 +1,122 @@
[[minion-ipc]]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, really glad to see this get added I think. Feels like it's been missing.

@marshallmassengill marshallmassengill left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is ok. I would wait for another reviewer before merging though.

Comment on lines +133 to +150
The following Python example parses records from the `alarms` topic with the generated module and the `kafka-python` client:

[source, python]
----
from kafka import KafkaConsumer
import opennms_kafka_producer_pb2 as onms

consumer = KafkaConsumer("alarms", bootstrap_servers="my-kafka-ip-1:9092")
for record in consumer:
if record.value is None:
print(f"Alarm deleted: {record.key.decode()}")
continue
alarm = onms.Alarm()
alarm.ParseFromString(record.value)
print(alarm.reduction_key, onms.Severity.Name(alarm.severity))
----

Use the `.proto` files from the same version as your {page-component-title} instance.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if we need this python script example. Not usual for OpenNMS docs.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed in 8c30ec4, along with the protoc command that led into it.


Neither file declares a `package`, so the message types use the root namespace.
The Java classes that {page-component-title} generates from them are in the `org.opennms.features.kafka.producer.model` package, in the outer classes `OpennmsModelProtos` and `CollectionSetProtos`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of this can be removed

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed in 8c30ec4. The section now names the two .proto files in one sentence and keeps the topic table.

In the example above, the filter is configured such that only metrics associated with the given location are forwarded.
Available properties are nodeId, nodeLabel, foreignSource, foreignId, location, resourceTypeName, resourceName, resourceId, ifIndex and instance.

=== Filter examples

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haven't verified these examples. It would be good to validate these examples before we publish them on docs.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Validated: every sample expression was evaluated with the producer's own SpEL context (SimpleEvaluationContext.forReadOnlyDataBinding().withInstanceMethods()) against matching and non-matching sample events, alarms and metric resources, and each returned the documented result; T(...) and constructor calls are rejected as stated. That check also corrected two lines in 8c30ec4: the node topic is fed by topology vertices too, and the combined example no longer sets an empty metricFilter.

…ter notes

Drop the source paths, namespace and generated Java class details and the
protoc and Python consumer examples from the schema section; it now names
the two .proto files and keeps the topic table.

The node topic is also fed by topology vertices, not only by events and
alarms, and the combined filter example no longer sets an empty
metricFilter. Every sample filter expression was evaluated against sample
events, alarms and metric resources with the producer's evaluation context.

@marshallmassengill marshallmassengill left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updates look good to me.

@joseanesONMS
joseanesONMS merged commit b8e2eca into develop Oct 23, 2026
6 checks passed
@joseanesONMS
joseanesONMS deleted the jira/NMS-12669-ipc-docs branch October 23, 2026 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants