Fix view in migration. Add by lang metric to consumer.

This commit is contained in:
mathan 2024-02-22 18:54:29 -08:00
parent 600dac7694
commit db425b1d5f
11 changed files with 101 additions and 33 deletions

View file

@ -295,6 +295,14 @@ func (c *Consumer) processMessage(ctx context.Context, typ string, r io.Reader,
log.Warn().Msgf("Unexpected key format: %q", k)
continue
}
langs, _, err := repo.GetLang(ctx, v)
if err == nil {
lang := ""
if len(langs) != 0 {
lang = langs[0]
}
postsByLanguageIndexed.WithLabelValues(c.remote.Host, lang).Inc()
}
recs = append(recs, repo.Record{
Repo: models.ID(repoInfo.ID),
Collection: parts[0],