The Memcached integration primarily collects cache-usage metrics, such as the number of items in a cache, the number of evictions, and the number of bytes stored. It also collects general performance metrics for CPU usage and network throughput.
For more information about Memcached, see the Memcached documentation.
Prerequisites
To collect Memcached telemetry, you must install the Ops Agent:
- For metrics, install version 2.8.0 or higher.
- For logs, install version 2.15.0 or higher.
This integration supports Memcached version 1.6.
Configure the Ops Agent for Memcached
Following the guide for Configuring the Ops Agent, add the required elements to collect telemetry from Memcached instances, and restart the agent.
Example configuration
The following command creates the configuration to collect and ingest telemetry for Memcached and restarts the Ops Agent.
Collect logs
Memcached writes logs to syslog
, which is captured by the Ops Agent by
default. No additional user configuration is required.
Configure metrics collection
To ingest metrics from Memcached, you must create receivers for the metrics that Memcached produces and then create a pipeline for the new receivers.
To configure a receiver for your memcached
metrics, specify the following
fields:
Field | Default | Description |
---|---|---|
collection_interval |
60s |
A time duration value, such as 30s or 5m . |
endpoint |
localhost:3306 |
The URL, or Unix socket file path, for your Memcached server. |
type |
This value must be memcached . |
What is monitored
The following table provides the list of metrics that the Ops Agent collects from the Memcached instance.
Metric type | |
---|---|
Kind, Type Monitored resources |
Labels |
workload.googleapis.com/memcached.bytes
|
|
GAUGE , INT64 gce_instance |
|
workload.googleapis.com/memcached.commands
|
|
CUMULATIVE , INT64 gce_instance |
command
|
workload.googleapis.com/memcached.connections.current
|
|
GAUGE , INT64 gce_instance |
|
workload.googleapis.com/memcached.connections.total
|
|
CUMULATIVE , INT64 gce_instance |
|
workload.googleapis.com/memcached.cpu.usage
|
|
CUMULATIVE , DOUBLE gce_instance |
state
|
workload.googleapis.com/memcached.current_items
|
|
GAUGE , INT64 gce_instance |
|
workload.googleapis.com/memcached.evictions
|
|
CUMULATIVE , INT64 gce_instance |
|
workload.googleapis.com/memcached.network
|
|
CUMULATIVE , INT64 gce_instance |
direction
|
workload.googleapis.com/memcached.operations
|
|
CUMULATIVE , INT64 gce_instance |
operation type
|
workload.googleapis.com/memcached.threads
|
|
GAUGE , INT64 gce_instance |
Sample dashboard
To view your Memcached metrics, you must have a chart or dashboard configured. Cloud Monitoring provides a library of sample dashboards for integrations, which contain preconfigured charts. For information about installing these dashboards, see Installing sample dashboards.
Verify the configuration
This section describes how to verify that you correctly configured the Memcached receiver. It might take one or two minutes for the Ops Agent to begin collecting telemetry.
To verify that the logs are ingested, go to the Logs Explorer and run the following query to view the Memcached logs:
resource.type="gce_instance"
log_id("syslog")
jsonPayload.message~='(systemd-memcached-wrapper|memcached)(\[[0-9]+\])*:'
To verify that the metrics are ingested, go to Metrics Explorer and run the following query in the MQL tab:
fetch gce_instance
| metric 'workload.googleapis.com/memcached.bytes'
| every 1m
What's next
For a walkthrough on how to use Ansible to install the Ops Agent, configure a third-party application, and install a sample dashboard, see the Install the Ops Agent to troubleshoot third-party applications video.