about summary refs log tree commit diff
path: root/nixpkgs/pkgs/servers/monitoring/prometheus
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/servers/monitoring/prometheus')
-rw-r--r--nixpkgs/pkgs/servers/monitoring/prometheus/atlas-exporter.nix22
-rw-r--r--nixpkgs/pkgs/servers/monitoring/prometheus/default.nix6
-rw-r--r--nixpkgs/pkgs/servers/monitoring/prometheus/smartctl-exporter/0001-Return-the-cached-value-if-it-s-not-time-to-scan-aga.patch51
-rw-r--r--nixpkgs/pkgs/servers/monitoring/prometheus/xmpp-alerts.nix18
4 files changed, 30 insertions, 67 deletions
diff --git a/nixpkgs/pkgs/servers/monitoring/prometheus/atlas-exporter.nix b/nixpkgs/pkgs/servers/monitoring/prometheus/atlas-exporter.nix
new file mode 100644
index 000000000000..ce40a93e66f8
--- /dev/null
+++ b/nixpkgs/pkgs/servers/monitoring/prometheus/atlas-exporter.nix
@@ -0,0 +1,22 @@
+{ lib, buildGoModule, fetchFromGitHub }:
+
+buildGoModule rec {
+  pname = "atlas-exporter";
+  version = "1.0.4";
+
+  src = fetchFromGitHub {
+    owner = "czerwonk";
+    repo = "atlas_exporter";
+    rev = version;
+    sha256 = "sha256-vhUhWO7fQpUHT5nyxbT8AylgUqDNZRSb+EGRNGZJ14E=";
+  };
+
+  vendorHash = "sha256-tR+OHxj/97AixuAp0Kx9xQsKPAxpvF6hDha5BgMBha0=";
+
+  meta = with lib; {
+    description = "Prometheus exporter for RIPE Atlas measurement results ";
+    homepage = "https://github.com/czerwonk/atlas_exporter";
+    license = licenses.lgpl3;
+    maintainers = with maintainers; [ clerie ];
+  };
+}
diff --git a/nixpkgs/pkgs/servers/monitoring/prometheus/default.nix b/nixpkgs/pkgs/servers/monitoring/prometheus/default.nix
index b24c86cefb30..76a0155e7dfd 100644
--- a/nixpkgs/pkgs/servers/monitoring/prometheus/default.nix
+++ b/nixpkgs/pkgs/servers/monitoring/prometheus/default.nix
@@ -31,10 +31,10 @@
 }:
 
 let
-  version = "2.48.0";
+  version = "2.48.1";
   webUiStatic = fetchurl {
     url = "https://github.com/prometheus/prometheus/releases/download/v${version}/prometheus-web-ui-${version}.tar.gz";
-    hash = "sha256-B7BXjzTbIEEOYxgy0uvnbHPMV8WD9sRAW9yQd0h6vVc=";
+    hash = "sha256-8by9sz0EtiVuyoXR32h4++Fy01CyO8DfcsqPK3pSWHc=";
   };
 in
 buildGoModule rec {
@@ -47,7 +47,7 @@ buildGoModule rec {
     owner = "prometheus";
     repo = "prometheus";
     rev = "v${version}";
-    hash = "sha256-4mQcfYk+DwhVADVQ1JuNn4ZDq2xDyzcDZHMozFrSLyo=";
+    hash = "sha256-9vdbjqmIaomg0acWguWELIxmEZ9jVXYvFlAF+Uo3dMw=";
   };
 
   vendorHash = "sha256-OHTmAfhN+aPOJAIweW+GuvN2lNn2A+JeVU8chT1hqLU=";
diff --git a/nixpkgs/pkgs/servers/monitoring/prometheus/smartctl-exporter/0001-Return-the-cached-value-if-it-s-not-time-to-scan-aga.patch b/nixpkgs/pkgs/servers/monitoring/prometheus/smartctl-exporter/0001-Return-the-cached-value-if-it-s-not-time-to-scan-aga.patch
deleted file mode 100644
index 28616251f37e..000000000000
--- a/nixpkgs/pkgs/servers/monitoring/prometheus/smartctl-exporter/0001-Return-the-cached-value-if-it-s-not-time-to-scan-aga.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-From e81b06df67b1d42ef915615fafa0b56ef956673b Mon Sep 17 00:00:00 2001
-From: Andreas Fuchs <asf@boinkor.net>
-Date: Thu, 11 Feb 2021 17:30:44 -0500
-Subject: [PATCH] Return the cached value if it's not time to scan again yet
-
-This should ensure that if we have a valid value cached (which ought
-to be every time after the first scan), we return it as metrics.
-
-This fixes the crashes that would happen if queries happened earlier
-than the re-scan interval allowed.
-
-Address review feedback: Shorten the time-to-scan logic
-
-We can express this in a single if statement, so it takes fewer lines
-to do the "should we check again" check.
----
- readjson.go | 11 ++---------
- 1 file changed, 2 insertions(+), 9 deletions(-)
-
-diff --git a/readjson.go b/readjson.go
-index da35448..c9996fd 100644
---- a/readjson.go
-+++ b/readjson.go
-@@ -78,14 +78,7 @@ func readData(device string) (gjson.Result, error) {
- 
- 	if _, err := os.Stat(device); err == nil {
- 		cacheValue, cacheOk := jsonCache[device]
--		timeToScan := false
--		if cacheOk {
--			timeToScan = time.Now().After(cacheValue.LastCollect.Add(options.SMARTctl.CollectPeriodDuration))
--		} else {
--			timeToScan = true
--		}
--
--		if timeToScan {
-+		if !cacheOk || time.Now().After(cacheValue.LastCollect.Add(options.SMARTctl.CollectPeriodDuration)) {
- 			json, ok := readSMARTctl(device)
- 			if ok {
- 				jsonCache[device] = JSONCache{JSON: json, LastCollect: time.Now()}
-@@ -93,7 +86,7 @@ func readData(device string) (gjson.Result, error) {
- 			}
- 			return gjson.Parse(DEFAULT_EMPTY_JSON), fmt.Errorf("smartctl returned bad data for device %s", device)
- 		}
--		return gjson.Parse(DEFAULT_EMPTY_JSON), fmt.Errorf("Too early collect called for device %s", device)
-+		return cacheValue.JSON, nil
- 	}
- 	return gjson.Parse(DEFAULT_EMPTY_JSON), fmt.Errorf("Device %s unavialable", device)
- }
--- 
-2.33.1
-
diff --git a/nixpkgs/pkgs/servers/monitoring/prometheus/xmpp-alerts.nix b/nixpkgs/pkgs/servers/monitoring/prometheus/xmpp-alerts.nix
index f9d9ce499b5f..da6013b9b5ec 100644
--- a/nixpkgs/pkgs/servers/monitoring/prometheus/xmpp-alerts.nix
+++ b/nixpkgs/pkgs/servers/monitoring/prometheus/xmpp-alerts.nix
@@ -9,27 +9,18 @@
 
 python3Packages.buildPythonApplication rec {
   pname = "prometheus-xmpp-alerts";
-  version = "0.5.6";
+  version = "0.5.8";
+  format = "pyproject";
 
   src = fetchFromGitHub {
     owner = "jelmer";
     repo = pname;
     rev = "v${version}";
-    sha256 = "sha256-PwShGS1rbfZCK5OS6Cnn+mduOpWAD4fC69mcGB5GB1c=";
+    sha256 = "sha256-iwqcowwJktZQfdxykpsw/MweAPY0KF7ojVwvk1LP8a4=";
   };
 
-  patches = [
-    # Required until https://github.com/jelmer/prometheus-xmpp-alerts/pull/33 is merged
-    # and contained in a release
-    (fetchpatch {
-      name = "Fix-outdated-entrypoint-definiton.patch";
-      url = "https://github.com/jelmer/prometheus-xmpp-alerts/commit/c41dd41dbd3c781b874bcf0708f6976e6252b621.patch";
-      hash = "sha256-G7fRLSXbkI5EDgGf4n9xSVs54IPD0ev8rTEFffRvLY0=";
-    })
-  ];
-
   postPatch = ''
-    substituteInPlace setup.cfg \
+    substituteInPlace pyproject.toml \
       --replace "bs4" "beautifulsoup4"
   '';
 
@@ -46,6 +37,7 @@ python3Packages.buildPythonApplication rec {
   ]);
 
   nativeCheckInputs = with python3Packages; [
+    setuptools
     unittestCheckHook
     pytz
   ];