package
7.17.28
Repository: https://github.com/elastic/beats.git
Documentation: pkg.go.dev

# Packages

Package module contains the low-level utilities for running Metricbeat modules and metricsets.
Package testing provides utility functions for testing Module and MetricSet implementations.

# Functions

AddMetricSetInfo is an EventModifier that adds information about the MetricSet that generated the event.
DefaultMetricSet specifies that the MetricSetFactory will be the default when no MetricSet names are specified in the configuration.
DefaultModuleConfig returns a ModuleConfig with the default values populated.
MustReplace specifies that the MetricSetFactory must be replacing an existing metricset with the same name.
NewLightModulesSource creates a new LightModulesSource.
NewModule builds a new Module and its associated MetricSets based on the provided configuration data.
NewRegister creates and returns a new Register.
TransformMapStrToEvent transforms a common.MapStr produced by MetricSet (like any MetricSet that does not natively produce a mb.Event).
WithHostParser specifies the HostParser that should be used with the MetricSet.
WithNamespace specifies the fully qualified namespace under which MetricSet data will be added.

# Constants

ModuleDataKey is the key used in events created by MetricSets to add data to an event that is common to the module.
NamespaceKey is used to define a different namespace for the metricset This is useful for dynamic metricsets or metricsets which do not put the name under the same name as the package.
RTTKey is used by a MetricSet to specify the round trip time (RTT), or total amount of time, taken to collect the information in the event.
TimestampKey is the key used in events created by MetricSets to add their own timestamp to an event.

# Variables

DefaultModuleFactory returns the given BaseModule and never returns an error.
ErrAllModulesDisabled indicates that all modules are disabled.
ErrEmptyConfig indicates that modules configuration list is nil or empty.
ErrModuleDisabled indicates a disabled module has been tried to instantiate.
Registry is the singleton Register instance where all ModuleFactory's and MetricSetFactory's should be registered.

# Structs

BaseMetricSet implements the MetricSet interface.
BaseModule implements the Module interface.
Event contains the data generated by a MetricSet.
HostData contains values parsed from the 'host' configuration.
LightMetricSet contains the definition of a non-registered metric set.
LightModule contains the definition of a light module.
LightModulesSource loads module definitions from files in the provided paths.
MetricSetRegistration contains the parameters that were used to register a MetricSet.
ModuleConfig is the base configuration data for all Modules.
Register contains the factory functions for creating new Modules and new MetricSets.

# Interfaces

Closer is an optional interface that a MetricSet can implement in order to cleanup any resources it has open at shutdown.
EventFetcher is a MetricSet that returns a single event when collecting data.
EventsFetcher is a MetricSet that returns a multiple events when collecting data.
MetricSet is the common interface for all MetricSet implementations.
Module is the common interface for all Module implementations.
ModulesSource contains a source of non-registered modules.
PushMetricSet is a MetricSet that pushes events (rather than pulling them periodically via a Fetch callback).
PushMetricSetV2 is a MetricSet that pushes events (rather than pulling them periodically via a Fetch callback).
PushMetricSetV2WithContext is a MetricSet that pushes events (rather than pulling them periodically via a Fetch callback).
PushReporter is used by a MetricSet to report events, errors, or errors with metadata.
PushReporterV2 is used by a MetricSet to report events, errors, or errors with metadata.
Reporter is used by a MetricSet to report events, errors, or errors with metadata.
ReporterV2 is used by a MetricSet to report Events.
ReportingMetricSet is a MetricSet that reports events or errors through the Reporter interface.
ReportingMetricSetV2 is a MetricSet that reports events or errors through the ReporterV2 interface.
ReportingMetricSetV2Error is a MetricSet that reports events or errors through the ReporterV2 interface.
ReportingMetricSetV2WithContext is a MetricSet that reports events or errors through the ReporterV2 interface.

# Type aliases

EventModifier is a function that can modifies an Event.
HostParser is a function that parses a host value from the configuration and returns a HostData object.
MetricSetFactory accepts a BaseMetricSet and returns a MetricSet.
MetricSetOption sets an option for a MetricSetFactory that is being registered.
ModuleFactory accepts a BaseModule and returns a Module.
QueryParams is a convenient map[string]interface{} wrapper to implement the String interface which returns the values in common query params format (key=value&key2=value2) which is the way that the url package expects this params (without the initial '?').