• EnglishEspañol日本語한국어Português
  • Log inStart now

Remove an attribute

Syntax

Java

NewRelic.removeAttribute(string $name)

Kotlin

NewRelic.removeAttribute(name: String?)

Description

This method removes an attribute specified by the name string. If you want to remove all custom attributes, see Remove all attributes.

Parameters

Parameter

Type

Description

$name

string

Required. The name of the attribute that you want to remove.

Return values

Returns true if recorded successfully, and false if it doesn't.

Example

Here's an example of removing an attribute named rate:

Java

boolean attributeRemoved = NewRelic.removeAttribute("rate");

Kotlin

val attributeRemoved = NewRelic.removeAttribute("rate")

Syntax

Objective-c

removeAttribute:(NSString*)name;

Swift

NewRelic.removeAttribute(_ name: : String!)-> Bool

Description

This method removes the attribute specified by the name string from the session. If you want to remove all custom attributes, see Remove all attributes.

Parameters

Parameter

Type

Description

name

NSString

Required. The name of the attribute that you want to remove.

Return values

Returns true if recorded successfully, and false if it doesn't.

Examples

Objective-C

Here's an example to remove the session attribute specified by a NSString* named rate:

BOOL attributeRemoved = [NewRelic removedAttribute@"rate"];
### Swift [#swift]
Here's an example to remove the session attribute specified by a `string` named `rate`:
```swift
let attributeRemoved = NewRelic.removedAttribute("rate")

Syntax

removeAttribute(options: { name: string; }) => void

Description

This method removes the attribute specified by the name string. If you want to remove all custom attributes, see Remove all attributes.

Parameters

Parameter

Type

Description

name

string

Required. The name of the attribute.

Example

NewRelicCapacitorPlugin.removeAttribute({ name: "CapacitorAttribute" });

Syntax

removeAttribute(name: string): void;

Description

This method removes the attribute specified by the name string. If you want to remove all custom attributes, see Remove all attributes.

Parameters

Parameter

Type

Description

name

string

Required. The name of the attribute.

Example

NewRelic.removeAttribute({ name: "CordovaAttribute" }); void

Syntax

RemoveAttribute(string name) : bool;

Description

This method removes the attribute specified by the name string. If you want to remove all custom attributes, see Remove all attributes.

Parameters

Parameter

Type

Description

name

bool

Required. The name of the attribute.

Example

CrossNewRelic.Current.RemoveAttribute("MAUINumAttr");

Syntax

removeAttribute(name: string): void;

Description

This method removes the attribute specified by the name string. If you want to remove all custom attributes, see Remove all attributes.

Parameters

Parameter

Type

Description

name

string

Required. The name of the attribute.

Example

NewrelicMobile.instance.removeAttribute("FlutterCustomAttrNumber");

Syntax

removeAttribute(name: string): void;

Description

This method removes the attribute specified by the name string. If you want to remove all custom attributes, see Remove all attributes.

Parameters

Parameter

Type

Description

name

string

Required. The name of the attribute.

Example

NewRelic.removeAttribute('RNCustomAttrNumber');

Syntax

RemoveAttribute(string name) : bool;

Description

This method removes the attribute specified by the name string. If you want to remove all custom attributes, see Remove all attributes.

Parameters

Parameter

Type

Description

name

string

Required. The name of the attribute.

Example

NewRelicAgent.RemoveAttribute("UnityCustomAttrNumber");

Syntax

removeAttribute(FString name) : void;

Description

This method removes the attribute specified by the name string. If you want to remove all custom attributes, see Remove all attributes.

Parameters

Parameter

Type

Description

name

FString

Required. The name of the attribute.

Example

#include "NewRelicBPLibrary.h"
UNewRelicBPLibrary::removeAttribute("Unreal String");

Syntax

RemoveAttribute(string name) : bool;

Description

This method removes the attribute specified by the name string. If you want to remove all custom attributes, see Remove all attributes.

Parameters

Parameter

Type

Description

name

string

Required. The name of the attribute.

Example

CrossNewRelicClient.Current.RemoveAttribute("XamarinNumAttr");
Copyright © 2024 New Relic Inc.

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