RabbitMQ - OpenTelemetry Collector
RabbitMQ logs are sent to Sumo Logic through the OpenTelemetry filelog receiver. RabbitMQ metrics are sent through the RabbitMQ metrics receiver.
This app includes built-in monitors. For details on creating custom monitors, refer to the Create monitors for RabbitMQ app.
Fields creation in Sumo Logic for RabbitMQ
Following are the Fields which will be created as part of RabbitMQ App install if not already present.
sumo.datasource
. Fixed value of rabbitmq.messaging.system
. Fixed value of rabbitmq.deployment.environment
. This is a user-configured field set at the time of collector installation. It identifies the environment where the rabbitmq env resides, such asdev
,prod
, orqa
.messaging.cluster.name
. User configured. Enter a name to uniquely identify your RabbitMQ cluster. This cluster name will be shown in the Sumo Logic dashboards.messaging.node.name
. Includes the value of the hostname of the machine which is being monitored.
Prerequisites
For metrics collection
The RabbitMQ receiver supports RabbitMQ versions 3.8
and 3.9
.
Enable the RabbitMQ management plugin by following the instructions in the RabbitMQ documentation. Also, make sure you at least have the monitoring level permissions to monitor the metrics.
For logs collection
This section provides instructions for configuring log collection for RabbitMQ running on a non-Kubernetes environment for the Sumo Logic App for RabbitMQ. By default, RabbitMQ logs are stored in a log file.
Follow the instructions to set up log collection:
- RabbitMQ logs have six levels of verbosity: debug, info, warning, error, critical, and none. For more information, refer to the RabbitMQ documentation. To make sure the dashboard work properly, the log level needs to be set to debug. Default log level is info. All logging settings are located in RabbitMQ.conf.
- Configure RabbitMQ to write log lines to a local file. By default, RabbitMQ logs are stored in
/var/log/rabbitmq/rabbit@<hostname>.log
. The default directory for log files is listed in theRabbitMQ.conf
file. To configure the log output destination to a log file, use one of the following settings, either in the configuration file. Edit or create/etc/rabbitmq/rabbitmq.conf
file config:
log.dir = /var/log/rabbitmq
log.file = rabbitmq.log
log.file.level = debug
Once the logs are configured to be written to a local file, follow the below steps to configure collection in Sumo Logic.
For Linux systems with ACL Support, the otelcol install process should have created the ACL grants necessary for the otelcol system user to access default log locations. You can verify the active ACL grants using the getfacl
command. Install the ACL in your Linux environment, if not installed.
The required ACL may not be supported for some rare cases, for example, Linux OS Distro, which is officially not supported by Sumo Logic. In this case, you can run the following command to explicitly grant the permissions.
sudo setfacl -R -m d:u:otelcol-sumo:r-x,d:g:otelcol-sumo:r-x,u:otelcol-sumo:r-x,g:otelcol-sumo:r-x <PATH_TO_LOG_FILE>
Run the above command for all the log files in the directory that need to be ingested, which are not residing in the default location.
If Linux ACL Support is not available, traditional Unix-styled user and group permission must be modified. It should be sufficient to add the otelcol system user to the specific group that has access to the log files.
For Windows systems, log files which are collected should be accessible by the SYSTEM group. Use the following set of PowerShell commands if the SYSTEM group does not have access.
$NewAcl = Get-Acl -Path "<PATH_TO_LOG_FILE>"
# Set properties
$identity = "NT AUTHORITY\SYSTEM"
$fileSystemRights = "ReadAndExecute"
$type = "Allow"
# Create new rule
$fileSystemAccessRuleArgumentList = $identity, $fileSystemRights, $type
$fileSystemAccessRule = New-Object -TypeName System.Security.AccessControl.FileSystemAccessRule -ArgumentList $fileSystemAccessRuleArgumentList
# Apply new rule
$NewAcl.SetAccessRule($fileSystemAccessRule)
Set-Acl -Path "<PATH_TO_LOG_FILE>" -AclObject $NewAcl
Collection configuration and app installation
As part of data collection setup and app installation, you can select the App from App Catalog and click on Install App. Follow the steps below.
Step 1: Set up Collector
If you want to use an existing OpenTelemetry Collector, you can skip this step by selecting the Use an existing Collector option.
To create a new Collector:
- Select the Add a new Collector option.
- Select the platform where you want to install the Sumo Logic OpenTelemetry Collector.
This will generate a command that you can execute in the machine environment you need to monitor. Once executed, it will install the Sumo Logic OpenTelemetry Collector.
Step 2: Configure integration
OpenTelemetry works with a configuration yaml file with all the details concerning the data that needs to be collected. For example, it specifies the location of a log file that is read and sent to the Sumo Logic platform.
In this step, you will configure the yaml file required for RabbitMQ collection.
Below are the inputs required:
endpoint (no default)
. The hostname and port of the RabbitMQ instance, separated by a colon. (For example:localhost:15672
.)- RabbitMQ logs Path. Enter the path to the log file for your RabbitMQ instance.
- username. Enter the RabbitMQ username.
- password. Enter the RabbitMQ password.
The log file path configured to capture RabbitMQ logs must be given here. The files are typically located in /var/log/rabbitmq/rabbit@<hostname>.log
. If you are using a customized path, check the rabbitmq.conf
file for this information.
You can add any custom fields which you want to tag along with the data ingested in sumo. Click on the Download YAML File button to get the yaml file.
For Linux platform, click Download Environment Variables File to get the file with the password which is supposed to be set as environment variable.
Step 3: Send logs to Sumo Logic
Once you have downloaded the YAML file as described in the previous step, follow the below steps based on your platform.
- Linux
- Windows
- macOS
- Chef
- Ansible
- Puppet
- Copy the yaml file to
/etc/otelcol-sumo/conf.d/
folder in the RabbitMQ instance which needs to be monitored. - Move the
env
file to the following directory:
/etc/otelcol-sumo/env/
- Restart the collector using:
sudo systemctl restart otelcol-sumo
- Copy the yaml file to
C:\ProgramData\Sumo Logic\OpenTelemetry Collector\config\conf.d
folder in the machine which needs to be monitored. - Restart the collector using:
Restart-Service -Name OtelcolSumo
- Copy the yaml file to /etc/otelcol-sumo/conf.d/ folder in the RabbitMq instance which needs to be monitored.
- Restart the otelcol-sumo process using the below command
otelcol-sumo --config /etc/otelcol-sumo/sumologic.yaml --config "glob:/etc/otelcol-sumo/conf.d/*.yaml"
- Copy the yaml file into your Chef cookbook files directory
files/<downloaded_yaml_file>
. - Use a Chef file resource in a recipe to manage it.
cookbook_file '/etc/otelcol-sumo/conf.d/<downloaded_yaml_file>' do mode 0644 notifies :restart, 'service[otelcol-sumo]', :delayed end
- Add the recipe to your collector setup to start collecting the data. Every team typically has their established way of applying the Chef recipe. The resulting Chef recipe should look something like:
cookbook_file '/etc/otelcol-sumo/conf.d/<downloaded_yaml_file>' do
mode 0644
notifies :restart, 'service[otelcol-sumo]', :delayed
end
- Place the file into your Ansible playbook files directory.
- Run the Ansible playbook.
ansible-playbook -i inventory install_sumologic_otel_collector.yaml
-e '{"installation_token": "<YOUR_TOKEN>", "collector_tags": {<YOUR_TAGS>}, "src_config_path": "files/conf.d"}'
- Place the file into your Puppet module files directory
modules/install_otel_collector/files/<downloaded_yaml>
. - Use a Puppet file resource to manage it.
file { '/etc/otelcol-sumo/conf.d/<downloaded_yaml_file>':
ensure => present,
source => 'puppet:///modules/install_otel_collector/<downloaded_yaml_file>',
mode => '0644',
notify => Service[otelcol-sumo],
} - Apply the Puppet manifest. Every team typically has their established way of applying the Puppet manifest. The resulting Puppet manifest should look something like:
node 'default' {
class { 'install_otel_collector'
installation_token => '<YOUR_TOKEN>',
collector_tags => { <YOUR_TAGS> },
}
service { 'otelcol-sumo':
provider => 'systemd',
ensure => running,
enable => true,
require => Class['install_otel_collector'],
}
file { '/etc/otelcol-sumo/conf.d/<downloaded_yaml_file>':
ensure => present,
source => 'puppet:///modules/install_otel_collector/<downloaded_yaml_file>',
mode => '0644',
notify => Service[otelcol-sumo],
}
}
After successfully executing the above command, Sumo Logic will start receiving data from your host machine.
Click Next. This will install the app (dashboards and monitors) to your Sumo Logic Org.
Dashboard panels will start to fill automatically. It's important to note that each panel fills with data matching the time range query and received since the panel was created. Results won't immediately be available, but within 20 minutes, you'll see full graphs and maps.
Sample log messages
Here's a sample log message you'd find in Non-Kubernetes environments.
2023-01-16 05:53:44.858 [info] <0.44.0> Application cowboy exited with reason: stopped
Sample queries
Logs
This sample Query is from the RabbitMQ - Logs dashboard > Events by Severity panel.
%"sumo.datasource"="rabbitmq" %"messaging.cluster.name"=* host.name=*
| json "log" as _rawlog nodrop
| if(isEmpty(_rawlog),_raw,_rawlog) as _raw
| parse "* * [*]" as date,time,severity | count by severity
Metrics
This sample query is from the Average Number of Consumers panel in RabbitMQ - Metrics dashboard.
| avg by messaging.cluster.name
| sum
Viewing RabbitMQ Dashboards
Logs
The RabbitMQ - Logs dashboard gives you an at-a-glance view of error messages, error by severity, top and last 10 errors, broker, and Event Start/Add log messages.
Metrics
The RabbitMQ - Metrics dashboard gives you an at-a-glance view of your RabbitMQ deployment across brokers, queue, exchange, consumer, and messages.
Create monitors for RabbitMQ app
From your App Catalog:
- From the Sumo Logic navigation, select App Catalog.
- In the Search Apps field, search for and then select your app.
- Make sure the app is installed.
- Navigate to What's Included tab and scroll down to the Monitors section.
- Click Create next to the pre-configured monitors. In the create monitors window, adjust the trigger conditions and notifications settings based on your requirements.
- Scroll down to Monitor Details.
- Under Location click on New Folder.
note
By default, monitor will be saved in the root folder. So to make the maintenance easier, create a new folder in the location of your choice.
- Enter Folder Name. Folder Description is optional.
tip
Using app version in the folder name will be helpful to determine the versioning for future updates.
- Click Create. Once the folder is created, click on Save.
RabbitMQ alerts
Name | Description | Alert Condition | Recover Condition |
---|---|---|---|
RabbitMQ - High Consumer Count | This alert is triggered when consumers are higher than given value (Default 10000) in a queue. | Count >= 10000 | Count < 10000 |
RabbitMQ - High Message Queue Size | This alert is triggered when the number of messages in a queue exceeds a given threshold (Default 10000), indicating potential consumer issues or message processing bottlenecks. | Count >= 10000 | Count < 10000 |
RabbitMQ - High Messages Count | This alert is triggered when messages are higher than given value (Default 10000) in a queue. | Count >= 10000 | Count < 10000 |
RabbitMQ - High Unacknowledged Messages | This alert is triggered when there are too many unacknowledged messages (Default 5000), suggesting consumer processing issues. | Count >= 5000 | Count < 5000 |
RabbitMQ - Node Down | This alert is triggered when a node in the RabbitMQ cluster is down. | Count >= 1 | Count < 1 |
RabbitMQ - Zero Consumers Alert | This alert is triggered when a queue has no consumers, indicating potential service issues. | Count <= 0 | Count > 0 |