Skip to content

Commit b1dffa6

Browse files
authored
[tomcat] jmx_url support + reports regex extraction should use undef (Thanks @evansj) (DataDog#482)
* Add jmx_url parameter to tomcat integration * Fix tags indenting * Fix hostname_extraction_regex, should be undef * Fix more nil / undef confusion * [reports] parameter typo - missing comma
1 parent bf26613 commit b1dffa6

5 files changed

Lines changed: 13 additions & 7 deletions

File tree

manifests/init.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@
238238
$service_ensure = 'running',
239239
$service_enable = true,
240240
$manage_repo = true,
241-
$hostname_extraction_regex = nil,
241+
$hostname_extraction_regex = undef,
242242
$hostname_fqdn = false,
243243
$dogstatsd_port = 8125,
244244
$dogstatsd_socket = '',

manifests/integrations/tomcat.pp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
# The host tomcat is running on. Defaults to 'localhost'
88
# $port
99
# The JMX port.
10+
# $jmx_url
11+
# The JMX URL.
1012
# $username
1113
# The username for connecting to the running JVM. Optional.
1214
# $password
@@ -29,6 +31,7 @@
2931
class datadog_agent::integrations::tomcat(
3032
$hostname = 'localhost',
3133
$port = 7199,
34+
$jmx_url = undef,
3235
$username = undef,
3336
$password = undef,
3437
$java_bin_path = undef,

manifests/reports.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
$api_key,
1818
$puppetmaster_user,
1919
$dogapi_version,
20-
$hostname_extraction_regex = nil,
20+
$hostname_extraction_regex = undef,
2121
$datadog_site = 'datadoghq.com',
2222
) {
2323

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
instances:
44
- host: <%= @hostname %>
5+
<% if @jmx_url -%>
6+
jmx_url: "<%= @jmx_url %>"
7+
<% end -%>
58
port: <%= @port %>
69
<% if @username -%>
710
user: <%= @username %>
@@ -18,10 +21,10 @@ instances:
1821
trust_store_password: <%= @trust_store_password %>
1922
<% end -%>
2023
<% if @tags and ! @tags.empty? -%>
21-
tags:
22-
<%- @tags.each do |key, val| -%>
23-
<%= "#{key}: #{val}" %>
24-
<%- end -%>
24+
tags:
25+
<%- @tags.each do |key, val| -%>
26+
<%= "#{key}: #{val}" %>
27+
<%- end -%>
2528
<% end -%>
2629

2730

templates/datadog-reports.yaml.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
---
44
:datadog_api_key: '<%= @api_key %>'
55
:api_url: api.<%= @datadog_site %>
6-
<% if !@hostname_extraction_regex.nil? -%>
6+
<% if @hostname_extraction_regex -%>
77
:hostname_extraction_regex: '<%= @hostname_extraction_regex %>'
88
<% end -%>

0 commit comments

Comments
 (0)