agent

package
v1.3.191 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package agent is an "example" integration that has very little functionality, but is still useful in practice. The Agent integration re-exposes the Agent's own metrics endpoint and allows the Agent to scrape itself.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct{}

Config controls the Agent integration.

func (*Config) InstanceKey added in v0.21.0

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

InstanceKey returns the hostname of the machine.

func (*Config) Name added in v0.10.0

func (c *Config) Name() string

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

func (*Config) NewIntegration added in v0.10.0

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

NewIntegration converts this config into an instance of an integration.

type Integration

type Integration struct {
	// contains filtered or unexported fields
}

Integration is the Agent integration. The Agent integration scrapes the Agent's own metrics.

func New

func New(c *Config) *Integration

New creates a new Agent integration.

func (*Integration) MetricsHandler added in v0.14.0

func (i *Integration) MetricsHandler() (http.Handler, error)

MetricsHandler satisfies Integration.RegisterRoutes.

func (*Integration) Run

func (i *Integration) Run(ctx context.Context) error

Run satisfies Integration.Run.

func (*Integration) ScrapeConfigs

func (i *Integration) ScrapeConfigs() []config.ScrapeConfig

ScrapeConfigs satisfies Integration.ScrapeConfigs.

Jump to

Keyboard shortcuts

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