From c9f9c06000c78a4e29f8542891faf210b59ad262 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Piotr=20Ma=C5=9Blanka?= <pmaslanka@smok.co>
Date: Mon, 29 Nov 2021 12:31:59 +0100
Subject: [PATCH] v2.18.8

---
 CHANGELOG.md                                              | 1 +
 satella/__init__.py                                       | 2 +-
 satella/instrumentation/metrics/metric_types/histogram.py | 8 ++++----
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 961b300d..324eb601 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,3 +2,4 @@
 
 * added parameter to unpack_dict
 * minor import fixes and optimizations
+* fixed a major histogram metric bug where ge would get replaced by le
diff --git a/satella/__init__.py b/satella/__init__.py
index 4cdb0477..a0959af1 100644
--- a/satella/__init__.py
+++ b/satella/__init__.py
@@ -1 +1 @@
-__version__ = '2.18.8a4'
+__version__ = '2.18.8'
diff --git a/satella/instrumentation/metrics/metric_types/histogram.py b/satella/instrumentation/metrics/metric_types/histogram.py
index 06214158..6b1fbe3f 100644
--- a/satella/instrumentation/metrics/metric_types/histogram.py
+++ b/satella/instrumentation/metrics/metric_types/histogram.py
@@ -13,9 +13,9 @@ class HistogramMetric(EmbeddedSubmetrics, MeasurableMixin):
     """
     A histogram, by  `Prometheus' <https://github.com/prometheus/client_python#histogram/>`_
     interpretation.
-    
+
     :param buckets: buckets to add. First bucket will be from zero to first value, second from first
-        value to second, last bucket will be from last value to infinity. So there are 
+        value to second, last bucket will be from last value to infinity. So there are
         len(buckets)+1 buckets. Buckets are expected to be passed in sorted!
     :param aggregate_children: whether to accept child calls to be later presented as total
     """
@@ -76,8 +76,8 @@ class HistogramMetric(EmbeddedSubmetrics, MeasurableMixin):
         for amount, upper_bound in zip(self.buckets,
                                        self.bucket_limits + [math.inf]):
             labels = self.labels.copy()
-            labels.update(le=upper_bound,
-                          ge=lower_bound)
+            labels.update(ge=upper_bound,
+                          le=lower_bound)
             output.append(
                 MetricData(self.name, amount, labels, self.get_timestamp(), self.internal))
             lower_bound = upper_bound
-- 
GitLab