Supported OS Linux Mac OS

Versión de la integración4.1.0

Información general

El check de Memcache del Agent te permite rastrear el uso de la memoria de Memcache, los aciertos, los errores, los desalojos, el porcentaje de rellenado y mucho más.

Configuración

Instalación

El check de Memcache está incluido en el paquete del Datadog Agent, por lo que no necesitas instalar nada más en tus servidores de Memcache.

Configuración

Sigue las instrucciones de abajo para configurar este check para un Agent que se ejecuta en un host. En el caso de entornos en contenedores, consulta la sección Contenedores.

Al iniciar el servidor Memcache, establece el protocolo de enlace -B en binary o auto. El valor predeterminado es Automatic (auto).

Recopilación de métricas

Host

Para configurar este check para un Agent que se ejecuta en un host, haz lo siguiente:

  1. Edita el archivo mcache.d/conf.yaml, que se encuentra en la carpeta conf.d/ en la raíz del directorio de configuración del Agent. Consulta el archivo de ejemplo mcache.d/conf.yaml para conocer todas las opciones de configuración disponibles:

    init_config:
    
    instances:
      ## @param url - string - required
      ## url used to connect to the Memcached instance.
      #
      - url: localhost
    
  2. Reinicia el Agent para empezar a enviar métricas de Memcache a Datadog.

Recopilación de trazas

Datadog APM se integra con Memcache para ver las trazas (traces) en todo el sistema distribuido. La recopilación de trazas se encuentra habilitada de manera predeterminada en el Datadog Agent versión 6 o posterior. Para empezar a recopilar trazas:

  1. Habilita la recopilación de trazas en Datadog.
  2. Instrumenta la aplicación que realiza solicitudes a Memcache.

Contenedores

En el caso de los entornos en contenedores, consulta las Plantillas de integración de Autodiscovery para obtener orientación sobre la aplicación de los parámetros que se indican abajo.

ParámetroValor
<INTEGRATION_NAME>mcache
<INIT_CONFIG>en blanco o {}
<INSTANCE_CONFIG>{"url": "%%host%%","port": "11211"}
Recopilación de trazas

APM para aplicaciones en contenedores es compatible con los hosts que ejecutan el Agent versión 6, o posterior, pero requiere una configuración adicional a fin de empezar a recopilar trazas.

Variables de entorno necesarias en el contenedor del Agent:

ParámetroValor
<DD_API_KEY>api_key
<DD_APM_ENABLED>true
<DD_APM_NON_LOCAL_TRAFFIC>true

Consulta el Rastreo de aplicaciones de Kubernetes y la Configuración del daemon de Kubernetes para obtener una lista completa de las variables de entorno y configuración disponibles.

Luego, instrumenta tu contenedor de aplicaciones y configura DD_AGENT_HOST con el nombre del contenedor de tu Agent.

Recopilación de logs

Disponible para las versiones del Agent a partir de la 6.0

  1. Añade este bloque de configuración a tu archivo mcache.d/conf.yaml para empezar a recopilar logs de Memcached:

    logs:
      - type: file
        path: /var/log/memcached.log
        source: memcached
        service: mcache
    

    Cambia los valores de los parámetros path y service y configúralos para tu entorno.

  2. Reinicia el Agent para validar estos cambios.

Validación

Ejecuta el subcomando status del Agent y busca mcache en la sección Checks.

Datos recopilados

Métricas

memcache.avg_item_size
(gauge)
The average size of an item.
Shown as byte
memcache.bytes
(gauge)
Current number of bytes used by this server to store items.
Shown as byte
memcache.bytes_read_rate
(gauge)
Rate of bytes read from the network by this server.
Shown as byte
memcache.bytes_written_rate
(gauge)
Rate of bytes written to the network by this server.
Shown as byte
memcache.cas_badval_rate
(gauge)
Rate at which keys are compared and swapped where the comparison (original) value did not match the supplied value.
Shown as key
memcache.cas_hits_rate
(gauge)
Rate at which keys are compared and swapped and found present.
Shown as hit
memcache.cas_misses_rate
(gauge)
Rate at which keys are compared and swapped and not found present.
Shown as miss
memcache.cmd_flush_rate
(gauge)
Rate of "flush_all" commands.
Shown as command
memcache.cmd_get_rate
(gauge)
Rate of "get" commands.
Shown as command
memcache.cmd_set_rate
(gauge)
Rate of "set" commands.
Shown as command
memcache.connection_structures
(gauge)
Number of connection structures allocated by the server.
memcache.curr_connections
(gauge)
Number of open connections to this server.
Shown as connection
memcache.curr_items
(gauge)
Current number of items stored by the server.
Shown as item
memcache.delete_hits_rate
(gauge)
Rate at which delete commands result in items being removed.
Shown as hit
memcache.delete_misses_rate
(gauge)
Rate at which delete commands result in no items being removed.
Shown as miss
memcache.evictions_rate
(gauge)
Rate at which valid items are removed from cache to free memory for new items.
Shown as eviction
memcache.fill_percent
(gauge)
Amount of memory being used by the server for storing items as a percentage of the max allowed.
Shown as percent
memcache.get_hit_percent
(gauge)
Percentage of requested keys that are found present since the start of the memcache server.
Shown as percent
memcache.get_hits_rate
(gauge)
Rate at which keys are requested and found present.
Shown as hit
memcache.get_misses_rate
(gauge)
Rate at which keys are requested and not found.
Shown as miss
memcache.items.age
(gauge)
Age of the oldest item in the LRU
Shown as second
memcache.items.crawler_reclaimed_rate
(gauge)
Rate at which items freed by the LRU Crawler
Shown as operation
memcache.items.direct_reclaims_rate
(gauge)
Rate at which worker threads had to directly pull LRU tails to find memory for a new item
Shown as operation
memcache.items.evicted_nonzero_rate
(gauge)
Rate at which nonzero items which had an explicit expire time set had to be evicted from the LRU before expiring
Shown as eviction
memcache.items.evicted_rate
(gauge)
Rate at which items had to be evicted from the LRU before expiring
Shown as eviction
memcache.items.evicted_time
(gauge)
Seconds since the last access for the most recent item evicted from this class
Shown as second
memcache.items.evicted_unfetched_rate
(gauge)
Rate at which valid items evicted from the LRU which were never touched after being set
Shown as eviction
memcache.items.expired_unfetched_rate
(gauge)
Rate at which expired items reclaimed from the LRU which were never touched after being set
Shown as eviction
memcache.items.lrutail_reflocked_rate
(gauge)
Rate at which items found to be refcount locked in the LRU tail
Shown as item
memcache.items.moves_to_cold_rate
(gauge)
Rate at which items were moved from HOT or WARM into COLD
Shown as item
memcache.items.moves_to_warm_rate
(gauge)
Rate at which items were moved from COLD to WARM
Shown as item
memcache.items.moves_within_lru_rate
(gauge)
Rate at which active items were bumped within HOT or WARM
Shown as item
memcache.items.number
(gauge)
Number of items presently stored in this slab class
Shown as item
memcache.items.number_cold
(gauge)
Number of items presently stored in the COLD LRU
Shown as item
memcache.items.number_hot
(gauge)
Number of items presently stored in the HOT LRU
Shown as item
memcache.items.number_noexp
(gauge)
Number of items presently stored in the NOEXP class
Shown as item
memcache.items.number_warm
(gauge)
Number of items presently stored in the WARM LRU
Shown as item
memcache.items.outofmemory_rate
(gauge)
Rate at which the underlying slab class was unable to store a new item
Shown as error
memcache.items.reclaimed_rate
(gauge)
Rate at which entries were stored using memory from an expired entry
Shown as operation
memcache.items.tailrepairs_rate
(gauge)
Rate at which memcache self-healed a slab with a refcount leak
Shown as operation
memcache.limit_maxbytes
(gauge)
Number of bytes this server is allowed to use for storage.
Shown as byte
memcache.listen_disabled_num_rate
(gauge)
Rate at which the server has reached the max connection limit.
Shown as event
memcache.max_connections
(gauge)
Maximum number of connections to this server.
Shown as connection
memcache.pointer_size
(gauge)
Default size of pointers on the host OS (generally 32 or 64)
Shown as bit
memcache.rusage_system_rate
(gauge)
Fraction of time the CPU spent executing kernel code on behalf of this server process.
Shown as fraction
memcache.rusage_user_rate
(gauge)
Fraction of user time the CPU spent executing this server process.
Shown as fraction
memcache.slabs.active_slabs
(gauge)
Total number of slab classes allocated
Shown as occurrence
memcache.slabs.cas_badval_rate
(gauge)
Rate at which CAS commands failed to modify a value due to a bad CAS id
Shown as key
memcache.slabs.cas_hits_rate
(gauge)
Rate at which CAS commands modified this slab class
Shown as operation
memcache.slabs.chunk_size
(gauge)
The amount of space each chunk uses
Shown as byte
memcache.slabs.chunks_per_page
(gauge)
How many chunks exist within one page
Shown as buffer
memcache.slabs.cmd_set_rate
(gauge)
Rate at which set requests stored data in this slab class
Shown as command
memcache.slabs.decr_hits_rate
(gauge)
Rate at which decrs commands modified this slab class
Shown as operation
memcache.slabs.delete_hits_rate
(gauge)
Rate at which delete commands succeeded in this slab class
Shown as operation
memcache.slabs.free_chunks
(gauge)
Chunks not yet allocated to items or freed via delete
Shown as buffer
memcache.slabs.free_chunks_end
(gauge)
Number of free chunks at the end of the last allocated page
Shown as buffer
memcache.slabs.get_hits_rate
(gauge)
Rate at which get requests were serviced by this slab class
Shown as hit
memcache.slabs.incr_hits_rate
(gauge)
Rate at which incrs commands modified this slab class
Shown as operation
memcache.slabs.mem_requested
(gauge)
Number of bytes requested to be stored in this slab
Shown as byte
memcache.slabs.total_chunks
(gauge)
Total number of chunks allocated to the slab class
Shown as buffer
memcache.slabs.total_malloced
(gauge)
Total amount of memory allocated to slab pages
Shown as byte
memcache.slabs.total_pages
(gauge)
Total number of pages allocated to the slab class
Shown as page
memcache.slabs.touch_hits_rate
(gauge)
Rate of touches serviced by this slab class
Shown as operation
memcache.slabs.used_chunks
(gauge)
How many chunks have been allocated to items
Shown as buffer
memcache.slabs.used_chunks_rate
(gauge)
Rate at which chunks have been allocated to items
Shown as buffer
memcache.threads
(gauge)
Number of threads used by the current Memcached server process.
Shown as thread
memcache.total_connections_rate
(gauge)
Rate at which connections to this server are opened.
Shown as connection
memcache.total_items
(gauge)
Total number of items stored by this server since it started.
Shown as item
memcache.uptime
(gauge)
Number of seconds this server has been running.
Shown as second

El check solo recopila métricas memcache.slabs.* si estableces options.slabs: true en mcache.d/conf.yaml. Del mismo modo, solo recopila métricas memcache.items.* si estableces options.items: true.

Eventos

El check de Mcache no incluye eventos.

Checks de servicio

memcache.can_connect
Returns CRITICAL if the Agent is unable to connect to the monitored Memcached instance. Returns OK otherwise.
Statuses: ok, critical

Solucionar problemas

¿Necesitas ayuda? Ponte en contacto con el servicio de asistencia de Datadog.

Referencias adicionales

PREVIEWING: safchain/fix-custom-agent