• EnglishEspañol日本語한국어Português
  • 로그인지금 시작하기

사용자의 편의를 위해 제공되는 기계 번역입니다.

In the event of any inconsistency between the English version and the translated version, the English versionwill take priority. Please visit this page for more information.

문제 신고

newrelic_set_user_attributes(PHP 에이전트 API)

통사론

newrelic_set_user_attributes(string $user_value, string $account_value, string $product_value)

사용자 관련 사용자 지정 속성을 만듭니다. newrelic_add_custom_parameter가 더 유연합니다.

요구 사항

에이전트 버전 3.1.5.111 이상.

설명

이 호출을 통해 기존 키에 값을 할당할 수 있습니다. 키/값 쌍을 생성하는 보다 유연한 방법을 사용하려면 newrelic_add_custom_parameter 을 사용합니다.

릴리스 4.4부터 다음을 호출합니다.

newrelic_set_user_attributes("a", "b", "c");
// is equivalent to calling these three methods:
newrelic_add_custom_parameter("user", "a");
newrelic_add_custom_parameter("account", "b");
newrelic_add_custom_parameter("product", "c");

세 가지 매개변수가 모두 필요하지만 빈 문자열일 수 있습니다.

매개변수

매개변수

설명

$user_value

필수(빈 문자열일 수 있음). 이 페이지 보기와 연결할 이름 또는 사용자 이름을 지정하십시오. 이 값은 user 키에 할당됩니다.

$account_value

필수(빈 문자열일 수 있음). 이 페이지 보기와 연결할 사용자 계정의 이름을 지정하십시오. 이 값은 account 키에 할당됩니다.

$product_value

필수(빈 문자열일 수 있음). 이 페이지 보기와 연결할 제품의 이름을 지정하십시오. 이 값은 product 키에 할당됩니다.

반환 값

속성이 성공적으로 추가된 경우 이 함수는 true 을 반환합니다.

세 가지 사용자 속성 기록

function example() {
if (extension_loaded('newrelic')) { // Ensure PHP agent is available
newrelic_set_user_attributes("MyUserName", "MyAccountName", "MyProductName");
}
}

두 개의 사용자 속성과 하나의 빈 속성 기록

function example() {
if (extension_loaded('newrelic')) { // Ensure PHP agent is available
newrelic_set_user_attributes("MyUserName", "", "MyProductName");
}
}
Copyright © 2024 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.