mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
Fix TSDB head struct dump on querier error (#8379)
* Fix TSDB head struct dump on querier error Signed-off-by: Marco Pracucci <marco@pracucci.com> * Added mint/maxt to RangeHead.String() Signed-off-by: Marco Pracucci <marco@pracucci.com>
This commit is contained in:
parent
82330b96ee
commit
d8c17025df
14
tsdb/head.go
14
tsdb/head.go
|
@ -1010,6 +1010,13 @@ func (h *RangeHead) Meta() BlockMeta {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// String returns an human readable representation of the range head. It's important to
|
||||||
|
// keep this function in order to avoid the struct dump when the head is stringified in
|
||||||
|
// errors or logs.
|
||||||
|
func (h *RangeHead) String() string {
|
||||||
|
return fmt.Sprintf("range head (mint: %d, maxt: %d)", h.MinTime(), h.MaxTime())
|
||||||
|
}
|
||||||
|
|
||||||
// initAppender is a helper to initialize the time bounds of the head
|
// initAppender is a helper to initialize the time bounds of the head
|
||||||
// upon the first sample it receives.
|
// upon the first sample it receives.
|
||||||
type initAppender struct {
|
type initAppender struct {
|
||||||
|
@ -1492,6 +1499,13 @@ func (h *Head) Close() error {
|
||||||
return errs.Err()
|
return errs.Err()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// String returns an human readable representation of the TSDB head. It's important to
|
||||||
|
// keep this function in order to avoid the struct dump when the head is stringified in
|
||||||
|
// errors or logs.
|
||||||
|
func (h *Head) String() string {
|
||||||
|
return "head"
|
||||||
|
}
|
||||||
|
|
||||||
type headChunkReader struct {
|
type headChunkReader struct {
|
||||||
head *Head
|
head *Head
|
||||||
mint, maxt int64
|
mint, maxt int64
|
||||||
|
|
Loading…
Reference in a new issue