command

package
v1.12.1-RC1 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2020 License: Apache-2.0 Imports: 17 Imported by: 1

Documentation

Overview

Package command starts an http server and displays the collected metrics at "/metrics" endpoint. It collects metrics from collector.go You have to instantiate NewExporter by calling collector.NewExporter method and pass the Jiva volume controller IP.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddCASTypeFlag

func AddCASTypeFlag(cmd *cobra.Command, value *string)

AddCASTypeFlag is used to create flag to pass the storage engine name

func AddControllerAddressFlag

func AddControllerAddressFlag(cmd *cobra.Command, value *string)

AddControllerAddressFlag is used to create flag to pass the Jiva volume controllers IP.

func AddListenAddressFlag

func AddListenAddressFlag(cmd *cobra.Command, value *string)

AddListenAddressFlag is used to create flag to pass the listen address of exporter.

func AddMetricsPathFlag

func AddMetricsPathFlag(cmd *cobra.Command, value *string)

AddMetricsPathFlag is used to create flag to pass the listen path where volume metrics are exposed.

func NewCmdVolumeExporter

func NewCmdVolumeExporter() (*cobra.Command, error)

NewCmdVolumeExporter is used to create command monitoring and it initialize monitoring flags also.

func Run

func Run(cmd *cobra.Command, options *VolumeExporterOptions) error

Run used to process commands,args and call openebs exporter and it returns nil on successful execution.

Types

type VolumeExporterOptions

type VolumeExporterOptions struct {
	ListenAddress     string
	MetricsPath       string
	ControllerAddress string
	CASType           string
}

VolumeExporterOptions is used to create flags for the monitoring command

func (*VolumeExporterOptions) RegisterCstor

func (o *VolumeExporterOptions) RegisterCstor()

RegisterCstor initiates the connection with the cstor and register the exporter with Prometheus for collecting the metrics.This doesn't returns error because that case is handled in InitiateConnection().

func (*VolumeExporterOptions) RegisterJiva

func (o *VolumeExporterOptions) RegisterJiva() error

RegisterJiva parses the jiva controller URL and initialises an instance of Jiva.This returns err if the URL is not correct.

func (*VolumeExporterOptions) RegisterPool

func (o *VolumeExporterOptions) RegisterPool()

RegisterPool registers pool collector which collects pool level metrics

func (*VolumeExporterOptions) StartMayaExporter

func (options *VolumeExporterOptions) StartMayaExporter() error

StartMayaExporter starts an HTTP server that exposes the metrics on <clusterIP>:9500/metrics endpoint and for getting the metrics in json the "type=json" action can be used. e.g <clusterIP>:9500/metrics/?type=json

Jump to

Keyboard shortcuts

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