/** * Returns Insights API url with account id * * @return string * @throws \Magento\Framework\Exception\LocalizedException */ protected function getEventsUrl() { if (empty($this->eventsUrl)) { $accountId = $this->config->getNewRelicAccountId(); if (empty($accountId)) { throw new \Magento\Framework\Exception\LocalizedException(__('No New Relic Application ID configured, cannot continue with Cron Event reporting')); } $this->eventsUrl = sprintf($this->config->getInsightsApiUrl(), $accountId); } return $this->eventsUrl; }