From ba05799a8bff0f849e7642850db52a4496cce2b9 Mon Sep 17 00:00:00 2001 From: dobbi84 Date: Fri, 16 Jan 2026 16:36:20 +0100 Subject: [PATCH] feat: allow running with older version 2.3 of nvme-cli --- README.md | 4 ++-- cmd/main.go | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index ff8dd0e..db884f0 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ Specification versions of reference: ### Supported NVMe CLI Versions -Supports [NVMe CLI](https://github.com/linux-nvme/nvme-cli) versions **2.8 and above**. +Supports [NVMe CLI](https://github.com/linux-nvme/nvme-cli) versions **2.3 and above**. > **Note**: The exporter will continue to run with unsupported versions, but may produce incorrect data or fail scrapes. @@ -158,7 +158,7 @@ docker run --rm -d --network=host --privileged nvme_exporter \ | Metric Name | Type | Description | |-------------|------|-------------| -| `nvme_exporter_scrape_failures_total` | Counter | Total number of scrape failures due to validation errors (not root, nvme-cli not found, or unsupported version) | +| `nvme_exporter_scrape_failures_total` | Counter | Total number of scrape failures due to fatal validation errors (not root or nvme-cli not found) | ### NVMe Device Metrics diff --git a/cmd/main.go b/cmd/main.go index bf70bde..8ff93e5 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -18,7 +18,7 @@ import ( "github.com/E4-Computer-Engineering/nvme_exporter/pkg/utils" ) -const _minimumSupportedVersion = "2.8" +const _minimumSupportedVersion = "2.3" var ( validationState = struct { @@ -33,8 +33,8 @@ var ( scrapeFailuresTotal = prometheus.NewCounter( prometheus.CounterOpts{ Name: "nvme_exporter_scrape_failures_total", - Help: "Total number of scrape failures due to validation errors " + - "(not root, nvme-cli not found, or unsupported version)", + Help: "Total number of scrape failures due to fatal validation errors " + + "(not root or nvme-cli not found)", }, ) ) @@ -278,8 +278,8 @@ func validateNVMeCLI() { log.Printf("WARNING: NVMe cli version %s not supported, minimum required version is %s", version, _minimumSupportedVersion) log.Printf("WARNING: exporter will continue running but scrapes may fail or produce incorrect data") - setValidationError(fmt.Sprintf("unsupported nvme-cli version %s (minimum: %s)", - version, _minimumSupportedVersion)) + // Note: We do NOT set validation error for version issues - we still attempt to collect data + // Only fatal errors (not root, nvme binary missing) should block collection entirely return }