github

package
v1.10.4-cortex Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 22, 2019 License: MIT Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

GitHub Input Plugin

Gather repository information from GitHub hosted repositories.

Note: Telegraf also contains the webhook input which can be used as an alternative method for collecting repository information.

Configuration
[[inputs.github]]
  ## List of repositories to monitor
  repositories = ["influxdata/telegraf"]

  ## Github API access token.  Unauthenticated requests are limited to 60 per hour.
  # access_token = ""

  ## Timeout for HTTP requests.
  # http_timeout = "5s"
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
    • fields:
      • stars (int)
      • forks (int)
      • open_issues (int)
      • size (int)

When the internal input is enabled:

  • internal_github
    • tags:
      • 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
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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GitHub

type GitHub struct {
	Repositories []string          `toml:"repositories"`
	AccessToken  string            `toml:"access_token"`
	HTTPTimeout  internal.Duration `toml:"http_timeout"`

	RateLimit       selfstat.Stat
	RateLimitErrors selfstat.Stat
	RateRemaining   selfstat.Stat
	// contains filtered or unexported fields
}

GitHub - plugin main structure

func (*GitHub) Description

func (g *GitHub) Description() string

Description returns the plugin description.

func (*GitHub) Gather

func (g *GitHub) Gather(acc telegraf.Accumulator) error

Gather GitHub Metrics

func (*GitHub) SampleConfig

func (g *GitHub) SampleConfig() string

SampleConfig returns sample configuration for this plugin.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL