Notes
This release of the Python agent drops support for Python 2.7 and adds the following:
- a Kafka server metric
- host and port attributes for memcache
- support for kafka-python-ng
- support for uvicorn_worker
- an environment variable for garbage collector (GC) runtime metrics
- automatic detection for the function signature in LangChain's
similarity_search
- updated support for OpenAI's chat class
- a fix for a bug in gRPC's entity name detection
- a fix for transaction context propagation loss in LangChain in the case of a new thread
- parsing of the request and response when running OpenAI via LangChain
- a fix for pyscopg v3 API incompatibilities
- a fix that removes versioned logic in loguru instrumentation
Install the agent using easy_install/pip/distribute
via the Python Package Index or download it directly from the New Relic download site.
Deprecations
Remove Python 2.7 Support
New features
Add Kafka server metric
- Adds a metric to capture the host and port information for Kafka entities on both consumers and producers. This metric allows the UI to link AWS information with AWS MSK entities in the service map.
Add capturing of memcache
host
andport
- Adds capturing of
host
andport
info on the following memcache libraries: bmemcached, aiomcache, and pymemcache. This allows the UI to link AWS information with AWS memcache entities in the service map.
- Adds capturing of
Add support for kafka-python-ng
- kafka-python has been released under a new name: kafka-python-ng. This continues to support kafka-python under the new package name.
Add support for uvicorn_worker
uvicorn.workers
has been moved to a separate package calleduvicorn_worker
. This checks for both names of the module when reporting dispatcher information.
Automatically detect function signature in LangChain
similarity_search
- Automatically detect the function signature when wrapping
similarity_search
.
- Automatically detect the function signature when wrapping
Add environment variable for garbage collector runtime metrics
- Garbage collector runtime metrics can now be enabled/disabled via the following environment variable:
NEW_RELIC_GC_RUNTIME_METRICS_ENABLED
.
- Garbage collector runtime metrics can now be enabled/disabled via the following environment variable:
Bug fixes
Fix bug in gRPC entity name detection
- Previously, the gRPC channel entity name was missing the first character(s) in specific cases. This bug has been fixed.
Fix issue in LangChain where a thread is started and the transaction context is lost
- Previously, when LangChain called certain chains, such as retrieval chains, LangChain started a thread that caused the transaction to be lost, resulting in broken instrumentation. This has been fixed so the transaction context is passed across threads and instrumentation still works for retrieval chains.
Fix parsing of request and response when running OpenAI via LangChain
Instrument new path to OpenAI chat completions class
- OpenAI moved the
ChatCompletions
class to a different path which prevented the instrumentation from being applied. This has been fixed.
- OpenAI moved the
Fix pyscopg v3 API incompatibilities
- Expand DBAPI2 wrappers to allow arbitrary
kwargs
onexecutemany()
. Upgrade psycopg v3 instrumentation to allow arbitrarykwargs
onexecutemany()
. Rename existing psycopg v3 wrapper arguments to match the upstream library's names for compatibility.
- Expand DBAPI2 wrappers to allow arbitrary
Remove versioned logic in loguru instrumentation
- Removed versioned logic in loguru instrumentation to fix a bug that occurred when the version was undeterminable.
Support statement
We recommend updating to the latest agent version as soon as it's available. If you can't upgrade to the latest version, update your agents to a version no more than 90 days old. Read more about keeping agents up to date.
See the New Relic Python agent EOL policy for information about agent releases and support dates.