From 5c46c1e57fd2d78ee0e3ef5f27ee6c768bfe70d8 Mon Sep 17 00:00:00 2001 From: Jason Harvey Date: Mon, 6 Mar 2017 12:19:27 -0900 Subject: [PATCH] cmd/scollector: Skip new "sc-set" sites that we can't do API calls on. --- cmd/scollector/collectors/google_webmaster.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/cmd/scollector/collectors/google_webmaster.go b/cmd/scollector/collectors/google_webmaster.go index ffd63e30b1..855f6c5228 100644 --- a/cmd/scollector/collectors/google_webmaster.go +++ b/cmd/scollector/collectors/google_webmaster.go @@ -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