Skip to content

Commit ecc3ec0

Browse files
olivielpeautruthbk
authored andcommitted
[http_check] Add no_proxy parameter (#309)
1 parent 2f77fcc commit ecc3ec0

3 files changed

Lines changed: 20 additions & 6 deletions

File tree

manifests/integrations/http_check.pp

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,23 +48,29 @@
4848
# problematic SSL server certificates. To maintain backwards
4949
# compatibility this defaults to false.
5050
#
51-
# skip_event
51+
# skip_event
5252
# The (optional) skip_event parameter will instruct the check to not
5353
# create any event to avoid duplicates with a server side service check.
5454
# This defaults to True because this is being deprecated.
5555
# (See https://github.com/DataDog/dd-agent/blob/master/checks/network_checks.py#L178-L180)
5656
#
57-
# check_certificate_expiration
58-
# days_warning
59-
# days_critical
57+
# no_proxy
58+
# The (optional) no_proxy parameter would bypass any proxy settings enabled
59+
# and attempt to reach the the URL directly.
60+
# If no proxy is defined at any level, this flag bears no effect.
61+
# Defaults to False.
62+
#
63+
# check_certificate_expiration
64+
# days_warning
65+
# days_critical
6066
# The (optional) check_certificate_expiration will instruct the check
6167
# to create a service check that checks the expiration of the
6268
# ssl certificate. Allow for a warning to occur when x days are
6369
# left in the certificate, and alternatively raise a critical
6470
# warning if the certificate is y days from the expiration date.
6571
# The SSL certificate will always be validated for this additional
6672
# service check regardless of the value of disable_ssl_validation
67-
#
73+
#
6874
# headers
6975
# The (optional) headers parameter allows you to send extra headers
7076
# with the request. This is useful for explicitly specifying the host
@@ -141,6 +147,7 @@
141147
$collect_response_time = true,
142148
$disable_ssl_validation = false,
143149
$skip_event = true,
150+
$no_proxy = false,
144151
$check_certificate_expiration = undef,
145152
$days_warning = undef,
146153
$days_critical = undef,
@@ -165,6 +172,7 @@
165172
'collect_response_time' => $collect_response_time,
166173
'disable_ssl_validation' => $disable_ssl_validation,
167174
'skip_event' => $skip_event,
175+
'no_proxy' => $no_proxy,
168176
'check_certificate_expiration' => $check_certificate_expiration,
169177
'days_warning' => $days_warning,
170178
'days_critical' => $days_critical,

spec/classes/datadog_agent_integrations_http_check_spec.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,10 @@
3333
it { should contain_file(conf_file).without_content(%r{collect_response_time: true}) }
3434
it { should contain_file(conf_file).without_content(%r{disable_ssl_validation: false}) }
3535
it { should contain_file(conf_file).without_content(%r{skip_event: }) }
36+
it { should contain_file(conf_file).without_content(%r{no_proxy: }) }
3637
it { should contain_file(conf_file).without_content(%r{check_certificate_expiration: }) }
3738
it { should contain_file(conf_file).without_content(%r{days_warning: }) }
38-
it { should contain_file(conf_file).without_content(%r{days_critical: }) }
39+
it { should contain_file(conf_file).without_content(%r{days_critical: }) }
3940
it { should contain_file(conf_file).without_content(%r{headers: }) }
4041
it { should contain_file(conf_file).without_content(%r{tags: }) }
4142
end
@@ -54,6 +55,7 @@
5455
collect_response_time: false,
5556
disable_ssl_validation: true,
5657
skip_event: true,
58+
no_proxy: true,
5759
check_certificate_expiration: true,
5860
days_warning: 14,
5961
days_critical: 7,
@@ -71,6 +73,7 @@
7173
it { should contain_file(conf_file).without_content(%r{collect_response_time: true}) }
7274
it { should contain_file(conf_file).with_content(%r{disable_ssl_validation: true}) }
7375
it { should contain_file(conf_file).with_content(%r{skip_event: true}) }
76+
it { should contain_file(conf_file).with_content(%r{no_proxy: true}) }
7477
it { should contain_file(conf_file).with_content(%r{check_certificate_expiration: true}) }
7578
it { should contain_file(conf_file).with_content(%r{days_warning: 14}) }
7679
it { should contain_file(conf_file).with_content(%r{days_critical: 7}) }

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ instances:
3434
<% if instance['skip_event'] -%>
3535
skip_event: <%= instance['skip_event'] %>
3636
<% end -%>
37+
<% if instance['no_proxy'] -%>
38+
no_proxy: <%= instance['no_proxy'] %>
39+
<% end -%>
3740
<% if instance['check_certificate_expiration'] -%>
3841
check_certificate_expiration: <%= instance['check_certificate_expiration'] %>
3942
<% if instance['check_certificate_expiration'] == true -%>

0 commit comments

Comments
 (0)