Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[redis] support multiple ports for a single host #169

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions manifests/integrations/redis.pp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
# The host redis is running on
# $password
# The redis password (optional)
# $port
# The redis port
# $ports
# Array of redis ports
# $slowlog_max_len
# The max length of the slow-query log (optional)
# $tags
Expand All @@ -26,14 +26,14 @@
class datadog_agent::integrations::redis(
$host = 'localhost',
$password = '',
$port = 6379,
$ports = [ 6379 ],
$slowlog_max_len = '',
$tags = [],
$keys = [],
$warn_on_missing_keys = true,
) inherits datadog_agent::params {

validate_re($port, '^\d+$')
validate_array($ports)
validate_array($tags)
validate_array($keys)
validate_bool($warn_on_missing_keys)
Expand Down
4 changes: 3 additions & 1 deletion templates/agent-conf.d/redisdb.yaml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
init_config:

instances:
<% @ports.each do |port| -%>
- host: <%= @host %>
port: <%= @port %>
port: <%= port %>
warn_on_missing_keys: <%= @warn_on_missing_keys %>
<% if @password.empty? %># <%end %>password: <%= @password %>
# unix_socket_path: /var/run/redis/redis.sock # optional, can be used in lieu of host/port
Expand All @@ -23,3 +24,4 @@ instances:
- <%= key %>
<% end -%>
<% end -%>
<% end -%>