Skip to content

Commit

Permalink
Add http templates for integrations using http wrapper (#7938)
Browse files Browse the repository at this point in the history
  • Loading branch information
yzhan289 authored Nov 9, 2020
1 parent e8c8af6 commit b92cdc3
Show file tree
Hide file tree
Showing 4 changed files with 345 additions and 1 deletion.
1 change: 1 addition & 0 deletions harbor/assets/configuration/spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ files:
options:
- template: init_config
options:
- template: init_config/http
- template: init_config/default
- template: instances
options:
Expand Down
32 changes: 32 additions & 0 deletions harbor/datadog_checks/harbor/data/conf.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,38 @@
#
init_config:

## @param proxy - mapping - optional
## Set HTTP or HTTPS proxies for all instances. Use the `no_proxy` list
## to specify hosts that must bypass proxies.
##
## The SOCKS protocol is also supported like so:
##
## socks5://user:pass@host:port
##
## Using the scheme `socks5` causes the DNS resolution to happen on the
## client, rather than on the proxy server. This is in line with `curl`,
## which uses the scheme to decide whether to do the DNS resolution on
## the client or proxy. If you want to resolve the domains on the proxy
## server, use `socks5h` as the scheme.
#
# proxy:
# http: http://<PROXY_SERVER_FOR_HTTP>:<PORT>
# https: https://<PROXY_SERVER_FOR_HTTPS>:<PORT>
# no_proxy:
# - <HOSTNAME_1>
# - <HOSTNAME_2>

## @param skip_proxy - boolean - optional - default: false
## If set to `true`, this makes the check bypass any proxy
## settings enabled and attempt to reach services directly.
#
# skip_proxy: false

## @param timeout - number - optional - default: 10
## The timeout for connecting to services.
#
# timeout: 10

## @param service - string - optional
## Attach the tag `service:<SERVICE>` to every metric, event, and service check emitted by this integration.
##
Expand Down
6 changes: 6 additions & 0 deletions hazelcast/assets/configuration/spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ files:
- template: init_config/jmx
overrides:
is_jmx.value.example: false
- template: init_config/http
- template: instances
options:
- name: mc_health_check_endpoint
Expand All @@ -33,6 +34,11 @@ files:
port.display_priority: 9
port.description: Hazelcast or Hazelcast Management Center port with which to connect.
port.value.example: 1099
password.description: |
Password to use when connecting to JMX or HTTP depending on which is enabled.
- template: instances/http
overrides:
password.hidden: true
- template: logs
example:
- type: file
Expand Down
307 changes: 306 additions & 1 deletion hazelcast/datadog_checks/hazelcast/data/conf.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,38 @@ init_config:
#
# service: <SERVICE>

## @param proxy - mapping - optional
## Set HTTP or HTTPS proxies for all instances. Use the `no_proxy` list
## to specify hosts that must bypass proxies.
##
## The SOCKS protocol is also supported like so:
##
## socks5://user:pass@host:port
##
## Using the scheme `socks5` causes the DNS resolution to happen on the
## client, rather than on the proxy server. This is in line with `curl`,
## which uses the scheme to decide whether to do the DNS resolution on
## the client or proxy. If you want to resolve the domains on the proxy
## server, use `socks5h` as the scheme.
#
# proxy:
# http: http://<PROXY_SERVER_FOR_HTTP>:<PORT>
# https: https://<PROXY_SERVER_FOR_HTTPS>:<PORT>
# no_proxy:
# - <HOSTNAME_1>
# - <HOSTNAME_2>

## @param skip_proxy - boolean - optional - default: false
## If set to `true`, this makes the check bypass any proxy
## settings enabled and attempt to reach services directly.
#
# skip_proxy: false

## @param timeout - number - optional - default: 10
## The timeout for connecting to services.
#
# timeout: 10

## Every instance is scheduled independent of the others.
#
instances:
Expand Down Expand Up @@ -85,7 +117,7 @@ instances:
# user: <USER>

## @param password - string - optional
## Password to use when connecting to JMX.
## Password to use when connecting to JMX or HTTP depending on which is enabled.
#
# password: <PASSWORD>

Expand Down Expand Up @@ -188,6 +220,279 @@ instances:
#
# empty_default_hostname: false

## @param proxy - mapping - optional
## This overrides the `proxy` setting in `init_config`.
##
## Set HTTP or HTTPS proxies for this instance. Use the `no_proxy` list
## to specify hosts that must bypass proxies.
##
## The SOCKS protocol is also supported, for example:
##
## socks5://user:pass@host:port
##
## Using the scheme `socks5` causes the DNS resolution to happen on the
## client, rather than on the proxy server. This is in line with `curl`,
## which uses the scheme to decide whether to do the DNS resolution on
## the client or proxy. If you want to resolve the domains on the proxy
## server, use `socks5h` as the scheme.
#
# proxy:
# http: http://<PROXY_SERVER_FOR_HTTP>:<PORT>
# https: https://<PROXY_SERVER_FOR_HTTPS>:<PORT>
# no_proxy:
# - <HOSTNAME_1>
# - <HOSTNAME_2>

## @param skip_proxy - boolean - optional - default: false
## This overrides the `skip_proxy` setting in `init_config`.
##
## If set to `true`, this makes the check bypass any proxy
## settings enabled and attempt to reach services directly.
#
# skip_proxy: false

## @param auth_type - string - optional - default: basic
## The type of authentication to use. The available types (and related options) are:
##
## - basic
## |__ username
## |__ password
## |__ use_legacy_auth_encoding
## - digest
## |__ username
## |__ password
## - ntlm
## |__ ntlm_domain
## |__ password
## - kerberos
## |__ kerberos_auth
## |__ kerberos_cache
## |__ kerberos_delegate
## |__ kerberos_force_initiate
## |__ kerberos_hostname
## |__ kerberos_keytab
## |__ kerberos_principal
## - aws
## |__ aws_region
## |__ aws_host
## |__ aws_service
##
## The `aws` auth type relies on boto3 to automatically gather AWS credentials, for example: from `.aws/credentials`.
## Details: https://boto3.amazonaws.com/v1/documentation/api/latest/guide/configuration.html#configuring-credentials
#
# auth_type: basic

## @param use_legacy_auth_encoding - boolean - optional - default: true
## When `auth_type` is set to `basic`, this determines whether to encode as `latin1` rather than `utf-8`.
#
# use_legacy_auth_encoding: true

## @param username - string - optional
## The username to use if services are behind basic or digest auth.
#
# username: <USERNAME>

## @param ntlm_domain - string - optional
## If your services use NTLM authentication, specify
## the domain used in the check. For NTLM Auth, append
## the username to domain, not as the `username` parameter.
#
# ntlm_domain: <NTLM_DOMAIN>\<USERNAME>

## @param kerberos_auth - string - optional - default: disabled
## If your services use Kerberos authentication, you can specify the Kerberos
## strategy to use between:
##
## - required
## - optional
## - disabled
##
## See https://github.com/requests/requests-kerberos#mutual-authentication
#
# kerberos_auth: disabled

## @param kerberos_cache - string - optional
## Sets the KRB5CCNAME environment variable.
## It should point to a credential cache with a valid TGT.
#
# kerberos_cache: <KERBEROS_CACHE>

## @param kerberos_delegate - boolean - optional - default: false
## Set to `true` to enable Kerberos delegation of credentials to a server that requests delegation.
##
## See https://github.com/requests/requests-kerberos#delegation
#
# kerberos_delegate: false

## @param kerberos_force_initiate - boolean - optional - default: false
## Set to `true` to preemptively initiate the Kerberos GSS exchange and
## present a Kerberos ticket on the initial request (and all subsequent).
##
## See https://github.com/requests/requests-kerberos#preemptive-authentication
#
# kerberos_force_initiate: false

## @param kerberos_hostname - string - optional
## Override the hostname used for the Kerberos GSS exchange if its DNS name doesn't
## match its Kerberos hostname, for example: behind a content switch or load balancer.
##
## See https://github.com/requests/requests-kerberos#hostname-override
#
# kerberos_hostname: <KERBEROS_HOSTNAME>

## @param kerberos_principal - string - optional
## Set an explicit principal, to force Kerberos to look for a
## matching credential cache for the named user.
##
## See https://github.com/requests/requests-kerberos#explicit-principal
#
# kerberos_principal: <KERBEROS_PRINCIPAL>

## @param kerberos_keytab - string - optional
## Set the path to your Kerberos key tab file.
#
# kerberos_keytab: <KEYTAB_FILE_PATH>

## @param auth_token - mapping - optional
## This allows for the use of authentication information from dynamic sources.
## Both a reader and writer must be configured.
##
## The available readers are:
##
## - type: file
## path (required): The absolute path for the file to read from.
## pattern: A regular expression pattern with a single capture group used to find the
## token rather than using the entire file, for example: Your secret is (.+)
##
## The available writers are:
##
## - type: header
## name (required): The name of the field, for example: Authorization
## value: The template value, for example `Bearer <TOKEN>`. The default is: <TOKEN>
## placeholder: The substring in `value` to replace by the token, defaults to: <TOKEN>
#
# auth_token:
# reader:
# type: <READER_TYPE>
# <OPTION_1>: <VALUE_1>
# <OPTION_2>: <VALUE_2>
# writer:
# type: <WRITER_TYPE>
# <OPTION_1>: <VALUE_1>
# <OPTION_2>: <VALUE_2>

## @param aws_region - string - optional
## If your services require AWS Signature Version 4 signing, set the region.
##
## See https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html
#
# aws_region: <AWS_REGION>

## @param aws_host - string - optional
## If your services require AWS Signature Version 4 signing, set the host.
##
## Note: This setting is not necessary for official integrations.
##
## See https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html
#
# aws_host: <AWS_HOST>

## @param aws_service - string - optional
## If your services require AWS Signature Version 4 signing, set the service code. For a list
## of available service codes, see https://docs.aws.amazon.com/general/latest/gr/rande.html
##
## Note: This setting is not necessary for official integrations.
##
## See https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html
#
# aws_service: <AWS_SERVICE>

## @param tls_verify - boolean - optional - default: true
## Instructs the check to validate the TLS certificate of services.
#
# tls_verify: true

## @param tls_use_host_header - boolean - optional - default: false
## If a `Host` header is set, this enables its use for SNI (matching against the TLS certificate CN or SAN).
#
# tls_use_host_header: false

## @param tls_ignore_warning - boolean - optional - default: false
## If `tls_verify` is disabled, security warnings are logged by the check.
## Disable those by setting `tls_ignore_warning` to true.
##
## Note: `tls_ignore_warning` set to true is currently only reliable if used by one instance of one integration.
## If enabled for multiple instances, spurious warnings might still appear even if `tls_ignore_warning` is set
## to true.
#
# tls_ignore_warning: false

## @param tls_cert - string - optional
## The path to a single file in PEM format containing a certificate as well as any
## number of CA certificates needed to establish the certificate's authenticity for
## use when connecting to services. It may also contain an unencrypted private key to use.
#
# tls_cert: <CERT_PATH>

## @param tls_private_key - string - optional
## The unencrypted private key to use for `tls_cert` when connecting to services. This is
## required if `tls_cert` is set and it does not already contain a private key.
#
# tls_private_key: <PRIVATE_KEY_PATH>

## @param tls_ca_cert - string - optional
## The path to a file of concatenated CA certificates in PEM format or a directory
## containing several CA certificates in PEM format. If a directory, the directory
## must have been processed using the c_rehash utility supplied with OpenSSL. See:
## https://www.openssl.org/docs/manmaster/man3/SSL_CTX_load_verify_locations.html
#
# tls_ca_cert: <CA_CERT_PATH>

## @param headers - mapping - optional
## The headers parameter allows you to send specific headers with every request.
## You can use it for explicitly specifying the host header or adding headers for
## authorization purposes.
##
## This overrides any default headers.
#
# headers:
# Host: <ALTERNATIVE_HOSTNAME>
# X-Auth-Token: <AUTH_TOKEN>

## @param extra_headers - mapping - optional
## Additional headers to send with every request.
#
# extra_headers:
# Host: <ALTERNATIVE_HOSTNAME>
# X-Auth-Token: <AUTH_TOKEN>

## @param timeout - number - optional - default: 10
## The timeout for accessing services.
##
## This overrides the `timeout` setting in `init_config`.
#
# timeout: 10

## @param connect_timeout - number - optional
## The connect timeout for accessing services. Defaults to `timeout`.
#
# connect_timeout: <CONNECT_TIMEOUT>

## @param read_timeout - number - optional
## The read timeout for accessing services. Defaults to `timeout`.
#
# read_timeout: <READ_TIMEOUT>

## @param log_requests - boolean - optional - default: false
## Whether or not to debug log the HTTP(S) requests made, including the method and URL.
#
# log_requests: false

## @param persist_connections - boolean - optional - default: false
## Whether or not to persist cookies and use connection pooling for increased performance.
#
# persist_connections: false

## Log Section
##
## type - required - Type of log input source (tcp / udp / file / windows_event)
Expand Down

0 comments on commit b92cdc3

Please sign in to comment.