8 use \Magento\Framework\HTTP\ZendClient;
15 const API_URL =
'https://api.newrelic.com/deployments.xml';
41 \Psr\Log\LoggerInterface
$logger,
60 $apiUrl = $this->config->getNewRelicApiUrl();
63 $this->logger->notice(
'New Relic API URL is blank, using fallback URL');
68 $client = $this->clientFactory->create();
69 $client->setUri($apiUrl);
72 $client->setHeaders([
'x-api-key' => $this->config->getNewRelicApiKey()]);
75 'deployment[app_name]' => $this->config->getNewRelicAppName(),
76 'deployment[application_id]' => $this->config->getNewRelicAppId(),
78 'deployment[changelog]' =>
$change,
79 'deployment[user]' =>
$user 82 $client->setParameterPost(
$params);
87 $this->logger->critical($e);
92 $this->logger->warning(
'Deployment marker request did not send a 200 status code.');
__construct(\Magento\NewRelicReporting\Model\Config $config, \Psr\Log\LoggerInterface $logger, \Magento\Framework\HTTP\ZendClientFactory $clientFactory)
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE]