Skip to main content

Memcached - OpenTelemetry Collector

Thumbnail icon Thumbnail icon

The Memcached app is a logs based app that helps you monitor your Memcached clusters. Preconfigured dashboards provide insight into errors, warnings, and commands executed.

The Sumo Logic App for Memcached is tested for Version: 1.4.15.

Memcache logs are sent to Sumo Logic through OpenTelemetry filelog receiver.

Schematics

Fields creation in Sumo Logic for Memcached

Following are the Fields which will be created as part of Memcached App install if not already present.

  • db.cluster.name. User configured. Enter a name to identify this Memcache cluster. This cluster name will be shown in the Sumo Logic dashboards.
  • db.system. Has a fixed value of memcached
  • deployment.environment. User configured. This is the deployment environment where the Memcache cluster resides. For example: dev, prod or qa.
  • sumo.datasource. Has a fixed value of memcached.

Prerequisites

  1. Configure logging in Memcached: By default, the installation of Memcached will not write any request logs to disk. To add a log file for Memcached, you can use the following syntax:
    memcached -d -m 3072 -l localhost -p 11211 -u nobody -v 2>>/var/log/memcached/memcached.log
  2. Or, if you're on RHEL/CentOS, you can edit the file /etc/sysconfig/memcached like so:
    PORT="11211"
    USER="memcached"
    MAXCONN="3048"
    CACHESIZE="256"
    OPTIONS="-vv >> /var/log/memcached/memcached.log 2>&1"
  3. Save the file and restart Memcached.

Configure Memcached Logs Collection and App installation

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

In this step, you will configure the yaml file required for Memcached Collection. Path of the log file configured to capture Memcached logs needs to be given here.

The files are typically located in /var/log/memcached/memcached.log. If you're using a customized path, check the respective conf file (default location: /etc/memcached.conf) 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.

YAML

Step 3: Send logs to Sumo

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 Memcache instance which needs to be monitored.
  2. 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 Message

Jun 23 07:35:01 node03 memcached: \
<31 set GFcIh47CswfCnwk3JkmJ 0 0 4096

Sample Query

Following is the query from Errors panel of Memcached app's overview Dashboard:

%"deployment.environment"=* %"db.cluster.name"=* %"sumo.datasource"=memcached memcached ">" ERROR | json "log" as _rawlog nodrop 
| if (isEmpty(_rawlog), _raw, _rawlog) as memcached_log_message
| parse regex field=memcached_log_message ">(?<pid>\d+) (?<cmd>\w+)"
| if(cmd matches "ERROR",1,0) as ERROR
| timeslice by 1
| sum(ERROR) as ERROR by _timeslice

Viewing Memcached Dashboards

Overview

The Memcached - Overview dashboard provides an at-a-glance view of the Memcached errors, client protocol, and command executed.

Overview

Logs

The Memcached - Logs dashboard helps you quickly analyze your Memcached error logs, commands executed, and objects stored.

Logs
Legal
Privacy Statement
Terms of Use

Copyright © 2023 by Sumo Logic, Inc.