2019-04-02 23:06:15 +00:00
|
|
|
# GitHub Input Plugin
|
|
|
|
|
2019-04-02 23:27:45 +00:00
|
|
|
Gather repository information from [GitHub][] hosted repositories.
|
2019-04-02 23:06:15 +00:00
|
|
|
|
2019-04-02 23:27:45 +00:00
|
|
|
**Note:** Telegraf also contains the [webhook][] input which can be used as an
|
|
|
|
alternative method for collecting repository information.
|
|
|
|
|
|
|
|
### Configuration
|
2019-04-02 23:06:15 +00:00
|
|
|
|
|
|
|
```toml
|
|
|
|
[[inputs.github]]
|
|
|
|
## List of repositories to monitor
|
2019-08-20 02:08:38 +00:00
|
|
|
repositories = [
|
|
|
|
"influxdata/telegraf",
|
|
|
|
"influxdata/influxdb"
|
|
|
|
]
|
2019-04-02 23:06:15 +00:00
|
|
|
|
2019-04-02 23:27:45 +00:00
|
|
|
## Github API access token. Unauthenticated requests are limited to 60 per hour.
|
2019-04-02 23:06:15 +00:00
|
|
|
# access_token = ""
|
2019-08-20 02:08:38 +00:00
|
|
|
|
2019-08-02 20:05:46 +00:00
|
|
|
## Github API enterprise url. Github Enterprise accounts must specify their base url.
|
|
|
|
# enterprise_base_url = ""
|
2019-04-02 23:06:15 +00:00
|
|
|
|
2019-04-02 23:27:45 +00:00
|
|
|
## Timeout for HTTP requests.
|
2019-04-02 23:06:15 +00:00
|
|
|
# http_timeout = "5s"
|
|
|
|
```
|
|
|
|
|
2019-04-02 23:27:45 +00:00
|
|
|
### Metrics
|
2019-04-02 23:06:15 +00:00
|
|
|
|
|
|
|
- github_repository
|
|
|
|
- tags:
|
2019-04-02 23:27:45 +00:00
|
|
|
- name - The repository name
|
|
|
|
- owner - The owner of the repository
|
|
|
|
- language - The primary language of the repository
|
|
|
|
- license - The license set for the repository
|
2019-04-02 23:06:15 +00:00
|
|
|
- fields:
|
2019-04-02 23:27:45 +00:00
|
|
|
- forks (int)
|
|
|
|
- open_issues (int)
|
2019-07-23 23:04:51 +00:00
|
|
|
- networks (int)
|
2019-04-02 23:27:45 +00:00
|
|
|
- size (int)
|
2019-07-23 23:04:51 +00:00
|
|
|
- subscribers (int)
|
|
|
|
- stars (int)
|
|
|
|
- watchers (int)
|
2019-04-02 23:27:45 +00:00
|
|
|
|
|
|
|
When the [internal][] input is enabled:
|
2019-04-02 23:06:15 +00:00
|
|
|
|
2019-04-02 23:27:45 +00:00
|
|
|
+ internal_github
|
2019-04-02 23:06:15 +00:00
|
|
|
- tags:
|
2020-05-14 07:41:58 +00:00
|
|
|
- access_token - An obfuscated reference to the configured access token or "Unauthenticated"
|
2019-04-02 23:06:15 +00:00
|
|
|
- fields:
|
2019-04-02 23:27:45 +00:00
|
|
|
- limit - How many requests you are limited to (per hour)
|
|
|
|
- remaining - How many requests you have remaining (per hour)
|
|
|
|
- blocks - How many requests have been blocked due to rate limit
|
2019-04-02 23:06:15 +00:00
|
|
|
|
2019-04-02 23:27:45 +00:00
|
|
|
### Example Output
|
2019-04-02 23:06:15 +00:00
|
|
|
|
|
|
|
```
|
2019-07-23 23:04:51 +00:00
|
|
|
github_repository,language=Go,license=MIT\ License,name=telegraf,owner=influxdata forks=2679i,networks=2679i,open_issues=794i,size=23263i,stars=7091i,subscribers=316i,watchers=7091i 1563901372000000000
|
2019-04-02 23:06:15 +00:00
|
|
|
internal_github,access_token=Unauthenticated rate_limit_remaining=59i,rate_limit_limit=60i,rate_limit_blocks=0i 1552653551000000000
|
|
|
|
```
|
2019-04-02 23:27:45 +00:00
|
|
|
|
|
|
|
[GitHub]: https://www.github.com
|
|
|
|
[internal]: /plugins/inputs/internal
|
|
|
|
[webhook]: /plugins/inputs/webhooks/github
|