public class NonBlockingStatsDClientBuilder extends Object implements Cloneable
| Modifier and Type | Field and Description |
|---|---|
Callable<SocketAddress> |
addressLookup
Yields the IP address and socket of the StatsD server.
|
int |
aggregationFlushInterval
Aggregation flush interval, in milliseconds.
|
int |
aggregationShards |
boolean |
blocking
Blocking or non-blocking implementation for statsd message queue.
|
int |
bufferPoolSize
The size for the network buffer pool.
|
int |
connectionTimeout
The timeout in milliseconds for connecting to the StatsD server.
|
String[] |
constantTags
Tags to be added to all content sent.
|
String |
containerID
Allows passing the container ID, this will be used by the Agent to enrich metrics with
container tags.
|
boolean |
enableAggregation |
boolean |
enableTelemetry
Enable sending client telemetry.
|
String |
entityID
The entity id value used with an internal tag for tracking client entity.
|
StatsDClientErrorHandler |
errorHandler
Handler to use when an exception occurs during usage, may be null to indicate noop.
|
String |
hostname |
int |
maxPacketSizeBytes
The maximum number of bytes for a message that can be sent.
|
String |
namedPipe |
boolean |
originDetectionEnabled
Enable/disable the client origin detection.
|
int |
port |
String |
prefix
The prefix to apply to keys sent via this client.
|
int |
processorWorkers
The number of processor worker threads assembling buffers for submission.
|
int |
queueSize
The maximum amount of unprocessed messages in the queue.
|
int |
senderWorkers
The number of sender worker threads submitting buffers to the socket.
|
int |
socketBufferSize
The socket buffer size in bytes.
|
TagsCardinality |
tagsCardinality |
Callable<SocketAddress> |
telemetryAddressLookup
Yields the IP address and socket of the StatsD telemetry server destination.
|
int |
telemetryFlushInterval
Telemetry flush interval, in milliseconds.
|
String |
telemetryHostname |
int |
telemetryPort |
ThreadFactory |
threadFactory |
int |
timeout
The timeout in milliseconds for blocking operations.
|
| Constructor and Description |
|---|
NonBlockingStatsDClientBuilder() |
| Modifier and Type | Method and Description |
|---|---|
NonBlockingStatsDClientBuilder |
address(String address) |
NonBlockingStatsDClientBuilder |
addressLookup(Callable<SocketAddress> val)
Yields the IP address and socket of the StatsD server.
|
NonBlockingStatsDClientBuilder |
aggregationFlushInterval(int val)
Aggregation flush interval, in milliseconds.
|
NonBlockingStatsDClientBuilder |
aggregationShards(int val) |
NonBlockingStatsDClientBuilder |
blocking(boolean val)
Blocking or non-blocking implementation for statsd message queue.
|
NonBlockingStatsDClientBuilder |
bufferPoolSize(int val)
The size for the network buffer pool.
|
NonBlockingStatsDClient |
build()
NonBlockingStatsDClient factory method.
|
DirectStatsDClient |
buildDirectStatsDClient()
DirectStatsDClient factory method. |
NonBlockingStatsDClientBuilder |
connectionTimeout(int val)
The timeout in milliseconds for connecting to the StatsD server.
|
NonBlockingStatsDClientBuilder |
constantTags(String... val)
Tags to be added to all content sent.
|
NonBlockingStatsDClientBuilder |
containerID(String val)
Allows passing the container ID, this will be used by the Agent to enrich metrics with
container tags.
|
NonBlockingStatsDClientBuilder |
enableAggregation(boolean val) |
NonBlockingStatsDClientBuilder |
enableTelemetry(boolean val)
Enable sending client telemetry.
|
NonBlockingStatsDClientBuilder |
entityID(String val)
The entity id value used with an internal tag for tracking client entity.
|
NonBlockingStatsDClientBuilder |
errorHandler(StatsDClientErrorHandler val)
Handler to use when an exception occurs during usage, may be null to indicate noop.
|
NonBlockingStatsDClientBuilder |
hostname(String val) |
NonBlockingStatsDClientBuilder |
maxPacketSizeBytes(int val) |
NonBlockingStatsDClientBuilder |
namedPipe(String val) |
NonBlockingStatsDClientBuilder |
originDetectionEnabled(boolean val)
Enable/disable the client origin detection.
|
NonBlockingStatsDClientBuilder |
port(int val) |
NonBlockingStatsDClientBuilder |
prefix(String val)
The prefix to apply to keys sent via this client.
|
NonBlockingStatsDClientBuilder |
processorWorkers(int val)
The number of processor worker threads assembling buffers for submission.
|
NonBlockingStatsDClientBuilder |
queueSize(int val)
The maximum amount of unprocessed messages in the queue.
|
protected NonBlockingStatsDClientBuilder |
resolve()
Creates a copy of this builder with any implicit elements resolved.
|
NonBlockingStatsDClientBuilder |
senderWorkers(int val)
The number of sender worker threads submitting buffers to the socket.
|
NonBlockingStatsDClientBuilder |
socketBufferSize(int val)
The socket buffer size in bytes.
|
static Callable<SocketAddress> |
staticAddressResolution(String hostname,
int port)
Lookup the address for the given host name and cache the result.
|
protected static Callable<SocketAddress> |
staticNamedPipeResolution(String namedPipe) |
protected static Callable<SocketAddress> |
staticUnixResolution(String path,
UnixSocketAddressWithTransport.TransportType transportType) |
NonBlockingStatsDClientBuilder |
tagsCardinality(TagsCardinality cardinality)
Request that all metrics from this client to be enriched to specified tag cardinality.
|
NonBlockingStatsDClientBuilder |
telemetryAddress(String address) |
NonBlockingStatsDClientBuilder |
telemetryAddressLookup(Callable<SocketAddress> val)
Yields the IP address and socket of the StatsD telemetry server destination.
|
NonBlockingStatsDClientBuilder |
telemetryFlushInterval(int val)
Telemetry flush interval, in milliseconds.
|
NonBlockingStatsDClientBuilder |
telemetryHostname(String val) |
NonBlockingStatsDClientBuilder |
telemetryPort(int val) |
NonBlockingStatsDClientBuilder |
threadFactory(ThreadFactory val) |
NonBlockingStatsDClientBuilder |
timeout(int val)
The timeout in milliseconds for blocking operations.
|
static Callable<SocketAddress> |
volatileAddressResolution(String hostname,
int port)
Create dynamic lookup for the given host name and port.
|
public int maxPacketSizeBytes
public int port
public int telemetryPort
public int queueSize
public int timeout
public int bufferPoolSize
public int socketBufferSize
public int processorWorkers
public int senderWorkers
public boolean blocking
public boolean enableTelemetry
public boolean enableAggregation
public int telemetryFlushInterval
public int aggregationFlushInterval
public int aggregationShards
public boolean originDetectionEnabled
This feature requires Datadog Agent version >=6.35.0 && <7.0.0 or Agent versions >=7.35.0. When enabled, the client tries to discover its container ID and sends it to the Agent to enrich the metrics with container tags. Origin detection can be disabled by configuring the environment variabe DD_ORIGIN_DETECTION_ENABLED=false The client tries to read the container ID by parsing the file /proc/self/cgroup. This is not supported on Windows.
public int connectionTimeout
It is also used to detect if a connection is still alive and re-establish a new one if needed.
public Callable<SocketAddress> addressLookup
public Callable<SocketAddress> telemetryAddressLookup
public String hostname
public String telemetryHostname
public String namedPipe
public String prefix
public String entityID
If null the client default the value with the environment variable "DD_ENTITY_ID". If the environment variable is not defined, the internal tag is not added.
public String[] constantTags
public String containerID
This feature requires Datadog Agent version >=6.35.0 && <7.0.0 or Agent versions >=7.35.0. When configured, the provided container ID is prioritized over the container ID discovered via Origin Detection. When entityID or DD_ENTITY_ID are set, this value is ignored.
public StatsDClientErrorHandler errorHandler
public ThreadFactory threadFactory
public TagsCardinality tagsCardinality
public NonBlockingStatsDClientBuilder port(int val)
public NonBlockingStatsDClientBuilder telemetryPort(int val)
public NonBlockingStatsDClientBuilder queueSize(int val)
public NonBlockingStatsDClientBuilder timeout(int val)
public NonBlockingStatsDClientBuilder connectionTimeout(int val)
It is also used to detect if a connection is still alive and re-establish a new one if needed.
public NonBlockingStatsDClientBuilder bufferPoolSize(int val)
public NonBlockingStatsDClientBuilder socketBufferSize(int val)
public NonBlockingStatsDClientBuilder maxPacketSizeBytes(int val)
public NonBlockingStatsDClientBuilder processorWorkers(int val)
public NonBlockingStatsDClientBuilder senderWorkers(int val)
public NonBlockingStatsDClientBuilder blocking(boolean val)
public NonBlockingStatsDClientBuilder addressLookup(Callable<SocketAddress> val)
public NonBlockingStatsDClientBuilder telemetryAddressLookup(Callable<SocketAddress> val)
public NonBlockingStatsDClientBuilder hostname(String val)
public NonBlockingStatsDClientBuilder telemetryHostname(String val)
public NonBlockingStatsDClientBuilder namedPipe(String val)
public NonBlockingStatsDClientBuilder address(String address)
public NonBlockingStatsDClientBuilder telemetryAddress(String address)
public NonBlockingStatsDClientBuilder prefix(String val)
public NonBlockingStatsDClientBuilder entityID(String val)
If null the client default the value with the environment variable "DD_ENTITY_ID". If the environment variable is not defined, the internal tag is not added.
public NonBlockingStatsDClientBuilder constantTags(String... val)
public NonBlockingStatsDClientBuilder errorHandler(StatsDClientErrorHandler val)
public NonBlockingStatsDClientBuilder enableTelemetry(boolean val)
public NonBlockingStatsDClientBuilder enableAggregation(boolean val)
public NonBlockingStatsDClientBuilder telemetryFlushInterval(int val)
public NonBlockingStatsDClientBuilder aggregationFlushInterval(int val)
public NonBlockingStatsDClientBuilder aggregationShards(int val)
public NonBlockingStatsDClientBuilder threadFactory(ThreadFactory val)
public NonBlockingStatsDClientBuilder containerID(String val)
This feature requires Datadog Agent version >=6.35.0 && <7.0.0 or Agent versions >=7.35.0. When configured, the provided container ID is prioritized over the container ID discovered via Origin Detection. When entityID or DD_ENTITY_ID are set, this value is ignored.
public NonBlockingStatsDClientBuilder originDetectionEnabled(boolean val)
This feature requires Datadog Agent version >=6.35.0 && <7.0.0 or Agent versions >7.35.0. When enabled, the client tries to discover its container ID and sends it to the Agent to enrich the metrics with container tags. Origin detection can be disabled by configuring the environment variabe DD_ORIGIN_DETECTION_ENABLED=false The client tries to read the container ID by parsing the file /proc/self/cgroup. This is not supported on Windows. The client prioritizes the value passed via or entityID or DD_ENTITY_ID (if set) over the container ID.
public NonBlockingStatsDClientBuilder tagsCardinality(TagsCardinality cardinality)
public NonBlockingStatsDClient build() throws StatsDClientException
StatsDClientExceptionpublic DirectStatsDClient buildDirectStatsDClient() throws StatsDClientException
DirectStatsDClient factory method.
It is an experimental extension of StatsDClient that allows for direct access to
some dogstatsd features. It is not recommended to use this client in production.
StatsDClientExceptionDirectStatsDClientprotected NonBlockingStatsDClientBuilder resolve()
public static Callable<SocketAddress> volatileAddressResolution(String hostname, int port)
hostname - the host name of the targeted StatsD server.port - the port of the targeted StatsD server.public static Callable<SocketAddress> staticAddressResolution(String hostname, int port) throws Exception
hostname - the host name of the targeted StatsD serverport - the port of the targeted StatsD serverException - if the lookup fails, i.e. UnknownHostExceptionprotected static Callable<SocketAddress> staticNamedPipeResolution(String namedPipe)
protected static Callable<SocketAddress> staticUnixResolution(String path, UnixSocketAddressWithTransport.TransportType transportType)
Copyright © 2025. All rights reserved.