cassandra

package
v1.29.5 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2024 License: MIT Imports: 10 Imported by: 0

README

Cassandra Input Plugin

Deprecated in version 1.7: Please use the jolokia2 plugin with the cassandra.conf example configuration.

Plugin arguments

  • context string: Context root used for jolokia url
  • servers []string: List of servers with the format <user:passwd@><host>:port"
  • metrics []string: List of Jmx paths that identify mbeans attributes

Description

The Cassandra plugin collects Cassandra 3 / JVM metrics exposed as MBean's attributes through jolokia REST endpoint. All metrics are collected for each server configured.

See: https://jolokia.org/ and Cassandra Documentation

Metrics

Cassandra plugin produces one or more measurements for each metric configured, adding Server's name as host tag. More than one measurement is generated when querying table metrics with a wildcard for the keyspace or table name.

Global configuration options

In addition to the plugin-specific configuration settings, plugins support additional global and plugin configuration settings. These settings are used to modify metrics, tags, and field or create aliases and configure ordering, etc. See the CONFIGURATION.md for more details.

Configuration

# Read Cassandra metrics through Jolokia
[[inputs.cassandra]]
  context = "/jolokia/read"
  ## List of cassandra servers exposing jolokia read service
  servers = ["myuser:mypassword@10.10.10.1:8778","10.10.10.2:8778",":8778"]
  ## List of metrics collected on above servers
  ## Each metric consists of a jmx path.
  ## This will collect all heap memory usage metrics from the jvm and
  ## ReadLatency metrics for all keyspaces and tables.
  ## "type=Table" in the query works with Cassandra3.0. Older versions might
  ## need to use "type=ColumnFamily"
  metrics  = [
    "/java.lang:type=Memory/HeapMemoryUsage",
    "/org.apache.cassandra.metrics:type=Table,keyspace=*,scope=*,name=ReadLatency"
  ]

Example Output

javaMemory,host=myHost,mname=HeapMemoryUsage HeapMemoryUsage_committed=1040187392,HeapMemoryUsage_init=1050673152,HeapMemoryUsage_max=1040187392,HeapMemoryUsage_used=368155000 1459551767230567084

Useful Metrics

Here is a list of metrics that might be useful to monitor your cassandra cluster. This was put together from multiple sources on the web.

measurement = javaGarbageCollector
  • /java.lang:type=GarbageCollector,name=ConcurrentMarkSweep/CollectionTime
  • /java.lang:type=GarbageCollector,name=ConcurrentMarkSweep/CollectionCount
  • /java.lang:type=GarbageCollector,name=ParNew/CollectionTime
  • /java.lang:type=GarbageCollector,name=ParNew/CollectionCount
measurement = javaMemory
  • /java.lang:type=Memory/HeapMemoryUsage
  • /java.lang:type=Memory/NonHeapMemoryUsage
measurement = cassandraCache
  • /org.apache.cassandra.metrics:type=Cache,scope=KeyCache,name=Hits
  • /org.apache.cassandra.metrics:type=Cache,scope=KeyCache,name=Requests
  • /org.apache.cassandra.metrics:type=Cache,scope=KeyCache,name=Entries
  • /org.apache.cassandra.metrics:type=Cache,scope=KeyCache,name=Size
  • /org.apache.cassandra.metrics:type=Cache,scope=KeyCache,name=Capacity
  • /org.apache.cassandra.metrics:type=Cache,scope=RowCache,name=Hits
  • /org.apache.cassandra.metrics:type=Cache,scope=RowCache,name=Requests
  • /org.apache.cassandra.metrics:type=Cache,scope=RowCache,name=Entries
  • /org.apache.cassandra.metrics:type=Cache,scope=RowCache,name=Size
  • /org.apache.cassandra.metrics:type=Cache,scope=RowCache,name=Capacity
measurement = cassandraClient
  • /org.apache.cassandra.metrics:type=Client,name=connectedNativeClients
measurement = cassandraClientRequest
  • /org.apache.cassandra.metrics:type=ClientRequest,scope=Read,name=TotalLatency
  • /org.apache.cassandra.metrics:type=ClientRequest,scope=Write,name=TotalLatency
  • /org.apache.cassandra.metrics:type=ClientRequest,scope=Read,name=Latency
  • /org.apache.cassandra.metrics:type=ClientRequest,scope=Write,name=Latency
  • /org.apache.cassandra.metrics:type=ClientRequest,scope=Read,name=Timeouts
  • /org.apache.cassandra.metrics:type=ClientRequest,scope=Write,name=Timeouts
  • /org.apache.cassandra.metrics:type=ClientRequest,scope=Read,name=Unavailables
  • /org.apache.cassandra.metrics:type=ClientRequest,scope=Write,name=Unavailables
  • /org.apache.cassandra.metrics:type=ClientRequest,scope=Read,name=Failures
  • /org.apache.cassandra.metrics:type=ClientRequest,scope=Write,name=Failures
measurement = cassandraCommitLog
  • /org.apache.cassandra.metrics:type=CommitLog,name=PendingTasks
  • /org.apache.cassandra.metrics:type=CommitLog,name=TotalCommitLogSize
measurement = cassandraCompaction
  • /org.apache.cassandra.metrics:type=Compaction,name=CompletedTasks
  • /org.apache.cassandra.metrics:type=Compaction,name=PendingTasks
  • /org.apache.cassandra.metrics:type=Compaction,name=TotalCompactionsCompleted
  • /org.apache.cassandra.metrics:type=Compaction,name=BytesCompacted
measurement = cassandraStorage
  • /org.apache.cassandra.metrics:type=Storage,name=Load
  • /org.apache.cassandra.metrics:type=Storage,name=Exceptions
measurement = cassandraTable

Using wildcards for "keyspace" and "scope" can create a lot of series as metrics will be reported for every table and keyspace including internal system tables. Specify a keyspace name and/or a table name to limit them.

  • /org.apache.cassandra.metrics:type=Table,keyspace=*,scope=*,name=LiveDiskSpaceUsed
  • /org.apache.cassandra.metrics:type=Table,keyspace=*,scope=*,name=TotalDiskSpaceUsed
  • /org.apache.cassandra.metrics:type=Table,keyspace=*,scope=*,name=ReadLatency
  • /org.apache.cassandra.metrics:type=Table,keyspace=*,scope=*,name=CoordinatorReadLatency
  • /org.apache.cassandra.metrics:type=Table,keyspace=*,scope=*,name=WriteLatency
  • /org.apache.cassandra.metrics:type=Table,keyspace=*,scope=*,name=ReadTotalLatency
  • /org.apache.cassandra.metrics:type=Table,keyspace=*,scope=*,name=WriteTotalLatency
measurement = cassandraThreadPools
  • /org.apache.cassandra.metrics:type=ThreadPools,path=internal,scope=CompactionExecutor,name=ActiveTasks
  • /org.apache.cassandra.metrics:type=ThreadPools,path=internal,scope=AntiEntropyStage,name=ActiveTasks
  • /org.apache.cassandra.metrics:type=ThreadPools,path=request,scope=CounterMutationStage,name=PendingTasks
  • /org.apache.cassandra.metrics:type=ThreadPools,path=request,scope=CounterMutationStage,name=CurrentlyBlockedTasks
  • /org.apache.cassandra.metrics:type=ThreadPools,path=request,scope=MutationStage,name=PendingTasks
  • /org.apache.cassandra.metrics:type=ThreadPools,path=request,scope=MutationStage,name=CurrentlyBlockedTasks
  • /org.apache.cassandra.metrics:type=ThreadPools,path=request,scope=ReadRepairStage,name=PendingTasks
  • /org.apache.cassandra.metrics:type=ThreadPools,path=request,scope=ReadRepairStage,name=CurrentlyBlockedTasks
  • /org.apache.cassandra.metrics:type=ThreadPools,path=request,scope=ReadStage,name=PendingTasks
  • /org.apache.cassandra.metrics:type=ThreadPools,path=request,scope=ReadStage,name=CurrentlyBlockedTasks
  • /org.apache.cassandra.metrics:type=ThreadPools,path=request,scope=RequestResponseStage,name=PendingTasks
  • /org.apache.cassandra.metrics:type=ThreadPools,path=request,scope=RequestResponseStage,name=CurrentlyBlockedTasks

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cassandra

type Cassandra struct {
	Context string          `toml:"context"`
	Servers []string        `toml:"servers"`
	Metrics []string        `toml:"metrics"`
	Log     telegraf.Logger `toml:"-"`
	// contains filtered or unexported fields
}

func (*Cassandra) Gather

func (c *Cassandra) Gather(acc telegraf.Accumulator) error

func (*Cassandra) SampleConfig

func (*Cassandra) SampleConfig() string

func (*Cassandra) Start

func (c *Cassandra) Start(_ telegraf.Accumulator) error

func (*Cassandra) Stop

func (c *Cassandra) Stop()

type JolokiaClient

type JolokiaClient interface {
	MakeRequest(req *http.Request) (*http.Response, error)
}

type JolokiaClientImpl

type JolokiaClientImpl struct {
	// contains filtered or unexported fields
}

func (JolokiaClientImpl) MakeRequest

func (c JolokiaClientImpl) MakeRequest(req *http.Request) (*http.Response, error)

Jump to

Keyboard shortcuts

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