{"record":{"id":"a8a5b41eef49af80","repo":"prometheus/node_exporter","slug":"failed-to-retrieve-xfs-stats-w","errorCode":null,"errorMessage":"failed to retrieve XFS stats: %w","messagePattern":"failed to retrieve XFS stats: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"collector/xfs_linux.go","lineNumber":53,"sourceCode":"\n// NewXFSCollector returns a new Collector exposing XFS statistics.\nfunc NewXFSCollector(logger *slog.Logger) (Collector, error) {\n\tfs, err := xfs.NewFS(*procPath, *sysPath)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to open sysfs: %w\", err)\n\t}\n\n\treturn &xfsCollector{\n\t\tfs:     fs,\n\t\tlogger: logger,\n\t}, nil\n}\n\n// Update implements Collector.\nfunc (c *xfsCollector) Update(ch chan<- prometheus.Metric) error {\n\tstats, err := c.fs.SysStats()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to retrieve XFS stats: %w\", err)\n\t}\n\n\tfor _, s := range stats {\n\t\tc.updateXFSStats(ch, s)\n\t}\n\n\treturn nil\n}\n\n// updateXFSStats collects statistics for a single XFS filesystem.\nfunc (c *xfsCollector) updateXFSStats(ch chan<- prometheus.Metric, s *xfs.Stats) {\n\tconst (\n\t\tsubsystem = \"xfs\"\n\t)\n\n\tvar (\n\t\tlabels = []string{\"device\"}\n\t)","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/prometheus/node_exporter/blob/17ddd77c59ba27e1508e9f7894b1e55b44d6aed3/collector/xfs_linux.go#L35-L71","documentation":"Update failed because the xfs procfs/sysfs client could not read XFS runtime stats (typically /proc/fs/xfs/stat). A missing file (XFS not loaded or not mounted) or parse failure aborts the XFS scrape for the cycle.","triggerScenarios":"Thrown at collector/xfs_linux.go:53 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check `cat /proc/fs/xfs/stat` exists — if not, XFS support is not loaded and the xfs collector should be disabled.","Ensure the exporter can read the file (permissions/LSM).","Retry if the failure was transient (e.g. during module load)."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"17ddd77c59ba27e1508e9f7894b1e55b44d6aed3","analyzedAt":"2026-09-07T17:54:06.211Z","contentChangedAt":"2026-09-07T17:54:06.211Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}