Documentation ¶
Overview ¶
Package elasticsearch is a Metricbeat module that contains MetricSets.
Index ¶
- Constants
- Variables
- func AssetElasticsearch() string
- func GetClusterID(http *helper.HTTP, uri string, nodeID string) (string, error)
- func GetClusterSettings(http *helper.HTTP, resetURI string, includeDefaults bool, filterPaths []string) (common.MapStr, error)
- func GetClusterSettingsWithDefaults(http *helper.HTTP, resetURI string, filterPaths []string) (common.MapStr, error)
- func GetClusterState(http *helper.HTTP, resetURI string, metrics []string) (common.MapStr, error)
- func GetStackUsage(http *helper.HTTP, resetURI string) (common.MapStr, error)
- func IsMLockAllEnabled(http *helper.HTTP, resetURI, nodeID string) (bool, error)
- func IsMaster(http *helper.HTTP, uri string) (bool, error)
- func MergeClusterSettings(clusterSettings common.MapStr) (common.MapStr, error)
- func NewModule(base mb.BaseModule) (mb.Module, error)
- func PassThruField(fieldPath string, sourceData, targetData common.MapStr) error
- func TestMapper(t *testing.T, glob string, mapper func(mb.ReporterV2, []byte) error)
- func TestMapperWithInfo(t *testing.T, glob string, mapper func(mb.ReporterV2, Info, []byte) error)
- type Info
- type License
- type MetricSet
- type NodeInfo
Constants ¶
const ModuleName = "elasticsearch"
ModuleName is the name of this module.
Variables ¶
var CCRStatsAPIAvailableVersion = common.MustNewVersion("6.5.0")
CCRStatsAPIAvailableVersion is the version of Elasticsearch since when the CCR stats API is available.
var EnrichStatsAPIAvailableVersion = common.MustNewVersion("7.5.0")
EnrichStatsAPIAvailableVersion is the version of Elasticsearch since when the Enrich stats API is available.
var ( // HostParser parses host urls for RabbitMQ management plugin HostParser = parse.URLHostParserBuilder{ DefaultScheme: defaultScheme, PathConfigKey: pathConfigKey, }.Build() )
Functions ¶
func AssetElasticsearch ¶
func AssetElasticsearch() string
AssetElasticsearch returns asset data. This is the base64 encoded gzipped contents of ../metricbeat/module/elasticsearch.
func GetClusterID ¶
GetClusterID fetches cluster id for given nodeID.
func GetClusterSettings ¶
func GetClusterSettings(http *helper.HTTP, resetURI string, includeDefaults bool, filterPaths []string) (common.MapStr, error)
GetClusterSettings returns cluster settings
func GetClusterSettingsWithDefaults ¶
func GetClusterSettingsWithDefaults(http *helper.HTTP, resetURI string, filterPaths []string) (common.MapStr, error)
GetClusterSettingsWithDefaults returns cluster settings.
func GetClusterState ¶
GetClusterState returns cluster state information.
func GetStackUsage ¶
GetStackUsage returns stack usage information.
func IsMLockAllEnabled ¶
IsMLockAllEnabled returns if the given Elasticsearch node has mlockall enabled
func IsMaster ¶
IsMaster checks if the given node host is a master node.
The detection of the master is done in two steps: * Fetch node name from /_nodes/_local/name * Fetch current master name from cluster state /_cluster/state/master_node
The two names are compared
func MergeClusterSettings ¶
MergeClusterSettings merges cluster settings in the correct precedence order
func NewModule ¶
func NewModule(base mb.BaseModule) (mb.Module, error)
NewModule creates a new module after performing validation.
func PassThruField ¶
PassThruField copies the field at the given path from the given source data object into the same path in the given target data object.
func TestMapper ¶
TestMapper tests mapping methods
func TestMapperWithInfo ¶
TestMapperWithInfo tests mapping methods with Info fields
Types ¶
type Info ¶
type Info struct { ClusterName string `json:"cluster_name"` ClusterID string `json:"cluster_uuid"` Version struct { Number *common.Version `json:"number"` } `json:"version"` }
Info construct contains the data from the Elasticsearch / endpoint
type License ¶
type License struct { Status string `json:"status"` ID string `json:"uid"` Type string `json:"type"` IssueDate *time.Time `json:"issue_date"` IssueDateInMillis int `json:"issue_date_in_millis"` ExpiryDate *time.Time `json:"expiry_date,omitempty"` ExpiryDateInMillis int `json:"expiry_date_in_millis,omitempty"` MaxNodes int `json:"max_nodes"` IssuedTo string `json:"issued_to"` Issuer string `json:"issuer"` StartDateInMillis int `json:"start_date_in_millis"` }
License contains data about the Elasticsearch license
func GetLicense ¶
GetLicense returns license information. Since we don't expect license information to change frequently, the information is cached for 1 minute to avoid hitting Elasticsearch frequently.
type MetricSet ¶
type MetricSet struct { mb.BaseMetricSet *helper.HTTP XPack bool // contains filtered or unexported fields }
MetricSet can be used to build other metric sets that query RabbitMQ management plugin
func NewMetricSet ¶
func NewMetricSet(base mb.BaseMetricSet, servicePath string) (*MetricSet, error)
NewMetricSet creates an metric set that can be used to build other metric sets that query RabbitMQ management plugin
func (*MetricSet) GetServiceURI ¶
GetServiceURI returns the URI of the Elasticsearch service being monitored by this metricset
func (*MetricSet) SetServiceURI ¶
SetServiceURI updates the URI of the Elasticsearch service being monitored by this metricset