Skip to content
This repository was archived by the owner on Feb 13, 2025. It is now read-only.

Add google_webmaster collector.#1959

Merged
alienth merged 2 commits into
bosun-monitor:masterfrom
alienth:master
Nov 16, 2016
Merged

Add google_webmaster collector.#1959
alienth merged 2 commits into
bosun-monitor:masterfrom
alienth:master

Conversation

@alienth

@alienth alienth commented Nov 15, 2016

Copy link
Copy Markdown
Contributor

No description provided.

func analyticsClient(clientid string, secret string, tokenstr string) (*http.Client, error) {
// googleAPIClient() takes in a clientid, secret, a base64'd gob representing
// the cached oauth token, and a list of oauth scopes. Generating the token is
// left as an exercise to the reader.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because generating the token requires you to fire up an web endpoint, have the user open a URL, and then wait around for the user to authorize. Back when the GA collector was written, we decided that scollector should not be involved in doing that.

@kylebrandt

Copy link
Copy Markdown
Member

sorry to be more clear, I meant why not document the process?

On Wed, Nov 16, 2016 at 12:36 PM, Jason Harvey notifications@github.com
wrote:

@alienth commented on this pull request.

In cmd/scollector/collectors/google_analytics.go
#1959:

@@ -183,16 +183,17 @@ func getPageviews(md *opentsdb.MultiDataPoint, svc *analytics.Service, site conf
return nil
}

-// analyticsClient() takes in a clientid, secret, and a base64'd gob representing the cached oauth token.
-// Generating the token is left as an exercise to the reader. (TODO)
-func analyticsClient(clientid string, secret string, tokenstr string) (*http.Client, error) {
+// googleAPIClient() takes in a clientid, secret, a base64'd gob representing
+// the cached oauth token, and a list of oauth scopes. Generating the token is
+// left as an exercise to the reader.

Because generating the token requires you to fire up an web endpoint, have
the user open a URL, and then wait around for the user to authorize. Back
when the GA collector was written, we decided that scollector should not be
involved in doing that.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#1959, or mute the thread
https://github.com/notifications/unsubscribe-auth/ABnT0AQSSSpVAzbPM9oJ6JjwWcWPNhAyks5q-z8CgaJpZM4KyqOY
.

@alienth

alienth commented Nov 16, 2016

Copy link
Copy Markdown
Contributor Author

@kylebrandt because I don't remember how to do it. I'm just reusing the token I generated last time.

Could look into how that is done and document how to do it, but that's out of scope for this project.

@kylebrandt

Copy link
Copy Markdown
Member

Fair enough - code looks good to me

On Wed, Nov 16, 2016 at 12:38 PM, Jason Harvey notifications@github.com
wrote:

@kylebrandt https://github.com/kylebrandt because I don't remember how
to do it. I'm just reusing the token I generated last time.

Could look into how that is done and document how to do it, but that's out
of scope for this project.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#1959 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABnT0GxtIptqp9beI1bhUxgATv2NEYp3ks5q-z-LgaJpZM4KyqOY
.

@alienth alienth merged commit 9a6ec01 into bosun-monitor:master Nov 16, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants