Package codes.grow.packages.datadogapm
Class DatadogApmClient.Builder
java.lang.Object
codes.grow.packages.datadogapm.DatadogApmClient.Builder
- Enclosing class:
DatadogApmClient
Builder that configures and creates a client in one chain.
-
Method Summary
Modifier and TypeMethodDescriptionSets the Datadog API key.Sets the Datadog API key.Sets the query API base URL.Sets the Datadog application key.Sets the Datadog application key.build()Builds the configuration and the client.Sets the connect timeout.environment(String environment) Sets the environment.Fills unset fields from an environment reader.Adds a header.Sets hooks.Sets the logger.otlpEndpoint(String endpoint) Sets the OTLP endpoint of the Agent.protocol(TracingConfig.Protocol protocol) Sets the OTLP protocol.Sets the proxy URL.Sets the per-attempt timeout.retry(RetryPolicy retry) Sets the retry policy.serviceName(String serviceName) Sets the service name.serviceVersion(String serviceVersion) Sets the service version.Sets the Datadog site.Adds a tag (extra resource attribute).tls(TlsOptions tls) Sets the TLS options.Sets the total timeout.Sets the Agent trace intake URL.userAgentSuffix(String suffix) Sets the user agent suffix.
-
Method Details
-
fromEnv
Fills unset fields from an environment reader.- Parameters:
env- reader, e.g.EnvReader.system()- Returns:
- this builder
-
url
Sets the Agent trace intake URL.- Parameters:
url- URL- Returns:
- this builder
-
otlpEndpoint
Sets the OTLP endpoint of the Agent.- Parameters:
endpoint- URL- Returns:
- this builder
-
protocol
Sets the OTLP protocol.- Parameters:
protocol- protocol- Returns:
- this builder
-
serviceName
Sets the service name.- Parameters:
serviceName- name- Returns:
- this builder
-
serviceVersion
Sets the service version.- Parameters:
serviceVersion- version- Returns:
- this builder
-
environment
Sets the environment.- Parameters:
environment- environment- Returns:
- this builder
-
tag
Adds a tag (extra resource attribute).- Parameters:
key- keyvalue- value- 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.- Parameters:
appKey- key- Returns:
- this builder
-
appKey
Sets the Datadog application key.- Parameters:
appKey- key- Returns:
- this builder
-
site
Sets the Datadog site.- Parameters:
site- site- Returns:
- this builder
-
apiUrl
Sets the query API base URL.- Parameters:
apiUrl- URL- 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
-