Skip to content

Commit

Permalink
Merge pull request #15121 from newrelic/austin-schaefer-patch-71231
Browse files Browse the repository at this point in the history
fix(python): Clarify which config file (NR-82924)
  • Loading branch information
austin-schaefer authored Nov 11, 2023
2 parents d35b758 + be36170 commit 4078824
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ redirects:
- /docs/agents/python-agent/customization-extension/python-custom-instrumentation-config-file
---

You can extend the Python agent's monitoring to trace time spent in additional functions or methods of classes by modifying your configuration file. This form of [custom instrumentation](/docs/python/python-custom-instrumentation) is simpler to implement than API calls, and does not require you to modify your code. However, for more complex needs, you may need to implement [Python instrumentation by API](/docs/python/python-instrumentation-by-api).
You can extend the Python agent's monitoring to trace time spent in additional functions or methods of classes by editing your [`newrelic.ini` configuration file](/docs/apm/agents/python-agent/configuration/python-agent-configuration/#agent-configuration-file). This form of [custom instrumentation](/docs/python/python-custom-instrumentation) is simpler to implement than API calls, and doesn't require you to modify your code. However, for more complex needs, you may need to [instrument via API](/docs/python/python-instrumentation-by-api) instead.

## Listing functions in the configuration file [#listing_functions]

Expand Down Expand Up @@ -69,8 +69,8 @@ name = dumbdbm:_Database._commit
group = Function
```

The ini file section name should start with `function-trace:`. The name component that follows that prefix can be anything but should be unique across all function trace sections in the configuration file. The `group` and `name` settings can be overridden as necessary to arrive at the desired metric name. The `enabled` setting defaults to `false` and needs to be set to `true` to enable the function trace.
The `.ini` file section name should start with `function-trace:`. The name component that follows that prefix can be anything but should be unique across all function trace sections in the configuration file. You can override the `group` and `name` settings to get the desired metric name. The `enabled` setting defaults to `false` and you must change it to `true` to enable the function trace.

## Instrument with the API [#function_decorators]

For simple custom instrumentation purposes, the config file method works well. For more precise and customized instrumentation and agent behavior adjustments, you will want to use the [Python agent API](/docs/agents/python-agent/api/python-agent-api-guide).
For simple custom instrumentation purposes, the config file method works well. For more precise and customized instrumentation and agent behavior adjustments, use the [Python agent API](/docs/agents/python-agent/api/python-agent-api-guide).

0 comments on commit 4078824

Please sign in to comment.