Skip to content

Commit cb01d23

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

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

manifests/integrations/varnish.pp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
# varnishstat
77
# Path to the varnishstat binary
88
#
9+
# name
10+
# Used in the varnishstat command for the -n argument
11+
#
912
# tags
1013
# DataDog tags
1114
#
@@ -20,7 +23,8 @@
2023
#
2124
class datadog_agent::integrations::varnish (
2225
$varnishstat = '/usr/bin/varnishstat',
23-
$tags = [],
26+
$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 @name -%>
6+
name: <%= @name %>
7+
<% end -%>
58
<% if @tags and ! @tags.empty? -%>
69
tags:
710
<%- Array(@tags).each do |tag| -%>

0 commit comments

Comments
 (0)