Skip to content

Commit

Permalink
Creating label native-histogram-sample on the `cortex_discarded_sam…
Browse files Browse the repository at this point in the history
…ples_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 <alanprot@gmail.com>

* fix build

Signed-off-by: Alan Protasio <alanprot@gmail.com>

* fix proto

Signed-off-by: Alan Protasio <alanprot@gmail.com>

* Resetting histogram

Signed-off-by: Alan Protasio <alanprot@gmail.com>

* changelog

Signed-off-by: Alan Protasio <alanprot@gmail.com>

---------

Signed-off-by: Alan Protasio <alanprot@gmail.com>
  • Loading branch information
alanprot authored Apr 28, 2023
1 parent 3d1315a commit 3c20471
Show file tree
Hide file tree
Showing 11 changed files with 2,106 additions and 149 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## master / unreleased
* [CHANGE] Alertmanager: Validating new fields on the PagerDuty AM config. #5290
* [CHANGE] Ingester: Creating label `native-histogram-sample` on the `cortex_discarded_samples_total` to keep track of discarded native histogram samples. #5289
* [BUGFIX] Ruler: Validate if rule group can be safely converted back to rule group yaml from protobuf message #5265
* [BUGFIX] Querier: Convert gRPC `ResourceExhausted` status code from store gateway to 422 limit error. #5286
* [BUGFIX] Alertmanager: Route web-ui requests to the alertmanager distributor when sharding is enabled. #5293
Expand Down
5 changes: 4 additions & 1 deletion pkg/cortexpb/compat.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (

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

Expand Down
Loading

0 comments on commit 3c20471

Please sign in to comment.