Feat: SNMP MIB Enrichment #1103
Labels
No labels
1week
2weeks
Failed compliance check
IP cameras
NATS
Possible security concern
Review effort 1/5
Review effort 2/5
Review effort 3/5
Review effort 4/5
Review effort 5/5
UI
aardvark
accessibility
amd64
api
arm64
auth
back-end
bgp
blog
bug
build
checkers
ci-cd
cleanup
cnpg
codex
core
dependencies
device-management
documentation
duplicate
dusk
ebpf
enhancement
eta 1d
eta 1hr
eta 3d
eta 3hr
feature
fieldsurvey
github_actions
go
good first issue
help wanted
invalid
javascript
k8s
log-collector
mapper
mtr
needs-triage
netflow
network-sweep
observability
oracle
otel
plug-in
proton
python
question
reddit
redhat
research
rperf
rperf-checker
rust
sdk
security
serviceradar-agent
serviceradar-agent-gateway
serviceradar-web
serviceradar-web-ng
siem
snmp
sysmon
topology
ubiquiti
wasm
wontfix
zen-engine
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
carverauto/serviceradar#1103
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from GitHub.
Original GitHub issue: #3018
Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/issues/3018
Original created: 2026-03-09T03:29:00Z
Product Requirements Document (PRD): SNMP MIB Enrichment Pipeline
1. Overview and Objective
Project: OpenSource Network Management Software
Component: MIB Enrichment Service
Tech Stack: Elixir, Broadway, NATS JetStream, CNPG (PostgreSQL)
Objective:
Build a high-throughput, low-latency stream processing service that sits between the SNMP Collector and the Log Normalization Engine (Zen-Engine). This service will translate raw, numeric SNMP OIDs and varbinds into human-readable, context-rich JSON payloads using Ahead-of-Time (AOT) compiled MIB dictionaries.
2. Problem Statement
Currently, SNMP traps flow into the system as raw numeric OIDs (e.g.,
.1.3.6.1.2.1.2.2.1.8.4). Because there are no MIBs loaded, downstream components (Zen-Engine) and end-users must deal with raw OIDs, which makes writing normalization rules and searching data practically impossible.Dynamically parsing raw ASN.1 MIB files from disk per-trap at ingestion is an anti-pattern that will cause massive CPU bottlenecks, memory spikes, and pipeline backpressure during a trap storm. We need a scalable way to load hundreds of thousands of OID mappings into memory and enrich traps at line-rate.
3. Proposed Solution
Introduce a dedicated Elixir/Broadway Consumer to handle OID enrichment.
:persistent_term, allowing thousands of concurrent Broadway workers to access the MIB dictionary via direct memory pointers with O(1) lookup speeds, zero memory duplication, and zero Garbage Collection (GC) overhead.4. System Architecture & Data Flow
5. Functional Requirements
5.1 System Initialization (Boot)
:persistent_term.5.2 Trap Processing (Broadway Pipeline)
RAW_TRAPSNATS JetStream topic using Broadway backpressure mechanisms.snmpTrapOIDandvarbindOID in the payload, the service must perform a Longest Prefix Match (LPM) lookup against:persistent_term.ifOperStatus) and the instance suffix (e.g.,[4]).1: up, 2: down), the service must translate the integer to the human-readable string.ENRICHED_TRAPSNATS JetStream topic.5.3 Hot Reloading
SYS.MIBS.UPDATED).:persistent_termwithout dropping the NATS JetStream connection or requiring a container restart.6. Non-Functional Requirements (NFRs)
:persistent_termshared references.7. Implementation Specifications
7.1 Persistent Term Data Structure
To ensure O(1) lookups, the
:persistent_termkeys should be structured as Elixir tuples:7.2 Longest Prefix Match Algorithm (LPM)
Because SNMP appends instance data to OIDs (e.g.,
.1.3.6.1.2.1.2.2.1.8.4), an exact match will fail. The system must implement a recursive truncation algorithm:[1, 3, 6, 1, 2, 1, 2, 2, 1, 8, 4]-> MISS.4, prepend to instance accumulator, lookup[1, 3, 6, 1, 2, 1, 2, 2, 1, 8]-> HIT.[4].7.3 Schema of Enriched Payload
Example Output Payload:
8. Out of Scope
.txt/.myASN.1 files into flattened JSON. This PRD assumes the JSON already exists in CNPG.9. Acceptance Criteria
RAW_TRAPS.:persistent_term.ENRICHED_TRAPS.