Update docs and changelog for github input

This commit is contained in:
Daniel Nelson 2019-04-02 16:27:45 -07:00
parent 0a68c8468b
commit 1bcbc3eea7
No known key found for this signature in database
GPG Key ID: CAAD59C9444F6155
5 changed files with 41 additions and 27 deletions

View File

@ -1,5 +1,9 @@
## v1.11 [unreleased]
#### New Inputs
- [github](/plugins/inputs/github/README.md) - Contributed by @influxdata
#### Features
- [#5556](https://github.com/influxdata/telegraf/pull/5556): Add TTL field to ping input.

View File

@ -168,6 +168,7 @@ For documentation on the latest development code see the [documentation index][d
* [filestat](./plugins/inputs/filestat)
* [filecount](./plugins/inputs/filecount)
* [fluentd](./plugins/inputs/fluentd)
* [github](./plugins/inputs/github)
* [graylog](./plugins/inputs/graylog)
* [haproxy](./plugins/inputs/haproxy)
* [hddtemp](./plugins/inputs/hddtemp)

View File

@ -43,6 +43,8 @@ following works:
- github.com/golang/protobuf [BSD 3-Clause "New" or "Revised" License](https://github.com/golang/protobuf/blob/master/LICENSE)
- github.com/golang/snappy [BSD 3-Clause "New" or "Revised" License](https://github.com/golang/snappy/blob/master/LICENSE)
- github.com/google/go-cmp [BSD 3-Clause "New" or "Revised" License](https://github.com/google/go-cmp/blob/master/LICENSE)
- github.com/google/go-github [BSD 3-Clause "New" or "Revised" License](https://github.com/google/go-github/blob/master/LICENSE)
- github.com/google/go-querystring [BSD 3-Clause "New" or "Revised" License](https://github.com/google/go-querystring/blob/master/LICENSE)
- github.com/google/uuid [BSD 3-Clause "New" or "Revised" License](https://github.com/google/uuid/blob/master/LICENSE)
- github.com/googleapis/gax-go [BSD 3-Clause "New" or "Revised" License](https://github.com/googleapis/gax-go/blob/master/LICENSE)
- github.com/gorilla/context [BSD 3-Clause "New" or "Revised" License](https://github.com/gorilla/context/blob/master/LICENSE)

View File

@ -1,47 +1,55 @@
# GitHub Input Plugin
The [GitHub](https://www.github.com) input plugin gathers statistics from GitHub repositories.
Gather repository information from [GitHub][] hosted repositories.
### Configuration:
**Note:** Telegraf also contains the [webhook][] input which can be used as an
alternative method for collecting repository information.
### Configuration
```toml
[[inputs.github]]
## List of repositories to monitor
## ex: repositories = ["influxdata/telegraf"]
# repositories = []
repositories = ["influxdata/telegraf"]
## Optional: Unauthenticated requests are limited to 60 per hour.
## Github API access token. Unauthenticated requests are limited to 60 per hour.
# access_token = ""
## Optional: Default 5s.
## Timeout for HTTP requests.
# http_timeout = "5s"
```
### Metrics:
### Metrics
- github_repository
- tags:
- `name` - The repository name
- `owner` - The owner of the repository
- `language` - The primary language of the repository
- `license` - The license set for the repository
- name - The repository name
- owner - The owner of the repository
- language - The primary language of the repository
- license - The license set for the repository
- fields:
- `stars` (int)
- `forks` (int)
- `open_issues` (int)
- `size` (int)
- stars (int)
- forks (int)
- open_issues (int)
- size (int)
* github_rate_limit
When the [internal][] input is enabled:
+ internal_github
- tags:
- `access_token` - An obfusticated reference to the configured access token or "Unauthenticated"
- access_token - An obfusticated reference to the configured access token or "Unauthenticated"
- fields:
- `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
- 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
### Example Output:
### Example Output
```
github,full_name=influxdata/telegraf,name=telegraf,owner=influxdata,language=Go,license=MIT\ License stars=6401i,forks=2421i,open_issues=722i,size=22611i 1552651811000000000
internal_github,access_token=Unauthenticated rate_limit_remaining=59i,rate_limit_limit=60i,rate_limit_blocks=0i 1552653551000000000
```
[GitHub]: https://www.github.com
[internal]: /plugins/inputs/internal
[webhook]: /plugins/inputs/webhooks/github

View File

@ -31,14 +31,13 @@ type GitHub struct {
}
const sampleConfig = `
## List of repositories to monitor
## ex: repositories = ["influxdata/telegraf"]
# repositories = []
## List of repositories to monitor.
repositories = ["influxdata/telegraf"]
## Optional: Unauthenticated requests are limited to 60 per hour.
## Github API access token. Unauthenticated requests are limited to 60 per hour.
# access_token = ""
## Optional: Default 5s.
## Timeout for HTTP requests.
# http_timeout = "5s"
`
@ -49,7 +48,7 @@ func (g *GitHub) SampleConfig() string {
// Description returns the plugin description.
func (g *GitHub) Description() string {
return "Read repository information from GitHub, including forks, stars, and more."
return "Gather repository information from GitHub hosted repositories."
}
// Create GitHub Client