Skip to main content

Memcached Receiver

Status Available in: contrib Maintainers: @jsirianni Source: opentelemetry-collector-contrib

Supported Telemetry

Metrics

Overview

Configuration

The following settings are required:
  • endpoint (default: localhost:11211): The hostname/IP address and port or, unix socket file path of the memcached instance
  • transport (default: no default): Known protocols are “tcp”, “tcp4” (IPv4-only), “tcp6” (IPv6-only), “udp”, “udp4” (IPv4-only), “udp6” (IPv6-only), “ip”, “ip4” (IPv4-only), “ip6” (IPv6-only), “unix”, “unixgram” and “unixpacket”.
The following settings are optional:
  • collection_interval (default = 10s): This receiver runs on an interval. Each time it runs, it queries memcached, creates metrics, and sends them to the next consumer. The collection_interval configuration option tells this receiver the duration between runs. This value must be a string readable by Golang’s ParseDuration function (example: 1h30m). Valid time units are ns, us (or µs), ms, s, m, h.
  • initial_delay (default = 1s): defines how long this receiver waits before starting.
Example:
receivers:
  memcached:
    endpoint: "localhost:11211"
    collection_interval: 10s
    transport: tcp
The full list of settings exposed for this receiver are documented in config.go with detailed sample configurations in testdata/config.yaml.

Metrics

Details about the metrics produced by this receiver can be found in metadata.yaml with further documentation in documentation.md

Metrics

Metric NameDescriptionUnitTypeAttributes
memcached.bytesCurrent number of bytes used by this server to store items.ByGauge
memcached.commandsCommands executed.{commands}Countercommand
memcached.connections.currentThe current number of open connections.{connections}UpDownCounter
memcached.connections.totalTotal number of connections opened since the server started running.{connections}Counter
memcached.cpu.usageAccumulated user and system time.sCounterstate
memcached.current_itemsNumber of items currently stored in the cache.{items}UpDownCounter
memcached.evictionsCache item evictions.{evictions}Counter
memcached.networkBytes transferred over the network.byCounterdirection
memcached.operation_hit_ratioHit ratio for operations, expressed as a percentage value between 0.0 and 100.0.%Gaugeoperation
memcached.operationsOperation counts.{operations}Countertype, operation
memcached.threadsNumber of threads used by the memcached instance.{threads}UpDownCounter

Attributes

Attribute NameDescriptionTypeValues
commandThe type of command.stringget, set, flush, touch
directionDirection of data flow.stringsent, received
operationThe type of operation.stringincrement, decrement, get
stateThe type of CPU usage.stringsystem, user
typeResult of cache request.stringhit, miss

Configuration

Example Configuration

memcached:
  endpoint: "localhost:11211"
  collection_interval: 10s

Last generated: 2026-04-13