Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/scollector: Skip new "sc-set" sites that we can't do API calls on. #2032

Merged
merged 1 commit into from
Mar 6, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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