gelf

package
v3.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2024 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SeverityLevels = map[int32]string{
	0: "emergency",
	1: "alert",
	2: "critical",
	3: "error",
	4: "warning",
	5: "notice",
	6: "informational",
	7: "debug",
}

SeverityLevels maps severity levels to severity string levels.

Functions

This section is empty.

Types

type Metrics

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

Metrics holds a set of gelf metrics.

func NewMetrics

func NewMetrics(reg prometheus.Registerer) *Metrics

NewMetrics creates a new set of gelf metrics. If reg is non-nil, the metrics will be registered.

type Target

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

Target listens to gelf messages on udp.

func NewTarget

func NewTarget(
	metrics *Metrics,
	logger log.Logger,
	handler api.EntryHandler,
	relabel []*relabel.Config,
	config *scrapeconfig.GelfTargetConfig,
) (*Target, error)

NewTarget configures a new Gelf Target.

func (*Target) Details

func (t *Target) Details() interface{}

Details returns target-specific details.

func (*Target) DiscoveredLabels

func (t *Target) DiscoveredLabels() model.LabelSet

DiscoveredLabels returns the set of labels discovered by the gelf target, which is always nil. Implements Target.

func (*Target) Labels

func (t *Target) Labels() model.LabelSet

Labels returns the set of labels that statically apply to all log entries produced by the GelfTarget.

func (*Target) Ready

func (t *Target) Ready() bool

Ready indicates whether or not the gelf target is ready to be read from.

func (*Target) Stop

func (t *Target) Stop()

Stop shuts down the GelfTarget.

func (*Target) Type

func (t *Target) Type() target.TargetType

Type returns GelfTargetType.

type TargetManager

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

TargetManager manages a series of Gelf Targets.

func NewTargetManager

func NewTargetManager(
	metrics *Metrics,
	logger log.Logger,
	client api.EntryHandler,
	scrapeConfigs []scrapeconfig.Config,
) (*TargetManager, error)

NewTargetManager creates a new Gelf TargetManager.

func (*TargetManager) ActiveTargets

func (tm *TargetManager) ActiveTargets() map[string][]target.Target

ActiveTargets returns the list of GelfTargets where Gelf data is being read. ActiveTargets is an alias to AllTargets as GelfTargets cannot be deactivated, only stopped.

func (*TargetManager) AllTargets

func (tm *TargetManager) AllTargets() map[string][]target.Target

AllTargets returns the list of all targets where gelf data is currently being read.

func (*TargetManager) Ready

func (tm *TargetManager) Ready() bool

Ready returns true if at least one GelfTarget is also ready.

func (*TargetManager) Stop

func (tm *TargetManager) Stop()

Stop stops the GelfTargetManager and all of its GelfTargets.

Jump to

Keyboard shortcuts

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