Jolokia2
This integration collects JMX metrics using the Jolokia read service. A bridge plugin included with the SolarWinds Snap Agent provides the Jolokia2 integration. The bridge plugin uses the Telegraf Jolokia2 plugin.
This integrations is currently available for Linux and Windows
Prerequisites
This integration requires that the Jolokia read service be available. Refer to official Jolokia agent documentation for information on downloading and using the service for your application.
To verify if metrics can be gathered, run the following command:
The following response is returned:
# response
{
"request":{
"mbean":"java.lang:type=Memory",
"attribute":"HeapMemoryUsage",
"type":"read"
},
"value":{
"init":520093696,
"committed":509607936,
"max":509607936,
"used":137689336
},
"timestamp":1510095659,
"status":200
}
Configuration
The Snap agent provides an example task file with basic JVM metrics to help you get started quickly, however you need to provide the correct settings for your Jolokia2 installation. To enable the task:
-
Make a copy of the cassandra example task file
task-bridge-jolokia2.yaml.example
and rename the copied file totask-bridge-jolokia2.yaml
:On Windows, using Explorer or PowerShell:
Copycopy "C:\ProgramData\SolarWinds\Snap\tasks-autoload.d\task-bridge-jolokia2.yaml.example" "C:\ProgramData\SolarWinds\Snap\tasks-autoload.d\task-bridge-jolokia2.yaml"
On Linux using command line:
Copysudo cp /opt/SolarWinds/Snap/etc/tasks-autoload.d/task-bridge-jolokia2.yaml.example /opt/SolarWinds/Snap/etc/tasks-autoload.d/task-bridge-jolokia2.yaml
-
Edit the task file with settings specific to your Jolokia install:
Copy---
version: 2
schedule:
type: simple
interval: "60s"
plugins:
- plugin_name: bridge
config:
jolokia2:
## List of urls exposing jolokia read service
urls:
- http://localhost:8080/jolokia
## Metric name prefix
#bridge_prefix: jolokia2
## Username and password needed to access jolokia service
#username: admin
#password: admin
## Timeout for fetching response from jolokia
# response_timeout: "5s"
## Optional TLS Config
# tls_ca: /path/to/cafile
# tls_cert: /path/to/certfile
# tls_key: /path/to/keyfile
## Use TLS but skip chain & host verification
# insecure_skip_verify: true
## List of metrics to be collected from jolokia read service
metrics:
- name: OperatingSystem
mbean: java.lang:type=OperatingSystem
paths:
- ProcessCpuLoad
- SystemLoadAverage
- SystemCpuLoad
- name: jvm_memory
mbean: java.lang:type=Memory
paths:
- HeapMemoryUsage
- NonHeapMemoryUsage
- ObjectPendingFinalizationCount
- name: jvm_garbage_collector
mbean: java.lang:name=*,type=GarbageCollector
paths:
- CollectionTime
- CollectionCount
tag_keys:
- name
- name: jvm_memory_pool
mbean: java.lang:name=*,type=MemoryPool
paths:
- Usage
- PeakUsage
- CollectionUsage
tag_keys:
- name
tag_prefix: pool_
publish:
- plugin_name: publisher-appoptics -
Restart the agent
On Windows command line:
Copynet stop swisnapd
net start swisnapdOn Linux command line:
Copysudo 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 Jolokia2 integration comes with few example JVM metrics to help you get started. This integration allows to collect any metric your application exposes using JMX agent.