Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
DefaultConfig = Config{
IntegrationRestartBackoff: 5 * time.Second,
UseHostnameLabel: true,
}
)
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// When true, adds an agent_hostname label to all samples from integrations.
UseHostnameLabel bool `yaml:"use_hostname_label"`
Agent agent.Config `yaml:"agent"`
NodeExporter node_exporter.Config `yaml:"node_exporter"`
// Extra labels to add for all integration samples
Labels model.LabelSet `yaml:"labels"`
// Prometheus RW configs to use for all integrations.
PrometheusRemoteWrite []*config.RemoteWriteConfig `yaml:"prometheus_remote_write,omitempty"`
IntegrationRestartBackoff time.Duration `yaml:"integration_restart_backoff,omitempty"`
// ListenPort tells the integration Manager which port the Agent is
// listening on for generating Prometheus instance configs.
ListenPort *int `yaml:"-"`
}
Config holds the configuration for all integrations.
func (*Config) UnmarshalYAML ¶
func (c *Config) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML implements yaml.Unmarshaler for Config.
type Integration ¶
type Integration interface {
// Name returns the name of the integration. Each registered integration must
// have a unique name.
Name() string
// CommonConfig returns the set of common configuration values present across
// all integrations.
CommonConfig() integrationCfg.Common
// RegisterRoutes should register any HTTP handlers used for the integration.
//
// The router provided to RegisterRoutes is a subrouter for the path
// /integrations/<integration name>. All routes should register to the
// relative root path and will be automatically combined to the subroute. For
// example, if a metric "database" registers a /metrics endpoint, it will
// be exposed as /integrations/database/metrics.
RegisterRoutes(r *mux.Router) error
// ScrapeConfigs should return a set of integration scrape configs that inform
// the integration how samples should be collected.
ScrapeConfigs() []integrationCfg.ScrapeConfig
// Run should start the integration and do any required tasks. Run should *not*
// exit until context is canceled. If an integration doesn't need to do anything,
// it should simply wait for ctx to be canceled.
Run(ctx context.Context) error
}
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager manages a set of integrations and runs them.
func NewManager ¶
func NewManager(c Config, logger log.Logger, im instance.Manager) (*Manager, error)
NewManager creates a new integrations manager. NewManager must be given an InstanceManager which is responsible for accepting instance configs to scrape and send metrics from running integrations.
Directories
¶
Path | Synopsis |
---|---|
Package agent is an "example" integration that has very little functionality, but is still useful in practice.
|
Package agent is an "example" integration that has very little functionality, but is still useful in practice. |
Package config provides common configuration structs shared among implementations of integrations.Integration.
|
Package config provides common configuration structs shared among implementations of integrations.Integration. |
Click to show internal directories.
Click to hide internal directories.