Skip to content

Commit

Permalink
chore: add language identifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
brnhensley committed May 29, 2023
1 parent 4de8a4d commit ca0f1c6
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ metaDescription: 'Python API: This call adds a custom attribute (key/value tuple

## Syntax

```
```py
newrelic.agent.add_custom_attributes(items)
```

Expand Down Expand Up @@ -51,7 +51,7 @@ Attributes may be found in APM if the transaction is associated with an error or
</td>

<td>
Required. Each item in the list must be a tuple, with the first element being a key, and the second its value. Each key is a string representing the name of an attribute, and each corresponding value is the value to add to the current transaction for this attribute. Values can be `int`, `float`, `string`, or `boolean`. Only the first 255 characters are retained for both keys and values.
Required. Each item in the list must be a `tuple`, with the first element being a _key_, and the second its _value_. Each key is a string representing the name of an attribute, and each corresponding value is the value to add to the current transaction for this attribute. Values can be `int`, `float`, `string`, or `boolean`. Only the first 255 characters are retained for both keys and values.
</td>
</tr>
</tbody>
Expand All @@ -67,7 +67,7 @@ Returns `True` if all attributes were added successfully.

An example of adding custom attributes to a [background task](/docs/agents/python-agent/python-agent-api/background_task):

```
```py
@newrelic.agent.background_task()
def send_request():
response = requests.get("http://example.com")
Expand All @@ -80,7 +80,7 @@ def send_request():

You can also use custom attributes to troubleshoot performance issues. For example, you might see occasional slow response times from a pool of memcache instances, but you don't know what instance is causing the problem. You might add an attribute to the transaction indicating the server, like so:

```
```py
# Set server_ip to be the current server processing the transaction
newrelic.agent.add_custom_attributes([
("memcache_query_frontend_lookup", "server_ip")
Expand Down

0 comments on commit ca0f1c6

Please sign in to comment.