How raphaelthomas/ssh_transport_exporter works
ssh_transport_exporter is a credential-less Prometheus exporter that probes only the SSH transport layer. Prometheus sends a target to the HTTP probe endpoint; the endpoint selects a configured module, normalizes and authorizes the target, then invokes the collector and returns probe metrics. The collector runs the transport probe, which observes DNS/TCP connection, SSH version exchange, host-key verification, and key exchange. Configuration builds target policies and known_hosts callbacks. The graph follows the excerpts and README; unsampled wiring is omitted where evidence does not establish a relationship.
Main entry points: probehttp.go Probe HTTP endpoint · module.go Module loading · collector.go Probe collector · main.go Exporter lifecycle
Components 12
Exporter runtime
- Exporter lifecycle
main.go - Probe HTTP endpoint
internal/probehttp/probehttp.go
Probe configuration
- Module loading
internal/config/module.go - Target policy
internal/config/target.go - Config parsing
internal/config/config.go - Host-key database
internal/knownhosts/knownhosts.go - Pattern matching
internal/match/match.go
SSH transport probe
- Transport probe
internal/probe/probe.go
Prometheus metrics
- Probe collector
internal/collector/collector.go - Probe metrics
internal/collector/collector.go
Other components
- Prometheus
- SSH target
Connections 12
- Prometheus → Probe HTTP endpoint: requests probe
README.md - Exporter lifecycle → Probe HTTP endpoint: registers route
main.go - Exporter lifecycle → Module loading: loads modules
main.go - Config parsing → Module loading: parses config
internal/config/module.go - Module loading → Target policy: builds matchers
internal/config/module.go - Module loading → Host-key database: loads host keys
internal/config/module.go - Host-key database → Pattern matching: matches patterns
internal/knownhosts/knownhosts.go - Probe HTTP endpoint → Target policy: checks target
internal/probehttp/probehttp.go - Probe HTTP endpoint → Probe collector: registers collector
internal/probehttp/probehttp.go - Probe collector → Transport probe: runs probe
internal/collector/collector.go - Transport probe → SSH target: probes transport
README.md - Probe collector → Probe metrics: emits metrics
internal/collector/collector.go