activemq

package
v0.0.0-...-5864974 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2019 License: MIT Imports: 11 Imported by: 0

README

Telegraf Input Plugin: ActiveMQ

This plugin gather queues, topics & subscribers metrics using ActiveMQ Console API.

Configuration:
# Description
[[inputs.activemq]]
  ## Required ActiveMQ Endpoint
  # server = "192.168.50.10"

  ## Required ActiveMQ port
  # port = 8161
  
  ## Credentials for basic HTTP authentication
  # username = "admin"
  # password = "admin"

  ## Required ActiveMQ webadmin root path
  # webadmin = "admin"

  ## Maximum time to receive response.
  # response_timeout = "5s"
  
  ## Optional TLS Config
  # tls_ca = "/etc/telegraf/ca.pem"
  # tls_cert = "/etc/telegraf/cert.pem"
  # tls_key = "/etc/telegraf/key.pem"
  ## Use TLS but skip chain & host verification
Measurements & Fields:

Every effort was made to preserve the names based on the XML response from the ActiveMQ Console API.

  • activemq_queues:
    • size
    • consumer_count
    • enqueue_count
    • dequeue_count
    • activemq_topics:
      • size
      • consumer_count
      • enqueue_count
      • dequeue_count
    • subscribers_metrics:
      • pending_queue_size
      • dispatched_queue_size
      • dispatched_counter
      • enqueue_counter
      • dequeue_counter
Tags:
  • activemq_queues:
    • name
    • source
    • port
  • activemq_topics:
    • name
    • source
    • port
  • activemq_subscribers:
    • client_id
    • subscription_name
    • connection_id
    • destination_name
    • selector
    • active
    • source
    • port
Example Output:
$ ./telegraf -config telegraf.conf -input-filter activemq -test
activemq_queues,name=sandra,host=88284b2fe51b,source=localhost,port=8161 consumer_count=0i,enqueue_count=0i,dequeue_count=0i,size=0i 1492610703000000000
activemq_queues,name=Test,host=88284b2fe51b,source=localhost,port=8161 dequeue_count=0i,size=0i,consumer_count=0i,enqueue_count=0i 1492610703000000000
activemq_topics,name=ActiveMQ.Advisory.MasterBroker\ ,host=88284b2fe51b,source=localhost,port=8161 size=0i,consumer_count=0i,enqueue_count=1i,dequeue_count=0i 1492610703000000000
activemq_topics,host=88284b2fe51b,name=AAA\,source=localhost,port=8161  size=0i,consumer_count=1i,enqueue_count=0i,dequeue_count=0i 1492610703000000000
activemq_topics,name=ActiveMQ.Advisory.Topic\,source=localhost,port=8161 ,host=88284b2fe51b enqueue_count=1i,dequeue_count=0i,size=0i,consumer_count=0i 1492610703000000000
activemq_topics,name=ActiveMQ.Advisory.Queue\,source=localhost,port=8161 ,host=88284b2fe51b size=0i,consumer_count=0i,enqueue_count=2i,dequeue_count=0i 1492610703000000000
activemq_topics,name=AAAA\ ,host=88284b2fe51b,source=localhost,port=8161 consumer_count=0i,enqueue_count=0i,dequeue_count=0i,size=0i 1492610703000000000
activemq_subscribers,connection_id=NOTSET,destination_name=AAA,,source=localhost,port=8161,selector=AA,active=no,host=88284b2fe51b,client_id=AAA,subscription_name=AAA pending_queue_size=0i,dispatched_queue_size=0i,dispatched_counter=0i,enqueue_counter=0i,dequeue_counter=0i 1492610703000000000

Documentation

Index

Constants

View Source
const (
	QUEUES_STATS      = "queues"
	TOPICS_STATS      = "topics"
	SUBSCRIBERS_STATS = "subscribers"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ActiveMQ

type ActiveMQ struct {
	Server          string `json:"server"`
	Port            int    `json:"port"`
	Username        string `json:"username"`
	Password        string `json:"password"`
	Webadmin        string `json:"webadmin"`
	ResponseTimeout internal.Duration
	tls.ClientConfig
	// contains filtered or unexported fields
}

func (*ActiveMQ) Description

func (a *ActiveMQ) Description() string

func (*ActiveMQ) Gather

func (a *ActiveMQ) Gather(acc telegraf.Accumulator) error

func (*ActiveMQ) GatherQueuesMetrics

func (a *ActiveMQ) GatherQueuesMetrics(acc telegraf.Accumulator, queues Queues)

func (*ActiveMQ) GatherSubscribersMetrics

func (a *ActiveMQ) GatherSubscribersMetrics(acc telegraf.Accumulator, subscribers Subscribers)

func (*ActiveMQ) GatherTopicsMetrics

func (a *ActiveMQ) GatherTopicsMetrics(acc telegraf.Accumulator, topics Topics)

func (*ActiveMQ) GetMetrics

func (a *ActiveMQ) GetMetrics(keyword string) ([]byte, error)

func (*ActiveMQ) SampleConfig

func (a *ActiveMQ) SampleConfig() string

type Queue

type Queue struct {
	XMLName xml.Name `xml:"queue"`
	Name    string   `xml:"name,attr"`
	Stats   Stats    `xml:"stats"`
}

type Queues

type Queues struct {
	XMLName    xml.Name `xml:"queues"`
	QueueItems []Queue  `xml:"queue"`
}

type Stats

type Stats struct {
	XMLName             xml.Name `xml:"stats"`
	Size                int      `xml:"size,attr"`
	ConsumerCount       int      `xml:"consumerCount,attr"`
	EnqueueCount        int      `xml:"enqueueCount,attr"`
	DequeueCount        int      `xml:"dequeueCount,attr"`
	PendingQueueSize    int      `xml:"pendingQueueSize,attr"`
	DispatchedQueueSize int      `xml:"dispatchedQueueSize,attr"`
	DispatchedCounter   int      `xml:"dispatchedCounter,attr"`
	EnqueueCounter      int      `xml:"enqueueCounter,attr"`
	DequeueCounter      int      `xml:"dequeueCounter,attr"`
}

type Subscriber

type Subscriber struct {
	XMLName          xml.Name `xml:"subscriber"`
	ClientId         string   `xml:"clientId,attr"`
	SubscriptionName string   `xml:"subscriptionName,attr"`
	ConnectionId     string   `xml:"connectionId,attr"`
	DestinationName  string   `xml:"destinationName,attr"`
	Selector         string   `xml:"selector,attr"`
	Active           string   `xml:"active,attr"`
	Stats            Stats    `xml:"stats"`
}

type Subscribers

type Subscribers struct {
	XMLName         xml.Name     `xml:"subscribers"`
	SubscriberItems []Subscriber `xml:"subscriber"`
}

type Topic

type Topic struct {
	XMLName xml.Name `xml:"topic"`
	Name    string   `xml:"name,attr"`
	Stats   Stats    `xml:"stats"`
}

type Topics

type Topics struct {
	XMLName    xml.Name `xml:"topics"`
	TopicItems []Topic  `xml:"topic"`
}

Jump to

Keyboard shortcuts

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