args

package
v2.9.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package args contains a structs for a passed in argument list. Also, the KafkaArguments struct which is a specially parsed version of the args to be used within the integration.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArgumentList

type ArgumentList struct {
	sdkArgs.DefaultArgumentList
	ClusterName string `default:"" help:"A user-defined name to uniquely identify the cluster"`

	AutodiscoverStrategy string `default:"zookeeper" help:"How to discover broker nodes to collect metrics from. One of 'zookeeper' (default) or 'bootstrap'"`

	// Zookeeper autodiscovery. Only required if using zookeeper to autodiscover brokers
	ZookeeperHosts      string `default:"[]" help:"JSON array of ZooKeeper hosts with the following fields: host, port. Port defaults to 2181"`
	ZookeeperAuthScheme string `default:"" help:"ACL scheme for authenticating ZooKeeper connection."`
	ZookeeperAuthSecret string `default:"" help:"Authentication string for ZooKeeper."`
	ZookeeperPath       string `default:"" help:"The Zookeeper path which contains the Kafka configuration. A leading slash is required."`
	PreferredListener   string `default:"" help:"Override which broker listener to attempt to connect to. Defaults to the first that works"`

	// Bootstrap discovery
	BootstrapBroker string `` /* 131-byte string literal not displayed */

	// Producer and consumer connection info. No autodiscovery is supported for producers and consumers
	Producers string `` /* 220-byte string literal not displayed */
	Consumers string `` /* 220-byte string literal not displayed */

	// JMX defaults
	DefaultJMXPort     int    `default:"9999" help:"Default port for JMX collection."`
	DefaultJMXHost     string `default:"localhost" help:"Default host for JMX collection."`
	DefaultJMXUser     string `default:"admin" help:"Default JMX username. Useful if all JMX hosts use the same JMX username and password."`
	DefaultJMXPassword string `default:"admin" help:"Default JMX password. Useful if all JMX hosts use the same JMX username and password."`

	// JMX SSL options
	KeyStore           string `default:"" help:"The location for the keystore containing JMX Client's SSL certificate"`
	KeyStorePassword   string `default:"" help:"Password for the SSL Key Store"`
	TrustStore         string `default:"" help:"The location for the keystore containing JMX Server's SSL certificate"`
	TrustStorePassword string `default:"" help:"Password for the SSL Trust Store"`

	NrJmx string `default:"/usr/bin/nrjmx" help:"Path to the nrjmx executable"`

	// Collection configuration
	LocalOnlyCollection    bool   `` /* 132-byte string literal not displayed */
	CollectBrokerTopicData bool   `` /* 213-byte string literal not displayed */
	TopicMode              string `` /* 147-byte string literal not displayed */
	TopicList              string `default:"[]" help:"JSON array of strings with the names of topics to monitor. Only used if collect_topics is set to 'List'"`
	TopicRegex             string `default:"" help:"A regex pattern that matches the list of topics to collect. Only used if collect_topics is set to 'Regex'"`
	TopicBucket            string `` /* 279-byte string literal not displayed */
	CollectTopicSize       bool   `` /* 160-byte string literal not displayed */

	// Consumer offset arguments
	ConsumerOffset     bool   `default:"false" help:"Populate consumer offset data"`
	ConsumerGroups     string `` /* 164-byte string literal not displayed */
	ConsumerGroupRegex string `default:"" help:"A regex pattern matching the consumer groups to collect"`

	Timeout int `default:"10000" help:"Timeout in milliseconds per single JMX query."`
}

ArgumentList is the raw arguments passed into the integration via yaml or CLI args

type BrokerHost

type BrokerHost struct {
	Host          string
	KafkaPort     int    `json:"kafka_port"`
	KafkaProtocol string `json:"kafka_protocol"`
	JMXPort       int    `json:"jmx_port"`
	JMXUser       string `json:"jmx_user"`
	JMXPassword   string `json:"jmx_password"`
}

BrokerHost is a storage struct for manual Broker connection information

type ConsumerGroups

type ConsumerGroups map[string]map[string][]int32

ConsumerGroups is the structure to represent the whitelist for consumer_groups argument

type JMXHost

type JMXHost struct {
	Name     string
	Host     string
	Port     int
	User     string
	Password string
}

JMXHost is a storage struct for producer and consumer connection information

type ParsedArguments

type ParsedArguments struct {
	sdkArgs.DefaultArgumentList

	ClusterName string

	AutodiscoverStrategy string

	// Zookeeper autodiscovery. Only required if using zookeeper to autodiscover brokers
	ZookeeperHosts      []*ZookeeperHost
	ZookeeperAuthScheme string
	ZookeeperAuthSecret string
	ZookeeperPath       string
	PreferredListener   string

	// Bootstrap discovery. Only required if
	BootstrapBroker BrokerHost

	// Producer and consumer connection info. No autodiscovery is supported for producers and consumers
	Producers []*JMXHost
	Consumers []*JMXHost

	// JMX defaults
	DefaultJMXPort     int
	DefaultJMXHost     string
	DefaultJMXUser     string
	DefaultJMXPassword string

	// JMX SSL options
	KeyStore           string
	KeyStorePassword   string
	TrustStore         string
	TrustStorePassword string

	NrJmx string

	// Collection configuration
	LocalOnlyCollection   bool
	CollectClusterMetrics bool
	TopicMode             string
	TopicList             []string
	TopicRegex            string
	TopicBucket           TopicBucket
	CollectTopicSize      bool

	// Consumer offset arguments
	ConsumerOffset     bool
	ConsumerGroups     ConsumerGroups
	ConsumerGroupRegex *regexp.Regexp

	Timeout int `default:"10000" help:"Timeout in milliseconds per single JMX query."`
}

ParsedArguments is an special version of the config arguments that has advanced parsing to allow arguments to be consumed easier.

var GlobalArgs *ParsedArguments

GlobalArgs represents the global arguments that were passed in

func ParseArgs

func ParseArgs(a ArgumentList) (*ParsedArguments, error)

ParseArgs validates the arguments in argumentList and parses them into more easily used structs

type TopicBucket

type TopicBucket struct {
	BucketNumber int
	NumBuckets   int
}

TopicBucket is a struct that stores the information for bucketing topic collection

type ZookeeperHost

type ZookeeperHost struct {
	Host string `json:"host"`
	Port int    `json:"port"`
}

ZookeeperHost is a storage struct for ZooKeeper connection information

Jump to

Keyboard shortcuts

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