Example #1
0
 /**
  * Added in v. 4.18 of the New Relic Agent.
  *
  * @link https://docs.newrelic.com/docs/agents/php-agent/configuration/php-agent-api#api-record-custom-event
  *
  * @param string $name
  * @param array  $attributes
  *
  * @since 2.0.0
  */
 public function recordCustomEvent($name, array $attributes)
 {
     if ($this->isLoaded()) {
         newrelic_record_custom_event($name, $attributes);
     }
 }
Example #2
0
 /**
  * Log Content error
  * @param $data
  * @param $title
  */
 public static function log_error($data, $title)
 {
     $error_msg = "in Drupal API\n---------------------------------------------------------------\n";
     $error_msg .= "Node title: '{$title}' is missing\n";
     // Language
     $lang = $data['log_info']['locale'];
     $error_msg .= "Language:   {$lang}\n";
     // Host
     $host = $data['log_info']['host'];
     $error_msg .= "Host:       {$host}\n";
     // Endpoint
     $uri = $data['log_info']['uri'];
     $error_msg .= "Uri:        /{$uri}\n";
     // File & line number
     $bt = debug_backtrace();
     $cf = $bt[1]['file'] . ' (' . $bt[1]['line'] . ')';
     $error_msg .= "File:       {$cf}\n";
     if (extension_loaded('newrelic')) {
         newrelic_set_appname('Younique Products');
         newrelic_record_custom_event('drupalNodeNotFound', ['title' => $title, 'host' => $host, 'uri' => $uri, 'file' => $cf]);
     }
     CakeLog::error($error_msg, 'drupalCache');
 }
 public static function newrelic_record_event($event, $attrs)
 {
     $attrs['event'] = $event;
     newrelic_record_custom_event(__CLASS__, $attrs);
 }
Example #4
0
 /**
  * Records a <a href="https://docs.newrelic.com/docs/insights/new-relic-insights/understanding-insights/new-relic-insights">New Relic Insights<a> custom event.
  * For more information, see <a href="https://docs.newrelic.com/docs/insights/new-relic-insights/adding-querying-data/inserting-custom-events-new-relic-agents#php-att">Inserting custom events with the PHP agent.</a>
  * 
  * @param string $name The event name
  * @param array $attributes Associative array of the attributes
  * @since ?.?
  */
 public function recordCustomEvent($name, $attributes)
 {
     if ($this->skip()) {
         return;
     }
     newrelic_record_custom_event($name, $attributes);
 }