public class DatadogAgentClient extends Object implements DatadogClient
Modifier and Type | Class and Description |
---|---|
static class |
DatadogAgentClient.ConnectivityResult |
DatadogClient.ClientType, DatadogClient.Status
Modifier and Type | Field and Description |
---|---|
static boolean |
enableValidations |
Modifier | Constructor and Description |
---|---|
protected |
DatadogAgentClient(String hostname,
Integer port,
Integer logCollectionPort,
Integer traceCollectionPort) |
protected |
DatadogAgentClient(String hostname,
Integer port,
Integer logCollectionPort,
Integer traceCollectionPort,
long evpProxyTimeoutMillis) |
Modifier and Type | Method and Description |
---|---|
static DatadogAgentClient.ConnectivityResult |
checkConnectivity(String host,
int port) |
TraceWriteStrategy |
createTraceWriteStrategy() |
boolean |
equals(Object object) |
boolean |
event(DatadogEvent event)
Sends an event to the Datadog API, including the event payload.
|
Set<String> |
fetchAgentSupportedEndpoints()
Fetches the supported endpoints from the Trace Agent /info API
|
void |
flushCounters()
Submit all your counters as rate with 10 seconds intervals.
|
String |
getHostname() |
static DatadogClient |
getInstance(String hostname,
Integer port,
Integer logCollectionPort,
Integer traceCollectionPort)
NOTE: Use ClientFactory.getClient method to instantiate the client in the Jenkins Plugin
This method is not recommended to be used because it misses some validations.
|
Integer |
getLogCollectionPort() |
Integer |
getPort() |
Integer |
getTraceCollectionPort() |
int |
hashCode() |
boolean |
incrementCounter(String name,
String hostname,
Map<String,Set<String>> tags)
Increment a counter for the given metrics.
|
Metrics |
metrics() |
boolean |
sendLogs(String payload)
Send log message.
|
boolean |
serviceCheck(String name,
DatadogClient.Status status,
String hostname,
Map<String,Set<String>> tags)
Sends a service check to the Datadog API, including the check name, and status.
|
void |
validateConfiguration() |
protected DatadogAgentClient(String hostname, Integer port, Integer logCollectionPort, Integer traceCollectionPort)
public static DatadogClient getInstance(String hostname, Integer port, Integer logCollectionPort, Integer traceCollectionPort)
hostname
- - target hostnameport
- - target portlogCollectionPort
- - target log collection porttraceCollectionPort
- - target trace collection portpublic static DatadogAgentClient.ConnectivityResult checkConnectivity(String host, int port)
public void validateConfiguration() throws IllegalArgumentException
IllegalArgumentException
public Set<String> fetchAgentSupportedEndpoints()
public String getHostname()
public Integer getPort()
public Integer getLogCollectionPort()
public Integer getTraceCollectionPort()
public boolean event(DatadogEvent event)
DatadogClient
event
in interface DatadogClient
event
- - a DatadogEvent objectpublic boolean incrementCounter(String name, String hostname, Map<String,Set<String>> tags)
DatadogClient
incrementCounter
in interface DatadogClient
name
- - metric namehostname
- - metric hostnametags
- - metric tagspublic void flushCounters()
DatadogClient
flushCounters
in interface DatadogClient
public Metrics metrics()
metrics
in interface DatadogClient
public boolean serviceCheck(String name, DatadogClient.Status status, String hostname, Map<String,Set<String>> tags)
DatadogClient
serviceCheck
in interface DatadogClient
name
- - A String with the name of the service check to record.status
- - An Status with the status code to record for this service check.hostname
- - A String with the hostname to submit.tags
- - A Map containing the tags to submit.public boolean sendLogs(String payload)
DatadogClient
sendLogs
in interface DatadogClient
payload
- log payload to submit JSON object as Stringpublic TraceWriteStrategy createTraceWriteStrategy()
createTraceWriteStrategy
in interface DatadogClient
Copyright © 2016–2024. All rights reserved.