public class DatadogApiClient extends Object implements DatadogClient
DatadogClient.ClientType, DatadogClient.Status
Modifier and Type | Field and Description |
---|---|
static boolean |
enableValidations |
Modifier and Type | Method and Description |
---|---|
TraceWriteStrategy |
createTraceWriteStrategy() |
boolean |
equals(Object object) |
boolean |
event(DatadogEvent event)
Sends an event to the Datadog API, including the event payload.
|
void |
flushCounters()
Submit all your counters as rate with 10 seconds intervals.
|
Secret |
getApiKey() |
static DatadogClient |
getInstance(String url,
String logIntakeUrl,
String webhookIntakeUrl,
Secret apiKey)
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.
|
String |
getLogIntakeUrl() |
String |
getUrl() |
String |
getWebhookIntakeUrl() |
int |
hashCode() |
boolean |
incrementCounter(String name,
String hostname,
Map<String,Set<String>> tags)
Increment a counter for the given metrics.
|
org.datadog.jenkins.plugins.datadog.clients.DatadogApiClient.HttpMetrics |
metrics() |
boolean |
sendLogs(String payload)
Posts a given payload to the Datadog Logs Intake, using the user configured apiKey.
|
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() |
static boolean |
validateDefaultIntakeConnection(HttpClient client,
String validatedUrl,
Secret apiKey) |
public static DatadogClient getInstance(String url, String logIntakeUrl, String webhookIntakeUrl, Secret apiKey)
url
- - target urllogIntakeUrl
- - log intake urlapiKey
- - Secret api Keypublic void validateConfiguration() throws IllegalArgumentException
IllegalArgumentException
public String getUrl()
public String getLogIntakeUrl()
public String getWebhookIntakeUrl()
public Secret getApiKey()
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 org.datadog.jenkins.plugins.datadog.clients.DatadogApiClient.HttpMetrics 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)
sendLogs
in interface DatadogClient
payload
- - A String containing a specific subset of a builds metadata.public static boolean validateDefaultIntakeConnection(HttpClient client, String validatedUrl, Secret apiKey)
public TraceWriteStrategy createTraceWriteStrategy()
createTraceWriteStrategy
in interface DatadogClient
Copyright © 2016–2024. All rights reserved.