Skip to content

Commit

Permalink
Add min max fields to Histogram
Browse files Browse the repository at this point in the history
  • Loading branch information
ocelotl committed Jun 13, 2022
1 parent 6e282d2 commit ce00441
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ def _translate_data(
sum=data_point.sum,
bucket_counts=data_point.bucket_counts,
explicit_bounds=data_point.explicit_bounds,
max=data_point.max,
min=data_point.min,
)
pb2_metric.histogram.aggregation_temporality = (
metric.data.aggregation_temporality
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,8 @@ def test_translate_histogram(self):
explicit_bounds=[10.0, 20.0],
exemplars=[],
flags=pb2.DataPointFlags.FLAG_NONE,
max=18.0,
min=8.0,
)
],
aggregation_temporality=AggregationTemporality.DELTA,
Expand All @@ -736,6 +738,7 @@ def test_translate_histogram(self):
self.assertEqual(expected, actual)

def test_translate_multiple_scope_histogram(self):
self.maxDiff = None
expected = ExportMetricsServiceRequest(
resource_metrics=[
pb2.ResourceMetrics(
Expand Down Expand Up @@ -782,6 +785,8 @@ def test_translate_multiple_scope_histogram(self):
explicit_bounds=[10.0, 20.0],
exemplars=[],
flags=pb2.DataPointFlags.FLAG_NONE,
max=18.0,
min=8.0,
)
],
aggregation_temporality=AggregationTemporality.DELTA,
Expand Down Expand Up @@ -816,6 +821,8 @@ def test_translate_multiple_scope_histogram(self):
explicit_bounds=[10.0, 20.0],
exemplars=[],
flags=pb2.DataPointFlags.FLAG_NONE,
max=18.0,
min=8.0,
)
],
aggregation_temporality=AggregationTemporality.DELTA,
Expand Down Expand Up @@ -857,6 +864,8 @@ def test_translate_multiple_scope_histogram(self):
explicit_bounds=[10.0, 20.0],
exemplars=[],
flags=pb2.DataPointFlags.FLAG_NONE,
max=18.0,
min=8.0,
)
],
aggregation_temporality=AggregationTemporality.DELTA,
Expand Down Expand Up @@ -898,6 +907,8 @@ def test_translate_multiple_scope_histogram(self):
explicit_bounds=[10.0, 20.0],
exemplars=[],
flags=pb2.DataPointFlags.FLAG_NONE,
max=18.0,
min=8.0,
)
],
aggregation_temporality=AggregationTemporality.DELTA,
Expand Down

0 comments on commit ce00441

Please sign in to comment.