Closed albertvaka closed 1 year ago
I've changed the detection of the EVP Proxy support to be lazy, so it is checked when it's first needed and the result is cached for 1 hour.
This way we don't block at boot time and in the worst case scenario we add a 10 second delay (the timeout of the /info request) once every hour. Most times, the Agent will respond in a few milliseconds or not respond at all (ie: if it's not there or doesn't support the /info API) which will not block.
This also lets us support Agent upgrades without having to restart Jenkins.
What does this PR do?
I also added tests for the whole webhooks logic, which didn't have any. They are mostly copies of the tests for the traces logic.
Description of the Change
fetchAgentSupportedEndpoints()
method toDatadogAgentClient
that queries the/info
Agent API.postWebhook()
method part of the abstractDatadogClient
so thatDatadogWebhookBuildLogic
andDatadogWebhookPipelineLogic
can call it on either aDatadogAgentClient
or aDatadogHttpClient
instance.postWebhook()
inDatadogAgentClient
. It sends webhook-type payloads using the Agent EVP Proxy.DatadogTraceBuildLogic
andDatadogWebhookBuildLogic
are now@Override
s of abstract methods of their parentDatadogBaseBuildLogic
soDatadogAgentClient
can use either implementation (depending on the output offetchAgentSupportedEndpoints
). Same forDatadog*PipelineLogic
.Verification Process
Open Questions
/info
API when initializing theDatadogAgentClient
. Is this okay?