Package org.apache.beam.sdk.io.datadog
Class DatadogEventPublisher
java.lang.Object
org.apache.beam.sdk.io.datadog.DatadogEventPublisher
DatadogEventPublisher is a utility class that helps write DatadogEvents to a
Datadog Logs API endpoint.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Shutdown connection manager and releases all resources.com.google.api.client.http.HttpResponseexecute(List<DatadogEvent> events) Executes a POST for the list ofDatadogEventobjects into Datadog's Logs API.com.google.api.client.http.HttpResponseexecute(DatadogEvent event) Same asexecute(List)but with a singleDatadogEvent.protected com.google.api.client.util.ExponentialBackOffReturn anExponentialBackOffwith the right settings.protected com.google.api.client.http.HttpContentgetContent(List<DatadogEvent> events) Utility method to marshall a list ofDatadogEvents into anHttpContentobject that can be used to create anHttpRequest.static org.apache.beam.sdk.io.datadog.DatadogEventPublisher.Builder
-
Field Details
-
DD_URL_PATH
- See Also:
-
-
Constructor Details
-
DatadogEventPublisher
public DatadogEventPublisher()
-
-
Method Details
-
newBuilder
public static org.apache.beam.sdk.io.datadog.DatadogEventPublisher.Builder newBuilder() -
execute
public com.google.api.client.http.HttpResponse execute(List<DatadogEvent> events) throws IOException Executes a POST for the list ofDatadogEventobjects into Datadog's Logs API.- Parameters:
events- List ofDatadogEvents- Returns:
HttpResponsefor the POST.- Throws:
IOException
-
execute
Same asexecute(List)but with a singleDatadogEvent.- Parameters:
event-DatadogEventobject.- Throws:
IOException
-
getConfiguredBackOff
protected com.google.api.client.util.ExponentialBackOff getConfiguredBackOff()Return anExponentialBackOffwith the right settings.- Returns:
ExponentialBackOffobject.
-
close
Shutdown connection manager and releases all resources.- Throws:
IOException
-
getContent
Utility method to marshall a list ofDatadogEvents into anHttpContentobject that can be used to create anHttpRequest.- Parameters:
events- List ofDatadogEvents- Returns:
HttpContentthat can be used to create anHttpRequest.
-