Skip to content

Commit

Permalink
Merge pull request #2032 from alienth/master
Browse files Browse the repository at this point in the history
cmd/scollector: Skip new "sc-set" sites that we can't do API calls on.
  • Loading branch information
alienth authored Mar 6, 2017
2 parents 5ceb838 + 5c46c1e commit 08bbf14
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion cmd/scollector/collectors/google_webmaster.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package collectors

import (
"net/url"
"strings"
"time"

"bosun.org/cmd/scollector/conf"
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 08bbf14

Please sign in to comment.