{"action":"created","comment":{"url":"https://api.github.com/repos/prometheus/prometheus/pulls/comments/69185745","id":69185745,"diff_hunk":"@@ -828,6 +836,47 @@ func (c *KubernetesSDConfig) UnmarshalYAML(unmarshal func(interface{}) error) er\n \treturn nil\n }\n \n+// GCESDConfig is the configuration for GCE based service discovery.\n+type GCESDConfig struct {\n+\t// Project: The Google Cloud Project ID\n+\tProject string `yaml:\"project\"`\n+\n+\t// Zone: The zone of the scrape targets.\n+\t// If you need to configure multiple zones use multiple gce_sd_configs\n+\tZone string `yaml:\"zone\"`\n+\n+\t// Filter: Can be used optionally to filter the instance list by other criteria.\n+\t// Syntax of this filter string is described here in the filter query parameter section:\n+\t// https://cloud.google.com/compute/docs/reference/latest/instances/list\n+\tFilter string `yaml:\"filter,omitempty\"`","path":"config/config.go","position":38,"original_position":38,"commit_id":"aaf0f438d9011e3d02fff333c738551ab9d491d0","original_commit_id":"aaf0f438d9011e3d02fff333c738551ab9d491d0","user":{"login":"gottwald","id":1154338,"avatar_url":"https://avatars.githubusercontent.com/u/1154338?v=3","gravatar_id":"","url":"https://api.github.com/users/gottwald","html_url":"https://github.com/gottwald","followers_url":"https://api.github.com/users/gottwald/followers","following_url":"https://api.github.com/users/gottwald/following{/other_user}","gists_url":"https://api.github.com/users/gottwald/gists{/gist_id}","starred_url":"https://api.github.com/users/gottwald/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gottwald/subscriptions","organizations_url":"https://api.github.com/users/gottwald/orgs","repos_url":"https://api.github.com/users/gottwald/repos","events_url":"https://api.github.com/users/gottwald/events{/privacy}","received_events_url":"https://api.github.com/users/gottwald/received_events","type":"User","site_admin":false},"body":"So just a joined string. Just to be sure, \",\" at the beginning and at the end?","created_at":"2016-06-30T18:31:07Z","updated_at":"2016-06-30T18:31:08Z","html_url":"https://github.com/prometheus/prometheus/pull/1769#discussion_r69185745","pull_request_url":"https://api.github.com/repos/prometheus/prometheus/pulls/1769","_links":{"self":{"href":"https://api.github.com/repos/prometheus/prometheus/pulls/comments/69185745"},"html":{"href":"https://github.com/prometheus/prometheus/pull/1769#discussion_r69185745"},"pull_request":{"href":"https://api.github.com/repos/prometheus/prometheus/pulls/1769"}}},"pull_request":{"url":"https://api.github.com/repos/prometheus/prometheus/pulls/1769","id":75476622,"html_url":"https://github.com/prometheus/prometheus/pull/1769","diff_url":"https://github.com/prometheus/prometheus/pull/1769.diff","patch_url":"https://github.com/prometheus/prometheus/pull/1769.patch","issue_url":"https://api.github.com/repos/prometheus/prometheus/issues/1769","number":1769,"state":"open","locked":false,"title":"GCE discovery","user":{"login":"gottwald","id":1154338,"avatar_url":"https://avatars.githubusercontent.com/u/1154338?v=3","gravatar_id":"","url":"https://api.github.com/users/gottwald","html_url":"https://github.com/gottwald","followers_url":"https://api.github.com/users/gottwald/followers","following_url":"https://api.github.com/users/gottwald/following{/other_user}","gists_url":"https://api.github.com/users/gottwald/gists{/gist_id}","starred_url":"https://api.github.com/users/gottwald/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gottwald/subscriptions","organizations_url":"https://api.github.com/users/gottwald/orgs","repos_url":"https://api.github.com/users/gottwald/repos","events_url":"https://api.github.com/users/gottwald/events{/privacy}","received_events_url":"https://api.github.com/users/gottwald/received_events","type":"User","site_admin":false},"body":"This enables discovery for GCE Scraping targets\r\n\r\nSimple example scrape config:\r\n```\r\nscrape_configs:\r\n  - job_name: node-exporter\r\n    gce_sd_configs:\r\n      - project: your-project-id\r\n        zone: europe-west1-b\r\n        port: 9100\r\n    relabel_configs:\r\n      - source_labels: ['__meta_gce_instance_name']\r\n        target_label: 'instance_name'\r\n```\r\n\r\nAuthentication is handled by the google libs DefaultClient and work like this:\r\n(copied from the lib documentation)\r\n```\r\nIt looks for credentials in the following places, preferring the first location found:\r\n1. A JSON file whose path is specified by the\r\n   GOOGLE_APPLICATION_CREDENTIALS environment variable.\r\n2. A JSON file in a location known to the gcloud command-line tool.\r\n   On Windows, this is %APPDATA%/gcloud/application_default_credentials.json.\r\n   On other systems, $HOME/.config/gcloud/application_default_credentials.json.\r\n3. On Google App Engine it uses the appengine.AccessToken function.\r\n4. On Google Compute Engine and Google App Engine Managed VMs, it fetches\r\n   credentials from the metadata server.\r\n   (In this final case any provided scopes are ignored.)\r\n```","created_at":"2016-06-28T13:27:01Z","updated_at":"2016-06-30T18:31:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7f2097263c1f880707337e7377a22cb1e00375b9","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/prometheus/prometheus/pulls/1769/commits","review_comments_url":"https://api.github.com/repos/prometheus/prometheus/pulls/1769/comments","review_comment_url":"https://api.github.com/repos/prometheus/prometheus/pulls/comments{/number}","comments_url":"https://api.github.com/repos/prometheus/prometheus/issues/1769/comments","statuses_url":"https://api.github.com/repos/prometheus/prometheus/statuses/aaf0f438d9011e3d02fff333c738551ab9d491d0","head":{"label":"gottwald:gce-discovery","ref":"gce-discovery","sha":"aaf0f438d9011e3d02fff333c738551ab9d491d0","user":{"login":"gottwald","id":1154338,"avatar_url":"https://avatars.githubusercontent.com/u/1154338?v=3","gravatar_id":"","url":"https://api.github.com/users/gottwald","html_url":"https://github.com/gottwald","followers_url":"https://api.github.com/users/gottwald/followers","following_url":"https://api.github.com/users/gottwald/following{/other_user}","gists_url":"https://api.github.com/users/gottwald/gists{/gist_id}","starred_url":"https://api.github.com/users/gottwald/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gottwald/subscriptions","organizations_url":"https://api.github.com/users/gottwald/orgs","repos_url":"https://api.github.com/users/gottwald/repos","events_url":"https://api.github.com/users/gottwald/events{/privacy}","received_events_url":"https://api.github.com/users/gottwald/received_events","type":"User","site_admin":false},"repo":{"id":61634523,"name":"prometheus","full_name":"gottwald/prometheus","owner":{"login":"gottwald","id":1154338,"avatar_url":"https://avatars.githubusercontent.com/u/1154338?v=3","gravatar_id":"","url":"https://api.github.com/users/gottwald","html_url":"https://github.com/gottwald","followers_url":"https://api.github.com/users/gottwald/followers","following_url":"https://api.github.com/users/gottwald/following{/other_user}","gists_url":"https://api.github.com/users/gottwald/gists{/gist_id}","starred_url":"https://api.github.com/users/gottwald/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gottwald/subscriptions","organizations_url":"https://api.github.com/users/gottwald/orgs","repos_url":"https://api.github.com/users/gottwald/repos","events_url":"https://api.github.com/users/gottwald/events{/privacy}","received_events_url":"https://api.github.com/users/gottwald/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gottwald/prometheus","description":"The Prometheus monitoring system and time series database.","fork":true,"url":"https://api.github.com/repos/gottwald/prometheus","forks_url":"https://api.github.com/repos/gottwald/prometheus/forks","keys_url":"https://api.github.com/repos/gottwald/prometheus/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gottwald/prometheus/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gottwald/prometheus/teams","hooks_url":"https://api.github.com/repos/gottwald/prometheus/hooks","issue_events_url":"https://api.github.com/repos/gottwald/prometheus/issues/events{/number}","events_url":"https://api.github.com/repos/gottwald/prometheus/events","assignees_url":"https://api.github.com/repos/gottwald/prometheus/assignees{/user}","branches_url":"https://api.github.com/repos/gottwald/prometheus/branches{/branch}","tags_url":"https://api.github.com/repos/gottwald/prometheus/tags","blobs_url":"https://api.github.com/repos/gottwald/prometheus/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gottwald/prometheus/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gottwald/prometheus/git/refs{/sha}","trees_url":"https://api.github.com/repos/gottwald/prometheus/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gottwald/prometheus/statuses/{sha}","languages_url":"https://api.github.com/repos/gottwald/prometheus/languages","stargazers_url":"https://api.github.com/repos/gottwald/prometheus/stargazers","contributors_url":"https://api.github.com/repos/gottwald/prometheus/contributors","subscribers_url":"https://api.github.com/repos/gottwald/prometheus/subscribers","subscription_url":"https://api.github.com/repos/gottwald/prometheus/subscription","commits_url":"https://api.github.com/repos/gottwald/prometheus/commits{/sha}","git_commits_url":"https://api.github.com/repos/gottwald/prometheus/git/commits{/sha}","comments_url":"https://api.github.com/repos/gottwald/prometheus/comments{/number}","issue_comment_url":"https://api.github.com/repos/gottwald/prometheus/issues/comments{/number}","contents_url":"https://api.github.com/repos/gottwald/prometheus/contents/{+path}","compare_url":"https://api.github.com/repos/gottwald/prometheus/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gottwald/prometheus/merges","archive_url":"https://api.github.com/repos/gottwald/prometheus/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gottwald/prometheus/downloads","issues_url":"https://api.github.com/repos/gottwald/prometheus/issues{/number}","pulls_url":"https://api.github.com/repos/gottwald/prometheus/pulls{/number}","milestones_url":"https://api.github.com/repos/gottwald/prometheus/milestones{/number}","notifications_url":"https://api.github.com/repos/gottwald/prometheus/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gottwald/prometheus/labels{/name}","releases_url":"https://api.github.com/repos/gottwald/prometheus/releases{/id}","deployments_url":"https://api.github.com/repos/gottwald/prometheus/deployments","created_at":"2016-06-21T13:06:43Z","updated_at":"2016-06-21T13:06:45Z","pushed_at":"2016-06-28T13:18:55Z","git_url":"git://github.com/gottwald/prometheus.git","ssh_url":"git@github.com:gottwald/prometheus.git","clone_url":"https://github.com/gottwald/prometheus.git","svn_url":"https://github.com/gottwald/prometheus","homepage":"https://prometheus.io/","size":11583,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"prometheus:master","ref":"master","sha":"f68789dc5a5753f387bbf9ddabde5688fd560bfe","user":{"login":"prometheus","id":3380462,"avatar_url":"https://avatars.githubusercontent.com/u/3380462?v=3","gravatar_id":"","url":"https://api.github.com/users/prometheus","html_url":"https://github.com/prometheus","followers_url":"https://api.github.com/users/prometheus/followers","following_url":"https://api.github.com/users/prometheus/following{/other_user}","gists_url":"https://api.github.com/users/prometheus/gists{/gist_id}","starred_url":"https://api.github.com/users/prometheus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prometheus/subscriptions","organizations_url":"https://api.github.com/users/prometheus/orgs","repos_url":"https://api.github.com/users/prometheus/repos","events_url":"https://api.github.com/users/prometheus/events{/privacy}","received_events_url":"https://api.github.com/users/prometheus/received_events","type":"Organization","site_admin":false},"repo":{"id":6838921,"name":"prometheus","full_name":"prometheus/prometheus","owner":{"login":"prometheus","id":3380462,"avatar_url":"https://avatars.githubusercontent.com/u/3380462?v=3","gravatar_id":"","url":"https://api.github.com/users/prometheus","html_url":"https://github.com/prometheus","followers_url":"https://api.github.com/users/prometheus/followers","following_url":"https://api.github.com/users/prometheus/following{/other_user}","gists_url":"https://api.github.com/users/prometheus/gists{/gist_id}","starred_url":"https://api.github.com/users/prometheus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prometheus/subscriptions","organizations_url":"https://api.github.com/users/prometheus/orgs","repos_url":"https://api.github.com/users/prometheus/repos","events_url":"https://api.github.com/users/prometheus/events{/privacy}","received_events_url":"https://api.github.com/users/prometheus/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/prometheus/prometheus","description":"The Prometheus monitoring system and time series database.","fork":false,"url":"https://api.github.com/repos/prometheus/prometheus","forks_url":"https://api.github.com/repos/prometheus/prometheus/forks","keys_url":"https://api.github.com/repos/prometheus/prometheus/keys{/key_id}","collaborators_url":"https://api.github.com/repos/prometheus/prometheus/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/prometheus/prometheus/teams","hooks_url":"https://api.github.com/repos/prometheus/prometheus/hooks","issue_events_url":"https://api.github.com/repos/prometheus/prometheus/issues/events{/number}","events_url":"https://api.github.com/repos/prometheus/prometheus/events","assignees_url":"https://api.github.com/repos/prometheus/prometheus/assignees{/user}","branches_url":"https://api.github.com/repos/prometheus/prometheus/branches{/branch}","tags_url":"https://api.github.com/repos/prometheus/prometheus/tags","blobs_url":"https://api.github.com/repos/prometheus/prometheus/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/prometheus/prometheus/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/prometheus/prometheus/git/refs{/sha}","trees_url":"https://api.github.com/repos/prometheus/prometheus/git/trees{/sha}","statuses_url":"https://api.github.com/repos/prometheus/prometheus/statuses/{sha}","languages_url":"https://api.github.com/repos/prometheus/prometheus/languages","stargazers_url":"https://api.github.com/repos/prometheus/prometheus/stargazers","contributors_url":"https://api.github.com/repos/prometheus/prometheus/contributors","subscribers_url":"https://api.github.com/repos/prometheus/prometheus/subscribers","subscription_url":"https://api.github.com/repos/prometheus/prometheus/subscription","commits_url":"https://api.github.com/repos/prometheus/prometheus/commits{/sha}","git_commits_url":"https://api.github.com/repos/prometheus/prometheus/git/commits{/sha}","comments_url":"https://api.github.com/repos/prometheus/prometheus/comments{/number}","issue_comment_url":"https://api.github.com/repos/prometheus/prometheus/issues/comments{/number}","contents_url":"https://api.github.com/repos/prometheus/prometheus/contents/{+path}","compare_url":"https://api.github.com/repos/prometheus/prometheus/compare/{base}...{head}","merges_url":"https://api.github.com/repos/prometheus/prometheus/merges","archive_url":"https://api.github.com/repos/prometheus/prometheus/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/prometheus/prometheus/downloads","issues_url":"https://api.github.com/repos/prometheus/prometheus/issues{/number}","pulls_url":"https://api.github.com/repos/prometheus/prometheus/pulls{/number}","milestones_url":"https://api.github.com/repos/prometheus/prometheus/milestones{/number}","notifications_url":"https://api.github.com/repos/prometheus/prometheus/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/prometheus/prometheus/labels{/name}","releases_url":"https://api.github.com/repos/prometheus/prometheus/releases{/id}","deployments_url":"https://api.github.com/repos/prometheus/prometheus/deployments","created_at":"2012-11-24T11:14:12Z","updated_at":"2016-06-30T16:52:05Z","pushed_at":"2016-06-30T07:30:15Z","git_url":"git://github.com/prometheus/prometheus.git","ssh_url":"git@github.com:prometheus/prometheus.git","clone_url":"https://github.com/prometheus/prometheus.git","svn_url":"https://github.com/prometheus/prometheus","homepage":"https://prometheus.io/","size":15391,"stargazers_count":5147,"watchers_count":5147,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":440,"mirror_url":null,"open_issues_count":166,"forks":440,"open_issues":166,"watchers":5147,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/prometheus/prometheus/pulls/1769"},"html":{"href":"https://github.com/prometheus/prometheus/pull/1769"},"issue":{"href":"https://api.github.com/repos/prometheus/prometheus/issues/1769"},"comments":{"href":"https://api.github.com/repos/prometheus/prometheus/issues/1769/comments"},"review_comments":{"href":"https://api.github.com/repos/prometheus/prometheus/pulls/1769/comments"},"review_comment":{"href":"https://api.github.com/repos/prometheus/prometheus/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/prometheus/prometheus/pulls/1769/commits"},"statuses":{"href":"https://api.github.com/repos/prometheus/prometheus/statuses/aaf0f438d9011e3d02fff333c738551ab9d491d0"}}}}
{"actor":{"display_login":"gottwald"}}