mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Search poc: Add debug log for metric and update metric buckets (#95217)
* adds debug log for metric * updates buckets
This commit is contained in:
parent
b189743ca0
commit
d9bc4f7395
@ -53,7 +53,7 @@ func (i *Index) IndexBatch(list *ListResponse, kind string) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
i.log.Debug("initial indexing resources batch", "count", len(list.Items), "kind", kind, "tenant", res.Namespace)
|
||||
i.log.Debug("indexing resource in batch", "batch_count", len(list.Items), "kind", kind, "tenant", res.Namespace)
|
||||
|
||||
// Transform the raw resource into a more generic indexable resource
|
||||
indexableResource, err := NewIndexedResource(obj.Value)
|
||||
@ -88,6 +88,7 @@ func (i *Index) Init(ctx context.Context) error {
|
||||
|
||||
// Paginate through the list of resources and index each page
|
||||
for {
|
||||
i.log.Debug("fetching resource list", "kind", rt.Key.Resource)
|
||||
list, err := i.s.List(ctx, r)
|
||||
if err != nil {
|
||||
return err
|
||||
@ -108,6 +109,7 @@ func (i *Index) Init(ctx context.Context) error {
|
||||
}
|
||||
|
||||
end := time.Now().Unix()
|
||||
i.log.Debug("Initial indexing finished", "seconds", float64(end-start))
|
||||
if IndexServerMetrics != nil {
|
||||
IndexServerMetrics.IndexCreationTime.WithLabelValues().Observe(float64(end - start))
|
||||
}
|
||||
|
@ -26,7 +26,7 @@ type IndexMetrics struct {
|
||||
IndexCreationTime *prometheus.HistogramVec
|
||||
}
|
||||
|
||||
var IndexCreationBuckets = []float64{1, 5, 10, 25, 50, 75, 100, 150, 200, 250, 300}
|
||||
var IndexCreationBuckets = []float64{1, 5, 10, 25, 50, 75, 100, 200, 300, 400, 500, 600, 700, 800, 900, 1000}
|
||||
|
||||
func NewIndexMetrics(indexDir string, indexServer *IndexServer) *IndexMetrics {
|
||||
onceIndex.Do(func() {
|
||||
|
Loading…
Reference in New Issue
Block a user