Metricbeat Redis Module Connection to Digitalocean DB Failure

Hi,
I am trying to connect the redis module of metricbeat to a digitalocean hosted redis database; but EOF errors are thrown. Is there an alternate approach I should use to connect to a redis server over TLS as apposed to a connection string of the following format 'rediss://username:password@private-xxx-redis-do-user-xxx-0.a.db.ondigitalocean.com:25061'?

My module config is as follows

# Module: redis
# Docs: https://www.elastic.co/guide/en/beats/metricbeat/7.6/metricbeat-module-redis.html

- module: redis
  enabled: true
  metricsets: ["info", "keyspace", "key"]
  key.patterns:
   - pattern: '*'
  period: 60s

  # Redis hosts
  hosts: ["rediss://username:password@private-xxx-redis-do-user-xxx-0.a.db.ondigitalocean.com:25061"]

  # Network type to be used for redis connection. Default: tcp
  network: tcp

  # Max number of concurrent connections. Default: 10
  #maxconn: 10

  # Redis AUTH password. Empty by default.
  # password: "foo"

The errors returned are

Apr 08 12:46:05 xxx-xxx-1 metricbeat[28087]: 2020-04-08T12:46:05.310Z        ERROR        redis/redis.go:70        Error retrieving INFO stats: EOF
Apr 08 12:46:05 xxx-xxx-1 metricbeat[28087]: 2020-04-08T12:46:05.315Z        INFO        module/wrapper.go:252        Error fetching data for metricset redis.keyspace: Failed to fetch redis info for keyspaces: EOF
Apr 08 12:46:05 xxx-xxx-1 metricbeat[28087]: 2020-04-08T12:46:05.315Z        ERROR        redis/redis.go:70        Error retrieving INFO stats: EOF
Apr 08 12:46:05 xxx-xxx-1 metricbeat[28087]: 2020-04-08T12:46:05.315Z        INFO        module/wrapper.go:252        Error fetching data for metricset redis.info: failed to fetch redis info: EOF
Apr 08 12:46:05 xxx-xxx-1 metricbeat[28087]: 2020-04-08T12:46:05.317Z        ERROR        [redis.key]        key/key.go:90        Failed to select keyspace 0: EOF

Running metricbeat test
sudo metricbeat test modules redis

Results in:

redis...
  info...
    error... ERROR failed to fetch redis info: EOF
  keyspace...
    error... ERROR Failed to fetch redis info for keyspaces: EOF
  key...
    error... ERROR EOF

connecting directly to redis from the same server with redli
./redli --tls -h private-xxx-redis-do-user-xxx-0.a.db.ondigitalocean.com -a xxx -p 25061
results in

# Server
redis_version:5.0.6
redis_git_sha1:xxx
redis_git_dirty:1
redis_build_id:788e1c4d45b82fe1
redis_mode:standalone
os:Linux 5.5.10-100.fc30.x86_64 x86_64
arch_bits:64
multiplexing_api:epoll
atomicvar_api:atomic-builtin
gcc_version:9.2.1
process_id:58
run_id:xxx
tcp_port:25060
uptime_in_seconds:596205
uptime_in_days:6
hz:10
configured_hz:10
lru_clock:9291355
executable:/usr/bin/redis-server
config_file:/etc/redis.conf

# Clients
connected_clients:676
client_recent_max_input_buffer:2
client_recent_max_output_buffer:0
blocked_clients:221

# Memory
used_memory:76583128
used_memory_human:73.04M
used_memory_rss:78012416
used_memory_rss_human:74.40M
used_memory_peak:143037008
used_memory_peak_human:136.41M
used_memory_peak_perc:53.54%
used_memory_overhead:34081900
used_memory_startup:791368
used_memory_dataset:42501228
used_memory_dataset_perc:56.08%
allocator_allocated:77002728
allocator_active:82821120
allocator_resident:88924160
total_system_memory:2077958144
total_system_memory_human:1.94G
used_memory_lua:59392
used_memory_lua_human:58.00K
used_memory_scripts:15872
used_memory_scripts_human:15.50K
number_of_cached_scripts:8
maxmemory:1196425216
maxmemory_human:1.11G
maxmemory_policy:allkeys-lru
allocator_frag_ratio:1.08
allocator_frag_bytes:5818392
allocator_rss_ratio:1.07
allocator_rss_bytes:6103040
rss_overhead_ratio:0.88
rss_overhead_bytes:-10911744
mem_fragmentation_ratio:1.01
mem_fragmentation_bytes:1102400
mem_not_counted_for_evict:0
mem_replication_backlog:0
mem_clients_slaves:0
mem_clients_normal:13569452
mem_aof_buffer:0
mem_allocator:jemalloc-5.1.0
active_defrag_running:0
lazyfree_pending_objects:0

# Persistence
loading:0
rdb_changes_since_last_save:11488
rdb_bgsave_in_progress:0
rdb_last_save_time:1586349061
rdb_last_bgsave_status:ok
rdb_last_bgsave_time_sec:1
rdb_current_bgsave_time_sec:-1
rdb_last_cow_size:7241728
aof_enabled:0
aof_rewrite_in_progress:0
aof_rewrite_scheduled:0
aof_last_rewrite_time_sec:-1
aof_current_rewrite_time_sec:-1
aof_last_bgrewrite_status:ok
aof_last_write_status:ok
aof_last_cow_size:0

# Stats
total_connections_received:22180
total_commands_processed:63102197
instantaneous_ops_per_sec:226
total_net_input_bytes:7320953780
total_net_output_bytes:6364093769
instantaneous_input_kbps:28.00
instantaneous_output_kbps:20.55
rejected_connections:0
sync_full:0
sync_partial_ok:0
sync_partial_err:0
expired_keys:1067735
expired_stale_perc:1.10
expired_time_cap_reached_count:0
evicted_keys:0
keyspace_hits:6800789
keyspace_misses:21819994
pubsub_channels:6
pubsub_patterns:221
latest_fork_usec:3041
migrate_cached_sockets:0
slave_expires_tracked_keys:0
active_defrag_hits:0
active_defrag_misses:0
active_defrag_key_hits:0
active_defrag_key_misses:0

# Replication
role:master
connected_slaves:0
master_replid:xxx
master_replid2:xxx
master_repl_offset:xxx
second_repl_offset:-1
repl_backlog_active:0
repl_backlog_size:119537664
repl_backlog_first_byte_offset:12401
repl_backlog_histlen:6155547

# CPU
used_cpu_sys:1184.316759
used_cpu_user:1213.092153
used_cpu_sys_children:30.350496
used_cpu_user_children:353.322085

# Cluster
cluster_enabled:0

# Keyspace
db0:keys=242449,expires=242206,avg_ttl=43743079

The metricbeat config file is

metricbeat.config.modules:
  path: ${path.config}/modules.d/*.yml
  reload.enabled: true
  reload.period: 10s

setup.template.settings:
  index.number_of_shards: 1
  index.codec: best_compression

setup.dashboards.enabled: false

setup.kibana:
  host: "localhost:5601"
  username: "xxx"
  password: "xxx"

output.elasticsearch:
  hosts: ["localhost:9200"]
  username: "xxx"
  password: "xxx"

processors:
  - add_host_metadata: ~
  - add_cloud_metadata: ~
  - add_docker_metadata: ~
  - add_kubernetes_metadata: ~

monitoring.enabled: true

path.data: /var/lib/beats
path.logs: /var/log/beats

Hey @Henco, welcome to discuss :slight_smile:

I am afraid that TLS is not supported in the metricbeat redis module yet, see https://github.com/elastic/beats/issues/16522.

Hi, thanks for the feedback.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.