Skip to content

Commit

Permalink
Get rid of TODOs in favor of issue
Browse files Browse the repository at this point in the history
#4175

Signed-off-by: György Krajcsovits <[email protected]>
  • Loading branch information
krajorama committed Feb 7, 2023
1 parent 6731606 commit 524ae8b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 18 deletions.
1 change: 0 additions & 1 deletion pkg/distributor/distributor.go
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,6 @@ func New(cfg Config, clientConfig ingester_client.Config, limits *validation.Ove
Help: "Number of labels per sample.",
Buckets: []float64{5, 10, 15, 20, 25},
}),
// TODO switch to native histogram eventually and add "type" label
sampleDelayHistogram: promauto.With(reg).NewHistogram(prometheus.HistogramOpts{
Namespace: "cortex",
Name: "distributor_sample_delay_seconds",
Expand Down
14 changes: 4 additions & 10 deletions pkg/ingester/ingester.go
Original file line number Diff line number Diff line change
Expand Up @@ -1617,13 +1617,9 @@ func (i *Ingester) queryStreamSamples(ctx context.Context, db *userTSDB, from, t
t, v := it.At()
ts.Samples = append(ts.Samples, mimirpb.Sample{Value: v, TimestampMs: t})
case chunkenc.ValHistogram:
// TODO when read path for native histograms is ready, return Histogram samples
// t, v := it.AtHistogram()
// ts.Histograms = append(ts.Histograms, mimirpb.FromHistogramToHistogramProto(t, v))
// ignore
case chunkenc.ValFloatHistogram:
// TODO when read path for native histograms is ready, return Histogram samples
// t, v := it.AtFloatHistogram()
// ts.Histograms = append(ts.Histograms, mimirpb.FromFloatHistogramToHistogramProto(t, v))
// ignore
default:
return 0, 0, 0, fmt.Errorf("unsupported value type: %v", valType)
}
Expand Down Expand Up @@ -1727,11 +1723,9 @@ func (i *Ingester) queryStreamChunks(ctx context.Context, db *userTSDB, from, th
case chunkenc.EncXOR:
ch.Encoding = int32(chunk.PrometheusXorChunk)
case chunkenc.EncHistogram:
// ch.Encoding = int32(chunk.PrometheusHistogramChunk)
continue // TODO when read path for native histograms is ready, return Histogram chunks
continue // ignore
case chunkenc.EncFloatHistogram:
// ch.Encoding = int32(chunk.PrometheusFloatHistogramChunk)
continue // TODO when read path for native histograms is ready, return FloatHistogram chunks
continue // ignore
default:
return 0, 0, errors.Errorf("unknown chunk encoding from TSDB chunk querier: %v", meta.Chunk.Encoding())
}
Expand Down
5 changes: 0 additions & 5 deletions pkg/ingester/ingester_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7441,11 +7441,6 @@ func testIngesterCanEnableIngestAndQueryNativeHistograms(t *testing.T, sampleHis
Timestamp: 0,
Value: 1,
}},
// TODO when read path for native histograms is ready, uncomment this
// Histograms: []model.SampleHistogramPair{{
// Timestamp: 2,
// Histogram: expectHistogram,
// }},
}}

testResult(expectedMatrix, "Result should contain the histogram when accepting histograms")
Expand Down
2 changes: 0 additions & 2 deletions pkg/ingester/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ func newIngesterMetrics(
Name: "cortex_ingester_queries_total",
Help: "The total number of queries the ingester has handled.",
}),
// TODO use native histograms and add "type" label
queriedSamples: promauto.With(r).NewHistogram(prometheus.HistogramOpts{
Name: "cortex_ingester_queried_samples",
Help: "The total number of samples returned from queries.",
Expand All @@ -164,7 +163,6 @@ func newIngesterMetrics(
Name: "cortex_ingester_queries_ephemeral_total",
Help: "The total number of queries the ingester has handled for ephemeral storage.",
}),
// TODO use native histograms and add "type" label
ephemeralQueriedSamples: promauto.With(r).NewHistogram(prometheus.HistogramOpts{
Name: "cortex_ingester_queried_ephemeral_samples",
Help: "The total number of samples from ephemeral storage returned per query.",
Expand Down

0 comments on commit 524ae8b

Please sign in to comment.