this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

add metric indexer_catchup_events_failed, add "how" tag to indexer_catchup_events_enqueued

authored by

Brian Olson and committed by
Brian Olson
ef5b0b81 de950cc4

+12 -3
+3 -1
indexer/crawler.go
··· 173 173 } 174 174 175 175 func (c *CrawlDispatcher) addToCatchupQueue(catchup *catchupJob) *crawlWork { 176 - catchupEventsEnqueued.Inc() 177 176 c.maplk.Lock() 178 177 defer c.maplk.Unlock() 179 178 180 179 // If the actor crawl is enqueued, we can append to the catchup queue which gets emptied during the crawl 181 180 job, ok := c.todo[catchup.user.Uid] 182 181 if ok { 182 + catchupEventsEnqueued.WithLabelValues("todo").Inc() 183 183 job.catchup = append(job.catchup, catchup) 184 184 return nil 185 185 } ··· 187 187 // If the actor crawl is in progress, we can append to the nextr queue which gets emptied after the crawl 188 188 job, ok = c.inProgress[catchup.user.Uid] 189 189 if ok { 190 + catchupEventsEnqueued.WithLabelValues("prog").Inc() 190 191 job.next = append(job.next, catchup) 191 192 return nil 192 193 } 193 194 195 + catchupEventsEnqueued.WithLabelValues("new").Inc() 194 196 // Otherwise, we need to create a new crawl job for this actor and enqueue it 195 197 cw := &crawlWork{ 196 198 act: catchup.user,
+7 -2
indexer/metrics.go
··· 25 25 Help: "Number of repos fetched", 26 26 }, []string{"status"}) 27 27 28 - var catchupEventsEnqueued = promauto.NewCounter(prometheus.CounterOpts{ 28 + var catchupEventsEnqueued = promauto.NewCounterVec(prometheus.CounterOpts{ 29 29 Name: "indexer_catchup_events_enqueued", 30 30 Help: "Number of catchup events enqueued", 31 - }) 31 + }, []string{"how"}) 32 32 33 33 var catchupEventsProcessed = promauto.NewCounter(prometheus.CounterOpts{ 34 34 Name: "indexer_catchup_events_processed", 35 35 Help: "Number of catchup events processed", 36 36 }) 37 + 38 + var catchupEventsFailed = promauto.NewCounterVec(prometheus.CounterOpts{ 39 + Name: "indexer_catchup_events_failed", 40 + Help: "Number of catchup events processed", 41 + }, []string{"err"})
+2
indexer/repofetch.go
··· 107 107 108 108 var pds models.PDS 109 109 if err := rf.db.First(&pds, "id = ?", ai.PDS).Error; err != nil { 110 + catchupEventsFailed.WithLabelValues("nopds").Inc() 110 111 return fmt.Errorf("expected to find pds record (%d) in db for crawling one of their users: %w", ai.PDS, err) 111 112 } 112 113 113 114 rev, err := rf.repoman.GetRepoRev(ctx, ai.Uid) 114 115 if err != nil && !isNotFound(err) { 116 + catchupEventsFailed.WithLabelValues("noroot").Inc() 115 117 return fmt.Errorf("failed to get repo root: %w", err) 116 118 } 117 119