elasticsearch

package
v0.0.0-...-be347a3 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2019 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package elasticsearch is a Metricbeat module that contains MetricSets.

Index

Constants

View Source
const ModuleName = "elasticsearch"

ModuleName is the name of this module.

Variables

View Source
var CCRStatsAPIAvailableVersion = common.MustNewVersion("6.5.0")

CCRStatsAPIAvailableVersion is the version of Elasticsearch since when the CCR stats API is available.

View Source
var EnrichStatsAPIAvailableVersion = common.MustNewVersion("7.5.0")

EnrichStatsAPIAvailableVersion is the version of Elasticsearch since when the Enrich stats API is available.

View Source
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

func GetClusterID(http *helper.HTTP, uri string, nodeID string) (string, error)

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

func GetClusterState(http *helper.HTTP, resetURI string, metrics []string) (common.MapStr, error)

GetClusterState returns cluster state information.

func GetStackUsage

func GetStackUsage(http *helper.HTTP, resetURI string) (common.MapStr, error)

GetStackUsage returns stack usage information.

func IsMLockAllEnabled

func IsMLockAllEnabled(http *helper.HTTP, resetURI, nodeID string) (bool, error)

IsMLockAllEnabled returns if the given Elasticsearch node has mlockall enabled

func IsMaster

func IsMaster(http *helper.HTTP, uri string) (bool, error)

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

func MergeClusterSettings(clusterSettings common.MapStr) (common.MapStr, error)

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

func PassThruField(fieldPath string, sourceData, targetData common.MapStr) error

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

func TestMapper(t *testing.T, glob string, mapper func(mb.ReporterV2, []byte) error)

TestMapper tests mapping methods

func TestMapperWithInfo

func TestMapperWithInfo(t *testing.T, glob string, mapper func(mb.ReporterV2, Info, []byte) error)

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

func GetInfo

func GetInfo(http *helper.HTTP, uri string) (*Info, error)

GetInfo returns the data for 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

func GetLicense(http *helper.HTTP, resetURI string) (*License, error)

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.

func (*License) IsOneOf

func (l *License) IsOneOf(candidateLicenses ...string) bool

IsOneOf returns whether the license is one of the specified candidate licenses

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

func (m *MetricSet) GetServiceURI() string

GetServiceURI returns the URI of the Elasticsearch service being monitored by this metricset

func (*MetricSet) SetServiceURI

func (m *MetricSet) SetServiceURI(servicePath string)

SetServiceURI updates the URI of the Elasticsearch service being monitored by this metricset

type NodeInfo

type NodeInfo struct {
	Host             string `json:"host"`
	TransportAddress string `json:"transport_address"`
	IP               string `json:"ip"`
	Name             string `json:"name"`
	ID               string
}

NodeInfo struct cotains data about the node.

func GetNodeInfo

func GetNodeInfo(http *helper.HTTP, uri string, nodeID string) (*NodeInfo, error)

GetNodeInfo returns the node information.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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