github_exporter

package
v1.16.1 Latest Latest
Warning

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

Go to latest
Published: May 5, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = Config{
	APIURL:          "https://api.github.com",
	GitHubRateLimit: 15000,
}

DefaultConfig holds the default settings for the github_exporter integration

Functions

func New

func New(logger log.Logger, c *Config) (integrations.Integration, error)

New creates a new github_exporter integration.

Types

type Config

type Config struct {
	// URL for the GitHub API
	APIURL string `yaml:"api_url,omitempty"`

	// A list of GitHub repositories for which to collect metrics.
	Repositories []string `yaml:"repositories,omitempty"`

	// A list of GitHub organizations for which to collect metrics.
	Organizations []string `yaml:"organizations,omitempty"`

	// A list of GitHub users for which to collect metrics.
	Users []string `yaml:"users,omitempty"`

	// A GitHub authentication token that allows the API to be queried more often.
	APIToken config_util.Secret `yaml:"api_token,omitempty"`

	// A path to a file containing a GitHub authentication token that allows the API to be queried more often. If supplied, this supersedes `api_token`
	APITokenFile string `yaml:"api_token_file,omitempty"`

	// The path to the GitHub App private key.
	GitHubAppKeyPath string `yaml:"github_app_key_path,omitempty"`

	// The App ID of the GitHub App.
	GitHubAppID int64 `yaml:"github_app_id,omitempty"`

	// The Installation ID of the GitHub App.
	GitHubAppInstallationID int64 `yaml:"github_app_installation_id,omitempty"`

	// The rate limit threshold for GitHub App authentication. Default is 15,000.
	GitHubRateLimit float64 `yaml:"github_rate_limit,omitempty"`
}

Config controls github_exporter

func (*Config) InstanceKey

func (c *Config) InstanceKey(_ string) (string, error)

InstanceKey returns the hostname:port of the GitHub API server.

func (*Config) Name

func (c *Config) Name() string

Name returns the name of the integration that this config represents.

func (*Config) NewIntegration

func (c *Config) NewIntegration(logger log.Logger) (integrations.Integration, error)

NewIntegration creates a new github_exporter

func (*Config) UnmarshalYAML

func (c *Config) UnmarshalYAML(unmarshal func(any) error) error

UnmarshalYAML implements yaml.Unmarshaler for Config

Jump to

Keyboard shortcuts

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