How openconfig/gnmic works
gnmic is both a gNMI CLI client and a configurable telemetry collector. The main user workflow is issuing gNMI RPC commands to network targets; the collector workflow receives target telemetry or external input, processes and routes messages to configured outputs, and can expose cached data through its own gNMI server. The graph retains major documented features such as clustering, tunnel dialout, and pipelines. Some subsystem paths and relationships are based on README descriptions or the source index; unsampled implementation details are not asserted.
Main entry points: cmd RPC commands · pipeline.go Message pipeline · cluster_manager.go Cluster manager · gnmi_client_subscribe.go Target subscriptions
Components 23
gNMI CLI
- CLI entry
main.go - RPC commands
pkg/cmd - gNMI client
pkg/app/gnmi_client.go - Target subscriptions
pkg/app/gnmi_client_subscribe.go
Collector Runtime
- Application runtime
pkg/app/app.go - Target manager
pkg/collector/managers/targets/targets_manager.go - Input manager
pkg/collector/managers/inputs/inputs_manager.go
Telemetry Flow
- Message pipeline
pkg/pipeline/pipeline.go - Event processing
pkg/formatters - Output manager
pkg/collector/managers/outputs/outputs_manager.go - Output integrations
pkg/outputs - Input integrations
pkg/inputs
Operations
- Cluster manager
pkg/collector/managers/cluster/cluster_manager.go - Collector state
pkg/collector/store/store.go - Target loaders
pkg/loaders
Collector Interfaces
- Telemetry cache
pkg/cache/oc_cache.go - Collector gNMI
pkg/collector/api/gnmi/server.go - Management API
pkg/collector/api/server/apiserver.go - Tunnel server
pkg/app/tunnel.go
Other components
- Operator
- gNMI targets
- Message sources
- Message sinks
Connections 24
- Operator → CLI entry: runs
- CLI entry → RPC commands: dispatches
main.go - Operator → RPC commands: invokes RPCs
- RPC commands → gNMI client: uses
- gNMI client → gNMI targets: sends RPCs
- RPC commands → Target subscriptions: starts subscriptions
- Target subscriptions → gNMI targets: subscribes
pkg/app/gnmi_client_subscribe.go - Operator → Application runtime: configures collector
- Application runtime → Target subscriptions: starts target streams
pkg/app/app.go - Target manager → Target loaders: initializes loader
pkg/collector/managers/targets/targets_manager.go - Input manager → Message pipeline: writes messages
pkg/collector/managers/inputs/inputs_manager.go - Message sources → Input integrations: provides events
- Input integrations → Message pipeline: sends messages
- Message pipeline → Event processing: carries events
pkg/pipeline/pipeline.go - Output manager → Output integrations: initializes outputs
pkg/collector/managers/outputs/outputs_manager.go - Output integrations → Message sinks: exports telemetry
- Output manager → Telemetry cache: sets cache
pkg/collector/managers/outputs/outputs_manager.go - Collector gNMI → Telemetry cache: serves cached data
pkg/collector/api/gnmi/server.go - Management API → Collector state: manages configuration
- Cluster manager → Collector state: coordinates state
pkg/collector/managers/cluster/cluster_manager.go - Cluster manager → Target manager: assigns targets
pkg/collector/managers/cluster/cluster_manager.go - Tunnel server → gNMI targets: receives dialout
- Operator → Cluster manager: deploys clustered
- Message sources → Message pipeline: feeds pipelines