Class DatadogEventPublisher

java.lang.Object
org.apache.beam.sdk.io.datadog.DatadogEventPublisher

public abstract class DatadogEventPublisher extends Object
DatadogEventPublisher is a utility class that helps write DatadogEvents to a Datadog Logs API endpoint.
  • Field Details

  • 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 of DatadogEvent objects into Datadog's Logs API.
      Parameters:
      events - List of DatadogEvents
      Returns:
      HttpResponse for the POST.
      Throws:
      IOException
    • execute

      public com.google.api.client.http.HttpResponse execute(DatadogEvent event) throws IOException
      Same as execute(List) but with a single DatadogEvent.
      Parameters:
      event - DatadogEvent object.
      Throws:
      IOException
    • getConfiguredBackOff

      protected com.google.api.client.util.ExponentialBackOff getConfiguredBackOff()
      Return an ExponentialBackOff with the right settings.
      Returns:
      ExponentialBackOff object.
    • close

      public void close() throws IOException
      Shutdown connection manager and releases all resources.
      Throws:
      IOException
    • getContent

      protected com.google.api.client.http.HttpContent getContent(List<DatadogEvent> events)
      Utility method to marshall a list of DatadogEvents into an HttpContent object that can be used to create an HttpRequest.
      Parameters:
      events - List of DatadogEvents
      Returns:
      HttpContent that can be used to create an HttpRequest.