mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-11-13 12:13:36 +01:00
refactor(overlays): pin smartctl_exporter to the upstream #329 commit
Replace the backported patch with a src/version/vendorHash override that pins prometheus-smartctl-exporter to upstream 6274decc (2026-09-28), which already carries the Describe() fix from PR #329. Simpler to maintain than a patch file and it tracks the upstream change directly; drop the overlay once smartctl_exporter 0.15.0 is packaged in nixpkgs.
This commit is contained in:
1 parent
e8764b802a
commit
0a847c1f55
3 files changed
+18
-61
No files matched your search
+3
-4
@@ -13,9 +13,8 @@ overlays/
|
||||
├── default.nix # Entrypoint for all overlays
|
||||
├── computer-use-linux.nix # trycua/computer-use-linux package
|
||||
├── cua-driver.nix # trycua/cua driver (cua-driver) package
|
||||
├── smartctl-exporter/ # smartctl_exporter backport (upstream PR #329)
|
||||
│ ├── default.nix
|
||||
│ └── 329-explicit-descriptors.patch
|
||||
├── smartctl-exporter/ # smartctl_exporter pinned to the #329 fix
|
||||
│ └── default.nix
|
||||
└── fcitx5/ # Chinese input method configuration
|
||||
├── README.md
|
||||
├── default.nix # fcitx5 overlay definition
|
||||
@@ -58,6 +57,6 @@ This overlay provides:
|
||||
|
||||
- `computer-use-linux.nix`: packages `pkgs/computer-use-linux`.
|
||||
- `cua-driver.nix`: packages `pkgs/cua-driver` (used by the computer-use VMs).
|
||||
- `smartctl-exporter/`: patches `prometheus-smartctl-exporter` with upstream PR
|
||||
- `smartctl-exporter/`: pins `prometheus-smartctl-exporter` to the upstream commit carrying PR
|
||||
[#329](https://github.com/prometheus-community/smartctl_exporter/pull/329) until smartctl_exporter
|
||||
0.15.0 is released; see `overlays/smartctl-exporter/default.nix`.
|
||||
@@ -1,50 +0,0 @@
|
||||
diff --git a/main.go b/main.go
|
||||
index c5b138a..05a222e 100644
|
||||
--- a/main.go
|
||||
+++ b/main.go
|
||||
@@ -57,7 +57,44 @@ type SMARTctlManagerCollector struct {
|
||||
|
||||
// Describe sends the super-set of all possible descriptors of metrics
|
||||
func (i *SMARTctlManagerCollector) Describe(ch chan<- *prometheus.Desc) {
|
||||
- prometheus.DescribeByCollect(i, ch)
|
||||
+ ch <- metricSmartctlVersion
|
||||
+ ch <- metricDeviceModel
|
||||
+ ch <- metricDeviceCount
|
||||
+ ch <- metricDeviceCapacityBlocks
|
||||
+ ch <- metricDeviceCapacityBytes
|
||||
+ ch <- metricDeviceTotalCapacityBytes
|
||||
+ ch <- metricDeviceBlockSize
|
||||
+ ch <- metricDeviceInterfaceSpeed
|
||||
+ ch <- metricDeviceAttribute
|
||||
+ ch <- metricDevicePowerOnSeconds
|
||||
+ ch <- metricDeviceRotationRate
|
||||
+ ch <- metricDeviceTemperature
|
||||
+ ch <- metricDevicePowerCycleCount
|
||||
+ ch <- metricDevicePercentageUsed
|
||||
+ ch <- metricDeviceAvailableSpare
|
||||
+ ch <- metricDeviceAvailableSpareThreshold
|
||||
+ ch <- metricDeviceCriticalWarning
|
||||
+ ch <- metricDeviceMediaErrors
|
||||
+ ch <- metricDeviceNumErrLogEntries
|
||||
+ ch <- metricDeviceBytesRead
|
||||
+ ch <- metricDeviceBytesWritten
|
||||
+ ch <- metricDeviceSmartStatus
|
||||
+ ch <- metricDeviceExitStatus
|
||||
+ ch <- metricDeviceState
|
||||
+ ch <- metricDeviceStatistics
|
||||
+ ch <- metricDeviceErrorLogCount
|
||||
+ ch <- metricDeviceSelfTestLogCount
|
||||
+ ch <- metricDeviceSelfTestLogErrorCount
|
||||
+ ch <- metricDeviceERCSeconds
|
||||
+ ch <- metricSCSIGrownDefectList
|
||||
+ ch <- metricReadErrorsCorrectedByRereadsRewrites
|
||||
+ ch <- metricReadErrorsCorrectedByEccFast
|
||||
+ ch <- metricReadErrorsCorrectedByEccDelayed
|
||||
+ ch <- metricReadTotalUncorrectedErrors
|
||||
+ ch <- metricWriteErrorsCorrectedByRereadsRewrites
|
||||
+ ch <- metricWriteErrorsCorrectedByEccFast
|
||||
+ ch <- metricWriteErrorsCorrectedByEccDelayed
|
||||
+ ch <- metricWriteTotalUncorrectedErrors
|
||||
}
|
||||
|
||||
// Collect is called by the Prometheus registry when collecting metrics.
|
||||
@@ -1,15 +1,23 @@
|
||||
# smartctl_exporter 0.14.0 derives `Describe()` from the devices it can read at
|
||||
# startup, so when a device only becomes readable later (an NVMe whose ACL
|
||||
# arrives late, or an HDD waking from standby) `Collect()` emits metrics whose
|
||||
# descriptors were never registered and `/metrics` starts returning HTTP 500,
|
||||
# which fails the whole scrape and hides even the healthy disks.
|
||||
# descriptors were never registered and `/metrics` returns HTTP 500, failing the
|
||||
# whole scrape and hiding even the healthy disks.
|
||||
#
|
||||
# Backport of upstream PR #329: `Describe()` now sends the full, explicit
|
||||
# descriptor set. Drop this overlay once smartctl_exporter 0.15.0 is released
|
||||
# and packaged in nixpkgs:
|
||||
# Pin the package to the upstream commit that carries the fix (PR #329, merged
|
||||
# 2026-09-28, then included in the "Update Go (#391)" commit below) instead of
|
||||
# backporting it as a patch. Drop this overlay once smartctl_exporter 0.15.0 is
|
||||
# released and packaged in nixpkgs:
|
||||
# https://github.com/prometheus-community/smartctl_exporter/pull/329
|
||||
_: _final: prev: {
|
||||
prometheus-smartctl-exporter = prev.prometheus-smartctl-exporter.overrideAttrs (prevAttrs: {
|
||||
patches = (prevAttrs.patches or [ ]) ++ [ ./329-explicit-descriptors.patch ];
|
||||
prometheus-smartctl-exporter = prev.prometheus-smartctl-exporter.overrideAttrs (_prev: {
|
||||
version = "0.14.0-unstable-2026-09-28";
|
||||
src = prev.fetchFromGitHub {
|
||||
owner = "prometheus-community";
|
||||
repo = "smartctl_exporter";
|
||||
rev = "6274decc61212cc61e58796cc3b8cf5cfa035809";
|
||||
hash = "sha256-KR+j4uLqxVtRpQ7L8UxOypOHZG9CxUGw0ELIO7e6tXc=";
|
||||
};
|
||||
vendorHash = "sha256-PJiMYWdoQ3Zk7sYHveG9uIgOjllgPuu6RjAPVdKUi6Y=";
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user