From 29bfc32b142577429db52b386d37ae8f7b3a268d Mon Sep 17 00:00:00 2001 From: Subhachandra Chandra Date: Fri, 8 Apr 2016 17:37:12 -0700 Subject: [PATCH] Updated documentation based on review comments from @sparrc --- CHANGELOG.md | 1 + README.md | 1 + plugins/inputs/cassandra/README.md | 101 +++++++++++++++++++++++++- plugins/inputs/cassandra/cassandra.go | 6 +- 4 files changed, 104 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 020a06cfe..473256690 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ## v0.12.1 [unreleased] ### Features +- [#952](https://github.com/influxdata/telegraf/pull/952): Cassandra input plugin. Thanks @subhachandrachandra! - [#976](https://github.com/influxdata/telegraf/pull/976): Reduce allocations in the UDP and statsd inputs. - [#979](https://github.com/influxdata/telegraf/pull/979): Reduce allocations in the TCP listener. - [#935](https://github.com/influxdata/telegraf/pull/935): AWS Cloudwatch input plugin. Thanks @joshhardy & @ljosa! diff --git a/README.md b/README.md index 994c6803d..9c073f416 100644 --- a/README.md +++ b/README.md @@ -160,6 +160,7 @@ Currently implemented sources: * [aerospike](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/aerospike) * [apache](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/apache) * [bcache](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/bcache) +* [cassandra](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/cassandra) * [couchbase](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/couchbase) * [couchdb](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/couchdb) * [disque](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/disque) diff --git a/plugins/inputs/cassandra/README.md b/plugins/inputs/cassandra/README.md index 49b046dc5..0a0f7fcf8 100644 --- a/plugins/inputs/cassandra/README.md +++ b/plugins/inputs/cassandra/README.md @@ -9,15 +9,15 @@ The Cassandra plugin collects Cassandra/JVM metrics exposed as MBean's attributes through jolokia REST endpoint. All metrics are collected for each server configured. -See: https://jolokia.org/ +See: https://jolokia.org/ and [Cassandra Documentation](http://docs.datastax.com/en/cassandra/3.x/cassandra/operations/monitoringCassandraTOC.html) # Measurements: 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. Given a configuration like: -```ini -[inputs.cassandra] +```toml +[[inputs.cassandra]] context = "/jolokia/read" servers = [":8778"] metrics = ["/java.lang:type=Memory/HeapMemoryUsage"] @@ -28,3 +28,98 @@ The collected metrics will be: ``` 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. + +- [How to monitor Cassandra performance metrics](https://www.datadoghq.com/blog/how-to-monitor-cassandra-performance-metrics) +- [Cassandra Documentation](http://docs.datastax.com/en/cassandra/3.x/cassandra/operations/monitoringCassandraTOC.html) + +####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=Hit +- /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=Hit +- /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=CompletedTask +- /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 + + diff --git a/plugins/inputs/cassandra/cassandra.go b/plugins/inputs/cassandra/cassandra.go index 71f0b17a7..b7525de1a 100644 --- a/plugins/inputs/cassandra/cassandra.go +++ b/plugins/inputs/cassandra/cassandra.go @@ -196,8 +196,10 @@ func (j *Cassandra) SampleConfig() string { ## 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"] + metrics = [ + "/java.lang:type=Memory/HeapMemoryUsage", + "/org.apache.cassandra.metrics:type=Table,keyspace=*,scope=*,name=ReadLatency" + ] ` }