Package codes.grow.packages.datadoglogs
Class DatadogLogsClient.Builder
java.lang.Object
codes.grow.packages.datadoglogs.DatadogLogsClient.Builder
- Enclosing class:
DatadogLogsClient
Builder that configures and creates a client in one chain.
-
Method Summary
Modifier and TypeMethodDescriptionSets the Datadog API key.Sets the Datadog API key.Overrides the API base URL.Sets the Datadog application key (query API only).Sets the Datadog application key (query API only).build()Builds the configuration and the client.Sets the connect timeout.Sets the environment (env:tag).Fills unset fields from an environment reader.Adds a header.Sets hooks.Sets the default hostname.Overrides the intake base URL.Sets the logger.Sets the proxy URL.Sets the per-attempt timeout.retry(RetryPolicy retry) Sets the retry policy.Sets the default service.Sets the Datadog site.Sets theddsource.Sets the tags added to every log.tls(TlsOptions tls) Sets the TLS options.Sets the total timeout.Sets one base URL for the intake and the API.userAgentSuffix(String suffix) Sets the user agent suffix.Sets the version (version:tag).
-
Method Details
-
fromEnv
Fills unset fields from an environment reader.- Parameters:
env- reader, e.g.EnvReader.system()- Returns:
- this builder
-
apiKey
Sets the Datadog API key.- Parameters:
apiKey- key- Returns:
- this builder
-
apiKey
Sets the Datadog API key.- Parameters:
apiKey- key- Returns:
- this builder
-
appKey
Sets the Datadog application key (query API only).- Parameters:
appKey- key- Returns:
- this builder
-
appKey
Sets the Datadog application key (query API only).- Parameters:
appKey- key- Returns:
- this builder
-
site
Sets the Datadog site.- Parameters:
site- site such asdatadoghq.eu- Returns:
- this builder
-
url
Sets one base URL for the intake and the API.- Parameters:
url- URL- Returns:
- this builder
-
intakeUrl
Overrides the intake base URL.- Parameters:
intakeUrl- URL- Returns:
- this builder
-
apiUrl
Overrides the API base URL.- Parameters:
apiUrl- URL- Returns:
- this builder
-
service
Sets the default service.- Parameters:
service- service- Returns:
- this builder
-
env
Sets the environment (env:tag).- Parameters:
env- environment- Returns:
- this builder
-
version
Sets the version (version:tag).- Parameters:
version- version- Returns:
- this builder
-
tags
Sets the tags added to every log.- Parameters:
tags-key:valuestrings- Returns:
- this builder
-
hostname
Sets the default hostname.- Parameters:
hostname- host name- Returns:
- this builder
-
source
Sets theddsource.- Parameters:
source- source- Returns:
- this builder
-
connectTimeout
Sets the connect timeout.- Parameters:
d- duration- Returns:
- this builder
-
requestTimeout
Sets the per-attempt timeout.- Parameters:
d- duration- Returns:
- this builder
-
totalTimeout
Sets the total timeout.- Parameters:
d- duration- Returns:
- this builder
-
retry
Sets the retry policy.- Parameters:
retry- policy- Returns:
- this builder
-
tls
Sets the TLS options.- Parameters:
tls- options- Returns:
- this builder
-
proxy
Sets the proxy URL.- Parameters:
proxy- URL- Returns:
- this builder
-
header
Adds a header.- Parameters:
name- namevalue- value- Returns:
- this builder
-
userAgentSuffix
Sets the user agent suffix.- Parameters:
suffix- suffix- Returns:
- this builder
-
hooks
Sets hooks.- Parameters:
hooks- hooks- Returns:
- this builder
-
logger
Sets the logger.- Parameters:
logger- logger- Returns:
- this builder
-
build
Builds the configuration and the client.- Returns:
- a new client
- Throws:
ConfigException- when the configuration is invalid
-