• /
  • ログイン
  • 無料アカウント

newrelic_record_custom_event (PHP agent API)

Syntax

newrelic_record_custom_event(string $name, array $attributes)

Record a custom event with the given name and attributes.

Requirements

Agent version 4.18.0.89 or higher.

Description

Records a custom event for use in New Relic. For more information, see Inserting custom events with the PHP agent.

ヒント

When creating custom events, follow these rules:

  • The agent records a maximum of 10,000 events per minute. Limit the number of unique event type names that you create, and do not generate these names dynamically.
  • Avoid using reserved words and characters for the event and attributes names.
  • Ensure you do not exceed the event size and rate restrictions.

Parameters

Parameter

Description

$name

string

Required. Name of the custom event.

$attributes

array

Required. Supply custom attributes as an associative array. Supply the attribute names as keys of up to 255 characters, and supply the values as scalar values. Arrays and objects are not supported.

Examples

Basic example

if (extension_loaded('newrelic')) { // Ensure PHP agent is available
newrelic_record_custom_event("WidgetSale", array("color"=>"red", "weight"=>12.5));
}

For more help

If you need more help, check out these support and learning resources:

その他のヘルプ

さらに支援が必要な場合は、これらのサポートと学習リソースを確認してください:

問題を作成するこのページを編集する
Copyright © 2020 New Relic Inc.