Package org.apache.beam.it.datadog
Class DatadogResourceManager
java.lang.Object
org.apache.beam.it.testcontainers.TestContainerResourceManager<MockServerContainer>
org.apache.beam.it.datadog.DatadogResourceManager
- All Implemented Interfaces:
org.apache.beam.it.common.ResourceManager
public class DatadogResourceManager
extends org.apache.beam.it.testcontainers.TestContainerResourceManager<MockServerContainer>
implements org.apache.beam.it.common.ResourceManager
Client for managing Datadog resources.
The class supports one mock Datadog server instance.
The class is thread-safe.
Note: The MockServer TestContainer will only run on M1 Mac's if the Docker version is >= 4.16.0 and the "Use Rosetta for x86/amd64 emulation on Apple Silicon" setting is enabled.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class org.apache.beam.it.testcontainers.TestContainerResourceManager
HOST_IP, port -
Method Summary
Modifier and TypeMethodDescriptionReturns the API endpoint that this mock Datadog server is configured to receive events at.Returns the Datadog API key used to connect to this mock Datadog server.Return a list of all Datadog entries retrieved from the mock Datadog server.Returns the HTTP endpoint that this mock Datadog server is configured to listen on.intgetPort()Returns the port to connect to the mock Datadog server.booleansendHttpEvent(DatadogLogEntry event) Sends the given HTTP event to the mock Datadog server.booleansendHttpEvents(Collection<DatadogLogEntry> events) Sends the given HTTP events to the mock Datadog server.Methods inherited from class org.apache.beam.it.testcontainers.TestContainerResourceManager
cleanupAll, getDockerImageName, getHost, getPortMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.beam.it.common.ResourceManager
cleanupAll
-
Method Details
-
builder
-
getPort
public int getPort()Returns the port to connect to the mock Datadog server. -
getHttpEndpoint
Returns the HTTP endpoint that this mock Datadog server is configured to listen on.- Returns:
- the HTTP endpoint.
-
getApiEndpoint
Returns the API endpoint that this mock Datadog server is configured to receive events at.This will be the HTTP endpoint concatenated with
'/api/v2/logs'.- Returns:
- the API endpoint.
-
getApiKey
Returns the Datadog API key used to connect to this mock Datadog server.- Returns:
- the API key.
-
sendHttpEvent
Sends the given HTTP event to the mock Datadog server.- Parameters:
event- TheDatadogLogEntryto send to the API.- Returns:
- True, if the request was successful.
-
sendHttpEvents
Sends the given HTTP events to the mock Datadog server.- Parameters:
events- TheDatadogLogEntrys to send to the API.- Returns:
- True, if the request was successful.
-
getEntries
Return a list of all Datadog entries retrieved from the mock Datadog server.- Returns:
- All Datadog entries on the server.
-