Cassandra
This integration collects JMX metrics from Cassandra. The plugin uses the Jolokia read service. A bridge plugin included with the SolarWinds Snap Agent provides the Cassandra integration. The bridge plugin uses the Telegraf Jolokia2 plugin.
Prerequisites
Please follow official Jolokia agent documentation on steps required to download and use the service for your application.
To verify if metrics can be gathered, run following command:
curl http://localhost:8778/jolokia/read/org.apache.cassandra.metrics:name=*,scope=*,type=Cache
The following response should be returned:
# response
{
"request": {
"mbean": "org.apache.cassandra.metrics:name=*,scope=*,type=Cache",
"type": "read"
},
"value": {
"org.apache.cassandra.metrics:name=Hits,scope=KeyCache,type=Cache": {
"RateUnit": "events/second",
"OneMinuteRate": 1.9906081502830593e-21,
"Count": 42,
"FifteenMinuteRate": 0.2902696206403156,
"FiveMinuteRate": 0.0003821473143686264,
"MeanRate": 0.014042358437411123
},
"org.apache.cassandra.metrics:name=Entries,scope=CounterCache,type=Cache": {
"Value": 0
},
"org.apache.cassandra.metrics:name=OneMinuteHitRate,scope=CounterCache,type=Cache": {
"Value": null
},
…
Configuration
The agent provides an example task file to help you get started quickly, but you must provide the correct settings for your Cassandra installation. To enable and configure the task:
-
Make a copy of the cassandra example task file
task-bridge-cassandra.yaml.example
, renaming it totask-bridge-cassandra.yaml
:On Windows, using Explorer or PowerShell:
copy "C:\ProgramData\SolarWinds\Snap\tasks-autoload.d\task-bridge-cassandra.yaml.example" "C:\ProgramData\SolarWinds\Snap\tasks-autoload.d\task-bridge-cassandra.yaml"
On Linux using command line:
sudo cp -p /opt/SolarWinds/Snap/etc/tasks-autoload.d/task-bridge-cassandra.yaml.example /opt/SolarWinds/Snap/etc/tasks-autoload.d/task-bridge-cassandra.yaml
-
Edit the task file with settings specific to your Jolokia install:
If you wish to also collect logs for this service, uncomment the last section in the example task file. For more information on collecting logs, see the logs collector docs.
--- version: 2 schedule: type: cron interval: "0 * * * * *" plugins: - plugin_name: bridge config: jolokia2: ## Metric name prefix bridge_prefix: cassandra ## List of urls exposing jolokia read service urls: - http://localhost:8778/jolokia ## List of metrics to be collected from jolokia read service metrics: ## based on https://github.com/influxdata/telegraf/blob/master/plugins/inputs/jolokia2/examples/cassandra.conf - name: Cache mbean: org.apache.cassandra.metrics:name=*,scope=*,type=Cache tag_keys: - name - scope field_prefix: $1_ - name: Client mbean: org.apache.cassandra.metrics:name=*,type=Client tag_keys: - name field_prefix: $1_ - name: ClientRequestMetrics mbean: org.apache.cassandra.metrics:name=*,type=ClientRequestMetrics tag_keys: - name field_prefix: $1_ - name: ClientRequest mbean: org.apache.cassandra.metrics:name=*,scope=*,type=ClientRequest tag_keys: - name - scope field_prefix: $1_ - name: ColumnFamily mbean: org.apache.cassandra.metrics:keyspace=*,name=*,scope=*,type=ColumnFamily tag_keys: - keyspace - name - scope field_prefix: $2_ - name: CommitLog mbean: org.apache.cassandra.metrics:name=*,type=CommitLog tag_keys: - name field_prefix: $1_ - name: Compaction mbean: org.apache.cassandra.metrics:name=*,type=Compaction tag_keys: - name field_prefix: $1_ - name: CQL mbean: org.apache.cassandra.metrics:name=*,type=CQL tag_keys: - name field_prefix: $1_ - name: DroppedMessage mbean: org.apache.cassandra.metrics:name=*,scope=*,type=DroppedMessage tag_keys: - name - scope field_prefix: $1_ - name: FileCache mbean: org.apache.cassandra.metrics:name=*,type=FileCache tag_keys: - name field_prefix: $1_ - name: ReadRepair mbean: org.apache.cassandra.metrics:name=*,type=ReadRepair tag_keys: - name field_prefix: $1_ - name: Storage mbean: org.apache.cassandra.metrics:name=*,type=Storage tag_keys: - name field_prefix: $1_ - name: ThreadPools mbean: org.apache.cassandra.metrics:name=*,path=*,scope=*,type=ThreadPools tag_keys: - name - path - scope field_prefix: $1_ tags: /: collector_plugin: "cassandra" publish: - plugin_name: publisher-appoptics ## If you want to gather logs for this integration, uncomment the following section. # - plugin_name: log-files # config: # file_paths: # - /var/log/cassandra/* # publish: # - plugin_name: loggly-http-bulk
-
Restart the agent:
On Windows command line:
net stop swisnapd net start swisnapd
On Linux command line:
sudo service swisnapd restart
-
Enable the Jolokia2 integration in AppOptics:
On the Integrations Page you will see Jolokia2 integration available. It may take a couple minutes before the Jolokia2 integration is identified. Select the Jolokia2 integration to open the configuration menu in AppOptics, and enable it. If you do not see Jolokia2 as an option, see Troubleshooting Linux.
Metrics and Tags
The Cassandra integration collect JMX Cassandra metrics. For a full list of available metrics and their descriptions, please visit Cassandra documentation.
Tags
Tags can be set dynamically based on the MBean property-key names defined in the tag_keys
field. See Jolokia Metric Configuration for more information.
Example
The tag_keys
field is configured in the metrics in the example below.
## List of metrics to be collected from jolokia read service metrics: ## based on https://github.com/influxdata/telegraf/blob/master/plugins/inputs/jolokia2/examples/cassandra.conf - name: Cache mbean: org.apache.cassandra.metrics:name=*,scope=*,type=Cache tag_keys: - name - scope field_prefix: $1_ - name: Client mbean: org.apache.cassandra.metrics:name=*,type=Client tag_keys: - name field_prefix: $1_
Navigation Notice: When the APM Integrated Experience is enabled, AppOptics shares a common navigation and enhanced feature set with other integrated experience products. How you navigate AppOptics and access its features may vary from these instructions.
The scripts are not supported under any SolarWinds support program or service. The scripts are provided AS IS without warranty of any kind. SolarWinds further disclaims all warranties including, without limitation, any implied warranties of merchantability or of fitness for a particular purpose. The risk arising out of the use or performance of the scripts and documentation stays with you. In no event shall SolarWinds or anyone else involved in the creation, production, or delivery of the scripts be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the scripts or documentation.