Skip to main content

RabbitMQ - OpenTelemetry Collector

icon Thumbnail icon

RabbitMQ logs are sent to Sumo Logic through the OpenTelemetry filelog receiver. RabbitMQ metrics are sent through the RabbitMQ metrics receiver.

Schematics

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 as dev, prod, or qa.
  • 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​

note

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:

  1. 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.
  2. 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 the RabbitMQ.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​

note

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:

  1. Select the Add a new Collector option.
  2. 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.

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.

YAML

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.

  1. Copy the yaml file to /etc/otelcol-sumo/conf.d/ folder in the RabbitMQ instance which needs to be monitored.
  2. Move the env file to the following directory:
/etc/otelcol-sumo/env/
  1. Restart the collector using:
  sudo systemctl restart 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.

Query String
 %"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.

RabbitMQ Logs dashboards

Metrics​

The RabbitMQ - Metrics dashboard gives you an at-a-glance view of your RabbitMQ deployment across brokers, queue, exchange, consumer, and messages.

RabbitMQ Metrics dashboards
Status
Legal
Privacy Statement
Terms of Use

Copyright © 2024 by Sumo Logic, Inc.