Skip to content

Commit 3c20471

Browse files
authored
Creating label native-histogram-sample on the cortex_discarded_samples_total to keep track of discarded native histogram samples (#5289)
* Create new reason on the discarted sample metric - native histogram Signed-off-by: Alan Protasio <[email protected]> * fix build Signed-off-by: Alan Protasio <[email protected]> * fix proto Signed-off-by: Alan Protasio <[email protected]> * Resetting histogram Signed-off-by: Alan Protasio <[email protected]> * changelog Signed-off-by: Alan Protasio <[email protected]> --------- Signed-off-by: Alan Protasio <[email protected]>
1 parent 3d1315a commit 3c20471

File tree

11 files changed

+2106
-149
lines changed

11 files changed

+2106
-149
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## master / unreleased
44
* [CHANGE] Alertmanager: Validating new fields on the PagerDuty AM config. #5290
5+
* [CHANGE] Ingester: Creating label `native-histogram-sample` on the `cortex_discarded_samples_total` to keep track of discarded native histogram samples. #5289
56
* [BUGFIX] Ruler: Validate if rule group can be safely converted back to rule group yaml from protobuf message #5265
67
* [BUGFIX] Querier: Convert gRPC `ResourceExhausted` status code from store gateway to 422 limit error. #5286
78
* [BUGFIX] Alertmanager: Route web-ui requests to the alertmanager distributor when sharding is enabled. #5293

pkg/cortexpb/compat.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121

2222
// ToWriteRequest converts matched slices of Labels, Samples and Metadata into a WriteRequest proto.
2323
// It gets timeseries from the pool, so ReuseSlice() should be called when done.
24-
func ToWriteRequest(lbls []labels.Labels, samples []Sample, metadata []*MetricMetadata, source WriteRequest_SourceEnum) *WriteRequest {
24+
func ToWriteRequest(lbls []labels.Labels, samples []Sample, metadata []*MetricMetadata, histograms []Histogram, source WriteRequest_SourceEnum) *WriteRequest {
2525
req := &WriteRequest{
2626
Timeseries: PreallocTimeseriesSliceFromPool(),
2727
Metadata: metadata,
@@ -32,6 +32,9 @@ func ToWriteRequest(lbls []labels.Labels, samples []Sample, metadata []*MetricMe
3232
ts := TimeseriesFromPool()
3333
ts.Labels = append(ts.Labels, FromLabelsToLabelAdapters(lbls[i])...)
3434
ts.Samples = append(ts.Samples, s)
35+
if i < len(histograms) {
36+
ts.Histograms = append(ts.Histograms, histograms[i])
37+
}
3538
req.Timeseries = append(req.Timeseries, PreallocTimeseries{TimeSeries: ts})
3639
}
3740

0 commit comments

Comments
 (0)