Prometheus exporter for transceiver EEPROM telemetry exposed through the Linux ethtool API.
The implementation decodes SFF-8472 SFP/SFP+ modules, SFF-8636 QSFP/QSFP+/QSFP28 modules, and CMIS modules. It exports decoded gauges for module temperature, voltage, TX bias, TX optical power, RX optical power, diagnostic thresholds, module/lane state, static inventory, and alarm/warning status.
transceiver_exporter: HTTP exporter, defaulting to:9459and/metrics. It uses Prometheus exporter-toolkit web flags, including TLS/basic-auth configuration through--web.config.file.transceiverctl: small inspection CLI for live module reads.
transceiver_temperature_celsiustransceiver_voltage_voltstransceiver_tx_bias_milliampstransceiver_tx_power_milliwattstransceiver_tx_power_dbmtransceiver_rx_power_milliwattstransceiver_rx_power_dbmtransceiver_diagnostic_thresholdtransceiver_alarm_statuswith module-level alarms using an emptylanelabel and per-lane alarms using the lane numbertransceiver_scrape_successtransceiver_module_statustransceiver_module_low_power_statustransceiver_lane_datapath_statetransceiver_module_infotransceiver_wavelength_nanometerstransceiver_wavelength_tolerance_nanometerstransceiver_module_power_classtransceiver_module_power_max_wattstransceiver_nominal_bitrate_mbdtransceiver_link_length_meters
Dynamic metrics intentionally avoid module identity labels such as vendor, part
number, and serial number. Those labels live on transceiver_module_info so
Prometheus can join them into alerts without multiplying every time series by
replaceable module identity.
The mixin/ directory contains a Prometheus mixin with alert rules, a Grafana
dashboard, and promtool unit tests. Lane-scoped alarm alerts are gated by
transceiver_lane_datapath_state{state="activated"} so intentionally inactive
lanes do not page on optical power or loss-of-signal flags.
jsonnet -S mixin/alerts.jsonnet > mixin/prometheus_alerts.yaml
./hack/render-dashboards.sh
(cd mixin && promtool test rules tests.yml)The generated alert rules are also checked into
charts/transceiver-exporter/files/prometheus-alerts.yaml for the Helm chart.
The generated dashboard is checked into grafana/. Run
./hack/render-alerts.sh and ./hack/render-dashboards.sh after editing the
mixin.
Example Grafana panels from the generated dashboard:
The repository includes a GoReleaser-compatible Dockerfile for the exporter
binary. GoReleaser builds the Linux binaries first, then creates the container
image from those prebuilt artifacts instead of rebuilding inside Docker.
goreleaser release --snapshot --clean --skip=publishTagged releases publish GitHub release archives/checksums plus
ghcr.io/vexxhost/transceiver-exporter image tags.
The chart lives in charts/transceiver-exporter. It deploys the exporter as a
host-networked DaemonSet and intentionally uses a PodMonitor instead of a
ServiceMonitor.
helm install transceiver-exporter charts/transceiver-exporter \
-n monitoring \
--set podMonitor.enabled=true \
--set podMonitor.additionalLabels.release=kube-prometheus-stack \
--set prometheusRule.enabled=true \
--set prometheusRule.namespace=monitoring \
--set prometheusRule.additionalLabels.release=kube-prometheus-stackCGO_ENABLED=0 go test ./...collector contains the Prometheus collector wiring. pkg/transceiver
contains the clean public domain model. Live EEPROM reads use
github.com/safchain/ethtool through pkg/moduleeeprom, while pkg/sff owns
standards-specific EEPROM decoding.
Reusable packages live under pkg/ so they can be imported by other components
or split into their own modules later without changing the internal package
boundaries first.
collector: Prometheus collector wiring.pkg/moduleeeprom: live EEPROM reads through ethtool ioctl/netlink.pkg/sff: standards-specific EEPROM decoding.pkg/transceiver: decoded module domain model.pkg/netdev: candidate network device discovery.pkg/transceiverctl: reusable inspection command runner.
Common library entry points:
moduleeeprom.Newopens an ethtool-backed reader.(*moduleeeprom.Reader).ModuleEEPROMreads raw EEPROM bytes for an interface.sff.Decodedecodes EEPROM bytes into atransceiver.Module.sff.DecodeObservationdecodes EEPROM bytes and attaches an interface name.collector.NewTransceiverCollectorexposes decoded readings as Prometheus metrics.
EEPROM fixture directories live under pkg/sff/testdata and use the pattern
standard-formfactor-media-variant, for example sff8472-sfp-copper-passive
or cmis-qsfp-plus-lower-page-a. Each fixture directory is discovered
automatically by the SFF tests and should only contain files used by those
tests. Pretty ethtool fixtures use eeprom.bin plus ethtool.txt; raw ethtool
offset dumps can use ethtool.txt by itself because the test parses the EEPROM
bytes from the dump.


