cmd/scollector: Skip new "sc-set" sites that we can't do API calls on.
@@ -2,6 +2,7 @@ package collectors
import (
"net/url"
+ "strings"
"time"
"bosun.org/cmd/scollector/conf"
@@ -65,6 +66,12 @@ func getWebmasterErrorsMetrics(svc *webmasters.Service) (*opentsdb.MultiDataPoin
if err != nil {
return nil, err
}
+ // Webmasters has these new sets with fake URLs like "sc-set:jJfZIHyI4-DY8wg0Ww4l-A".
+ // Most API calls we use fail for these sites, so we skip em.
+ // TODO: Allow these sites once the API supports em.
+ if strings.HasPrefix(site.SiteUrl, "sc-set") {
+ continue
+ }
if site.PermissionLevel == "siteUnverifiedUser" {
slog.Errorf("Lack permission to fetch error metrics for site %s. Skipping.\n", u.Host)
continue
@@ -76,7 +83,8 @@ func getWebmasterErrorsMetrics(svc *webmasters.Service) (*opentsdb.MultiDataPoin
<-throttle
crawlErrors, err := svc.Urlcrawlerrorscounts.Query(site.SiteUrl).LatestCountsOnly(true).Do()
if err != nil {
- return nil, err
+ slog.Errorf("Error fetching error counts for site %s: %s", u.Host, err)
+ continue
}
for _, e := range crawlErrors.CountPerTypes {
tags["platform"] = e.Platform
