Attributes are key-value pairs containing information that determines the properties of an event or transaction. We enable users to customize exactly which attributes will be sent to each of these destinations:
These attribute settings apply to Python agent version 2.56.0.42 or higher. To take advantage of all available features, update your Python agent to the latest release .
Python agent web transaction attributes The following lists the attributes that can be configured in the Python agent for web transactions . For more information, see Python agent configuration: attributes .
The types as read from the HTTP Accept request header.
Defaults:
Transaction traces: Enabled Error collector (traced errors): Enabled Transaction events: Enabled Page views (browser monitoring ): Unavailable The incoming request size in bytes as read from the Content-Length
request header.
Defaults:
Transaction traces: Enabled Error collector (traced errors): Enabled Transaction events: Enabled Page views (browser monitoring): Unavailable The incoming request content-type as read from the Content-Type
request header.
Defaults:
Transaction traces: Enabled Error collector (traced errors): Enabled Transaction events: Enabled Page views (browser monitoring): Unavailable The name from the HTTP host request header.
Defaults:
Transaction traces: Enabled Error collector (traced errors): Enabled Transaction events: Enabled Page views (browser monitoring): Unavailable The incoming request referer as read from the Referer
request header.
Defaults:
Transaction traces: Enabled Error collector (traced errors): Enabled Transaction events: Enabled Page views (browser monitoring): Unavailable The incoming request user-agent as read from the User-Agent
request header.
Defaults:
Transaction traces: Enabled Error collector (traced errors): Enabled Transaction events: Enabled Page views (browser monitoring): Unavailable request.method The HTTP method of the incoming request.
Defaults:
Transaction traces: Enabled Error collector (traced errors): Enabled Transaction events: Enabled Page views (browser monitoring): Unavailable request.parameters.* Parameters from the query string of the request URL.
Tip The capture_params
property has been deprecated. However, if set to true
, it will enable request parameters for transaction traces and traced errors.
Defaults:
Transaction traces: Disabled Error collector (traced errors): Disabled Transaction events: Disabled Page views (browser monitoring): Disabled request.uri The URI of the incoming request.
Defaults:
Transaction traces: Enabled Error collector (traced errors): Enabled Transaction events: Enabled Page views (browser monitoring): Unavailable response.headers.contentLength Taken from the Content-Length
response header, this specifies the size of the outgoing response in bytes.
Defaults:
Transaction traces: Enabled Error collector (traced errors): Enabled Transaction events: Enabled Page views (browser monitoring): Unavailable response.headers.contentType Taken from the Content-Type
response header, this specifies the content type of the outgoing response.
Defaults:
Transaction traces: Enabled Error collector (traced errors): Enabled Transaction events: Enabled Page views (browser monitoring): Unavailable response.status The outgoing response status.
Defaults:
Transaction traces: Enabled Error collector (traced errors): Enabled Transaction events: Enabled Page views (browser monitoring): Unavailable thread.concurrency A measure of "thread utilization," representing the number of threads handling concurrent requests.
Defaults:
Transaction traces: Enabled Error collector (traced errors): Enabled Transaction events: Disabled Page views (browser monitoring): Unavailable webfrontend.queue.seconds Time (in seconds) spent in request queuing.
Defaults:
Transaction traces: Enabled Error collector (traced errors): Enabled Transaction events: Disabled Page views (browser monitoring): Unavailable Number of bytes received in the WSGI input stream (file-like object.)
Defaults:
Transaction traces: Enabled Error collector (traced errors): Enabled Transaction events: Disabled Page views (browser monitoring): Unavailable Number of calls to read()
by the WSGI server to handle request.
Defaults:
Transaction traces: Enabled Error collector (traced errors): Enabled Transaction events: Disabled Page views (browser monitoring): Unavailable Number of calls to readline()
by the WSGI server to handle request.
Defaults:
Transaction traces: Enabled Error collector (traced errors): Enabled Transaction events: Disabled Page views (browser monitoring): Unavailable Number of calls to readlines()
by the WSGI server to handle request.
Defaults:
Transaction traces: Enabled Error collector (traced errors): Enabled Transaction events: Disabled Page views (browser monitoring): Unavailable Time (in seconds) to read WSGI input stream.
Defaults:
Transaction traces: Enabled Error collector (traced errors): Enabled Transaction events: Disabled Page views (browser monitoring): Unavailable wsgi.output.bytes Number of bytes sent in the WSGI output response.
Defaults:
Transaction traces: Enabled Error collector (traced errors): Enabled Transaction events: Disabled Page views (browser monitoring): Unavailable wsgi.output.calls.write Number of calls to write()
by the WSGI server to send the response.
Defaults:
Transaction traces: Enabled Error collector (traced errors): Enabled Transaction events: Disabled Page views (browser monitoring): Unavailable wsgi.output.calls.yield Number of calls to yield
by the WSGI server to send the response.
Defaults:
Transaction traces: Enabled Error collector (traced errors): Enabled Transaction events: Disabled Page views (browser monitoring): Unavailable wsgi.output.seconds Time (in seconds) to send the WSGI response.
Defaults:
Transaction traces: Enabled Error collector (traced errors): Enabled Transaction events: Disabled Page views (browser monitoring): Unavailable Python agent message transaction attributes The following sections list the attributes that can be configured in the Python agent for message transactions started by incoming message brokers like RabbitMQ. For more information, see Python agent configuration: attributes .
message.correlationId The application-generated identifier used in RPC configurations.
Defaults:
Transaction traces: Disabled Error collector (traced errors): Disabled Transaction events: Disabled message.exchangeType The type of exchange this message was consumed from: direct, fanout, topic, or headers
Defaults:
Transaction traces: Disabled Error collector (traced errors): Disabled Transaction events: Disabled The headers of the incoming message.
Defaults:
Transaction traces: Disabled Error collector (traced errors): Disabled Transaction events: Disabled message.queueName The name of the queue this message was consumed from.
Defaults:
Transaction traces: Enabled Error collector (traced errors): Enabled Transaction events: Enabled message.replyTo The callback queue used in RPC configurations.
Defaults:
Transaction traces: Disabled Error collector (traced errors): Disabled Transaction events: Disabled message.routingKey The routing key of the incoming message.
Defaults:
Transaction traces: Enabled Error collector (traced errors): Enabled Transaction events: Enabled Python agent external trace attributes The following sections list the attributes that can be configured in the Python agent for traces started by outgoing libraries, like httplib, boto3, requests, and so on, or when using the external trace API . For more information, see Python agent configuration: attributes .
http.url The url of the outgoing call, stripped of any request parameters.
Excluded when:
A rule matching 'http.url' is present in the "transaction_segments.attributes.exclude" setting. (for segments)
A rule matching 'http.url' is present in the "span_events.attributes.exclude" configuration setting. (for spans)
Defaults:
Transaction segments: Enabled
Span events: Enabled
Python agent database trace attributes The following sections list the attributes that can be configured in the Python agent for traces started by database libraries like mysql, psycopg2, cx_Oracle, and so on, or when using the database trace API. For more information, see Python agent configuration: attributes .
db.instance The name of the database used in the query.
Excluded when:
The "datastore_tracer.database_name_reporting.enabled" configuration setting is set to False.
If a rule matching 'db.instance' is present in the "transaction_segments.attributes.exclude" setting (for segments)
If a rule matching 'db.instance' is present in the "span_events.attributes.exclude" configuration setting. (for spans)
Defaults:
Transaction segments: Enabled
Span events: Enabled
host The host used to connect to the database.
Excluded when:
port_path_or_id The port, path, or ID of the database.
Excluded when:
sql The SQLl used in the query, as processed according to the transaction_tracer.record_sql setting . Large queries are limited in size.
Excluded when:
The "transaction_tracer.record_sql setting" setting is set to "off."
Defaults:
Transaction segments: Enabled, reported as "obfuscated" SQL.
peer.hostname The host used to connect to the database.
Excluded when:
peer.address The host used to connect to the database, including the port or path information.
Excluded when:
db.statement The SQL used in the query, as processed according to the transaction_tracer.record_sql setting . Large queries are limited in size.
Excluded when:
The "transaction_tracer.record_sql setting" setting is set to "off."
Defaults:
Span events: Enabled, reported as "obfuscated" SQL.
db.operation The database operation that was performed by this span. Only to be included if db.statement is not applicable.
Excluded when:
Python agent datastore trace attributes The following sections list the attributes that can be configured in the Python agent for traces started by datastore libraries like redis, memcache, pymongo, and so on, or when using the datastore trace API . For more information, see Python agent configuration: attributes .
db.instance The name of the datastore instance used in the query.
Excluded when:
The "datastore_tracer.database_name_reporting.enabled" configuration setting is set to False.
If a rule matching 'db.instance' is present in the "transaction_segments.attributes.exclude" setting (for segments).
If a rule matching 'db.instance' is present in the "span_events.attributes.exclude" configuration setting (for spans).
Defaults:
Transaction segments: Enabled
Span events: Enabled
host The host used to connect to the datastore.
Excluded when:
port_path_or_id The port, path, or ID of the datastore.
Excluded when:
peer.hostname The host used to connect to the datastore.
Excluded when:
peer.address The host used to connect to the datastore, including the port, path, or ID information.
Excluded when:
Python agent span attributes The following sections list the attributes that can be configured in the Python agent for span events . For more information, see Python agent configuration: attributes .
error.class The class of exception, if one exists, that is recorded on the span event. Exception details can be recorded on spans with the notice_error API.
Defaults:
error.message The exception message, if one exists, that is recorded on the span event. Exception details can be recorded on spans with the notice_error API.
Defaults:
Add custom attributes To capture additional custom attributes from your application, use newrelic.agent.add_custom_attribute()
.
For full reference see, Collecting custom attributes .
Defaults:
Transaction traces: Enabled Error collector (traced errors): Enabled Transaction events: Enabled Page views (browser monitoring): Disabled Important Before creating custom attributes, review our list of reserved terms . Otherwise, unexpected results might occur.
Add custom attributes to exceptions When using the newrelic.agent.notice_error()
API call, you can pass in a dictionary of params
that will be recorded as attributes on the traced error.
Defaults:
Transaction traces: Unavailable Error collector (traced errors): Enabled Transaction events: Unavailable Page views (browser monitoring): Unavailable Upgrade your config file Upgrade your newrelic.ini configuration file when you upgrade to Python agent 2.56.0.42 or higher. For more information about deprecated configuration settings, see Enabling and disabling attributes .