Syntax
newrelic.agent.callable_name(object, separator=':')
Returns a string name identifying the supplied object.
Description
This call returns a string name identifying the supplied object. This is often used to programmatically name function traces.
Parameters
Parameter | Description |
---|---|
function, class, or member function | Required. The type of object supplied. |
string | Optional. Used for overriding the default |
Return values
Returns a string name identifying the supplied object.
The returned name will be in the form module:object_path
. If the object supplied is a function, then the name returned would be in the form module:function
. If the object is a class, the form would be module:class
. If a member function, the form would be module:class.function
.
Examples
Set name for function trace
Here's an example of using callable_name
to set the name of a function trace:
name = callable_name(func)
with FunctionTrace(txn, name): func()