collector

package
v0.1.4-0...-2d57b30 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Namespace const string
	Namespace = "logstash"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Collector

type Collector interface {
	Collect(ch chan<- prometheus.Metric) (err error)
}

Collector interface implement Collect function

func NewNodeInfoCollector

func NewNodeInfoCollector(logstashEndpoint string) (Collector, error)

NewNodeInfoCollector function

func NewNodeStatsCollector

func NewNodeStatsCollector(logstashEndpoint string) (Collector, error)

NewNodeStatsCollector function

type HTTPHandler

type HTTPHandler struct {
	Endpoint string
}

HTTPHandler type

func (*HTTPHandler) Get

func (h *HTTPHandler) Get() (http.Response, error)

Get method for HTTPHandler

type HTTPHandlerInterface

type HTTPHandlerInterface interface {
	Get() (http.Response, error)
}

HTTPHandlerInterface interface

type NodeInfoCollector

type NodeInfoCollector struct {
	NodeInfos *prometheus.Desc
	OsInfos   *prometheus.Desc
	JvmInfos  *prometheus.Desc
	// contains filtered or unexported fields
}

NodeInfoCollector type

func (*NodeInfoCollector) Collect

func (c *NodeInfoCollector) Collect(ch chan<- prometheus.Metric) error

Collect function implements nodestats_collector collector

type NodeInfoResponse

type NodeInfoResponse struct {
	Host        string `json:"host"`
	Version     string `json:"version"`
	HTTPAddress string `json:"http_address"`
	ID          string `json:"id"`
	Name        string `json:"name"`
	Pipeline    struct {
		Workers               int  `json:"workers"`
		BatchSize             int  `json:"batch_size"`
		BatchDelay            int  `json:"batch_delay"`
		ConfigReloadAutomatic bool `json:"config_reload_automatic"`
		ConfigReloadInterval  int  `json:"config_reload_interval"`
	} `json:"pipeline"`
	Os struct {
		Name                string `json:"name"`
		Arch                string `json:"arch"`
		Version             string `json:"version"`
		AvailableProcessors int    `json:"available_processors"`
	} `json:"os"`
	Jvm struct {
		Pid               int    `json:"pid"`
		Version           string `json:"version"`
		VMName            string `json:"vm_name"`
		VMVersion         string `json:"vm_version"`
		VMVendor          string `json:"vm_vendor"`
		StartTimeInMillis int64  `json:"start_time_in_millis"`
		Mem               struct {
			HeapInitInBytes    int `json:"heap_init_in_bytes"`
			HeapMaxInBytes     int `json:"heap_max_in_bytes"`
			NonHeapInitInBytes int `json:"non_heap_init_in_bytes"`
			NonHeapMaxInBytes  int `json:"non_heap_max_in_bytes"`
		} `json:"mem"`
		GcCollectors []string `json:"gc_collectors"`
	} `json:"jvm"`
}

NodeInfoResponse type

func NodeInfo

func NodeInfo(endpoint string) (NodeInfoResponse, error)

NodeInfo function

type NodeStatsCollector

type NodeStatsCollector struct {
	Up *prometheus.Desc

	JvmThreadsCount     *prometheus.Desc
	JvmThreadsPeakCount *prometheus.Desc

	MemHeapUsedInBytes         *prometheus.Desc
	MemHeapCommittedInBytes    *prometheus.Desc
	MemHeapMaxInBytes          *prometheus.Desc
	MemNonHeapUsedInBytes      *prometheus.Desc
	MemNonHeapCommittedInBytes *prometheus.Desc

	MemPoolPeakUsedInBytes  *prometheus.Desc
	MemPoolUsedInBytes      *prometheus.Desc
	MemPoolPeakMaxInBytes   *prometheus.Desc
	MemPoolMaxInBytes       *prometheus.Desc
	MemPoolCommittedInBytes *prometheus.Desc

	GCCollectionTimeInMillis *prometheus.Desc
	GCCollectionCount        *prometheus.Desc

	ProcessOpenFileDescriptors    *prometheus.Desc
	ProcessMaxFileDescriptors     *prometheus.Desc
	ProcessMemTotalVirtualInBytes *prometheus.Desc
	ProcessCPUTotalInMillis       *prometheus.Desc

	PipelineDuration          *prometheus.Desc
	PipelineQueuePushDuration *prometheus.Desc
	PipelineEventsIn          *prometheus.Desc
	PipelineEventsFiltered    *prometheus.Desc
	PipelineEventsOut         *prometheus.Desc

	PipelinePluginEventsDuration          *prometheus.Desc
	PipelinePluginEventsQueuePushDuration *prometheus.Desc
	PipelinePluginEventsIn                *prometheus.Desc
	PipelinePluginEventsOut               *prometheus.Desc
	PipelinePluginDocumentsSuccesses      *prometheus.Desc
	PipelinePluginDocumentsFailures       *prometheus.Desc
	PipelinePluginBulkRequestsSuccesses   *prometheus.Desc
	PipelinePluginBulkRequestsWithErrors  *prometheus.Desc
	PipelinePluginBulkRequestsFailures    *prometheus.Desc
	PipelinePluginMatches                 *prometheus.Desc
	PipelinePluginFailures                *prometheus.Desc

	PipelineQueueEvents          *prometheus.Desc
	PipelineQueuePageCapacity    *prometheus.Desc
	PipelineQueueMaxQueueSize    *prometheus.Desc
	PipelineQueueMaxUnreadEvents *prometheus.Desc
	PipelineQueueSizeInBytes     *prometheus.Desc

	PipelineDeadLetterQueueSizeInBytes *prometheus.Desc
	// contains filtered or unexported fields
}

NodeStatsCollector type

func (*NodeStatsCollector) Collect

func (c *NodeStatsCollector) Collect(ch chan<- prometheus.Metric) error

Collect function implements nodestats_collector collector

type NodeStatsResponse

type NodeStatsResponse struct {
	Host        string `json:"host"`
	Version     string `json:"version"`
	HTTPAddress string `json:"http_address"`
	Jvm         struct {
		Threads struct {
			Count     int `json:"count"`
			PeakCount int `json:"peak_count"`
		} `json:"threads"`
		Mem struct {
			HeapUsedInBytes         int `json:"heap_used_in_bytes"`
			HeapUsedPercent         int `json:"heap_used_percent"`
			HeapCommittedInBytes    int `json:"heap_committed_in_bytes"`
			HeapMaxInBytes          int `json:"heap_max_in_bytes"`
			NonHeapUsedInBytes      int `json:"non_heap_used_in_bytes"`
			NonHeapCommittedInBytes int `json:"non_heap_committed_in_bytes"`
			Pools                   struct {
				Survivor struct {
					PeakUsedInBytes  int `json:"peak_used_in_bytes"`
					UsedInBytes      int `json:"used_in_bytes"`
					PeakMaxInBytes   int `json:"peak_max_in_bytes"`
					MaxInBytes       int `json:"max_in_bytes"`
					CommittedInBytes int `json:"committed_in_bytes"`
				} `json:"survivor"`
				Old struct {
					PeakUsedInBytes  int `json:"peak_used_in_bytes"`
					UsedInBytes      int `json:"used_in_bytes"`
					PeakMaxInBytes   int `json:"peak_max_in_bytes"`
					MaxInBytes       int `json:"max_in_bytes"`
					CommittedInBytes int `json:"committed_in_bytes"`
				} `json:"old"`
				Young struct {
					PeakUsedInBytes  int `json:"peak_used_in_bytes"`
					UsedInBytes      int `json:"used_in_bytes"`
					PeakMaxInBytes   int `json:"peak_max_in_bytes"`
					MaxInBytes       int `json:"max_in_bytes"`
					CommittedInBytes int `json:"committed_in_bytes"`
				} `json:"young"`
			} `json:"pools"`
		} `json:"mem"`
		Gc struct {
			Collectors struct {
				Old struct {
					CollectionTimeInMillis int `json:"collection_time_in_millis"`
					CollectionCount        int `json:"collection_count"`
				} `json:"old"`
				Young struct {
					CollectionTimeInMillis int `json:"collection_time_in_millis"`
					CollectionCount        int `json:"collection_count"`
				} `json:"young"`
			} `json:"collectors"`
		} `json:"gc"`
	} `json:"jvm"`
	Process struct {
		OpenFileDescriptors     int `json:"open_file_descriptors"`
		PeakOpenFileDescriptors int `json:"peak_open_file_descriptors"`
		MaxFileDescriptors      int `json:"max_file_descriptors"`
		Mem                     struct {
			TotalVirtualInBytes int64 `json:"total_virtual_in_bytes"`
		} `json:"mem"`
		CPU struct {
			TotalInMillis int64 `json:"total_in_millis"`
			Percent       int   `json:"percent"`
		} `json:"cpu"`
	} `json:"process"`
	Pipeline  Pipeline            `json:"pipeline"`  // Logstash 5
	Pipelines map[string]Pipeline `json:"pipelines"` // Logstash >=6
}

NodeStatsResponse type

func NodeStats

func NodeStats(endpoint string) (NodeStatsResponse, error)

NodeStats function

type Pipeline

type Pipeline struct {
	Events struct {
		DurationInMillis          int `json:"duration_in_millis"`
		In                        int `json:"in"`
		Filtered                  int `json:"filtered"`
		Out                       int `json:"out"`
		QueuePushDurationInMillis int `json:"queue_push_duration_in_millis"`
	} `json:"events"`
	Plugins struct {
		Inputs []struct {
			ID     string `json:"id"`
			Events struct {
				QueuePushDurationInMillis int `json:"queue_push_duration_in_millis"`
				In                        int `json:"in"`
				Out                       int `json:"out"`
			} `json:"events"`
			Name string `json:"name"`
		} `json:"inputs,omitempty"`
		Filters []struct {
			ID     string `json:"id"`
			Events struct {
				DurationInMillis int `json:"duration_in_millis"`
				In               int `json:"in"`
				Out              int `json:"out"`
			} `json:"events,omitempty"`
			Name             string `json:"name"`
			Matches          int    `json:"matches,omitempty"`
			Failures         int    `json:"failures,omitempty"`
			PatternsPerField struct {
				CapturedRequestHeaders int `json:"captured_request_headers"`
			} `json:"patterns_per_field,omitempty"`
			Formats int `json:"formats,omitempty"`
		} `json:"filters"`
		Outputs []struct {
			ID           string `json:"id"`
			BulkRequests *struct {
				Successes  int `json:"successes"`
				WithErrors int `json:"with_errors"`
				Failures   int `json:"failures"`
			} `json:"bulk_requests,omitempty"`
			Documents *struct {
				Successes            int `json:"successes"`
				NonRetryableFailures int `json:"non_retryable_failures"`
			} `json:"documents,omitempty"`
			Events struct {
				DurationInMillis int `json:"duration_in_millis"`
				In               int `json:"in"`
				Out              int `json:"out"`
			} `json:"events"`
			Name string `json:"name"`
		} `json:"outputs"`
	} `json:"plugins"`
	Reloads struct {
		LastError            interface{} `json:"last_error"`
		Successes            int         `json:"successes"`
		LastSuccessTimestamp interface{} `json:"last_success_timestamp"`
		LastFailureTimestamp interface{} `json:"last_failure_timestamp"`
		Failures             int         `json:"failures"`
	} `json:"reloads"`
	Queue struct {
		Events              int    `json:"events_count"`
		Type                string `json:"type"`
		QueueSizeInBytes    int    `json:"queue_size_in_bytes"`
		MaxQueueSizeInBytes int64  `json:"max_queue_size_in_bytes"`
		Data                struct {
			Path             string `json:"path"`
			FreeSpaceInBytes int64  `json:"free_space_in_bytes"`
			StorageType      string `json:"storage_type"`
		} `json:"data"`
	} `json:"queue"`
	DeadLetterQueue struct {
		QueueSizeInBytes int `json:"queue_size_in_bytes"`
	} `json:"dead_letter_queue"`
}

Pipeline type

Jump to

Keyboard shortcuts

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