Skip to content

Commit 2022409

Browse files
author
Cristian Juve
committed
Add -n argument in varnish integration
1 parent 8dfc579 commit 2022409

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

manifests/integrations/varnish.pp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
# varnishstat
77
# Path to the varnishstat binary
88
#
9+
# instance_name
10+
# Used in the varnishstat command for the -n argument
11+
#
912
# tags
1013
# DataDog tags
1114
#
@@ -19,8 +22,9 @@
1922
# }
2023
#
2124
class datadog_agent::integrations::varnish (
22-
$varnishstat = '/usr/bin/varnishstat',
23-
$tags = [],
25+
$varnishstat = '/usr/bin/varnishstat',
26+
$instance_name = undef,
27+
$tags = [],
2428
) inherits datadog_agent::params {
2529
include datadog_agent
2630

templates/agent-conf.d/varnish.yaml.erb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ init_config:
22

33
instances:
44
- varnishstat: <%= @varnishstat %>
5+
<% if @instance_name -%>
6+
name: <%= @instance_name %>
7+
<% end -%>
58
<% if @tags and ! @tags.empty? -%>
69
tags:
710
<%- Array(@tags).each do |tag| -%>

0 commit comments

Comments
 (0)