• EnglishEspañol日本語한국어Português
  • EntrarComeçar agora

Python agent release notesRSS

July 11
Python agent v9.12.0

Notes

This release of the Python agent adds instrumentation for aiomcache, support for an internally set collect_ai serverside configuration setting, formatting stack traces in NewRelicContextFormatter, fixes a crash in package catpuring in Python 2.7, an attribute check in OpenAI instrumentation, and casing on LangChain metric and span names.

Install the agent using easy_install/pip/distribute via the Python Package Index or download it directly from the New Relic download site.

New features

  • Add instrumentation for aiomcache:

  • Add support for collect_ai serverside config:

    • Add support for an internally set collect_ai serverside configuration setting. Note this is returned in the connect response when a particular feature flag is set on an account.
  • Adds support for formatting stack traces in NewRelicContextFormatter:

    • NewRelicContextFormatter now implements the format_exc_info class method that formats stack traces. Thank you Daniel Fritz for the contribution!

Bug fixes

  • Fix crash in package capture in Python 2.7:

    • Previously, when capturing packages on Python 2.7 an UnboundLocalError would be raised. This has been fixed.
  • Fix attribute check in OpenAI:

    • Fix a typo in an attribute check inside the OpenAI instrumentation. Thank you Liam Niehus-Staab for the contribution!
  • Fix casing on LangChain metric and span names:

    • Previously, if LangChain was being used in combination with an unsupported Large Language Model library (aka not Bedrock or OpenAI) then the AI dashboard tab would not appear in the UI because the metric name was not cased correctly. This has been fixed and the Span names have been updated to match the casing of the metric name.

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.

June 13
Python agent v9.11.0

Notes

This release of the Python agent adds agent_language to lambda metadata, support for injecting the agent into Kubernetes, support for psycopg 3.0+, optimizes plugins list capturing, fixes the Large Language Model event duration units, a crash in ASGI when the Content-Length header is missing, a crash when using OpenAI's .with_raw_response. and .with_streaming_response..

Install the agent using easy_install/pip/distribute via the Python Package Index or download it directly from the New Relic download site.

New features

  • Add agent_language to lambda metadata

    • Add agent_language to collected lambda metadata.
  • Optimize plugins list capturing

    • Skip checking for a package version on newrelic hooks that we know do not have versions.
  • Add support for injecting the agent into Kubernetes

    • Updates the bootstrap sitecustomize file to support injecting the agent into a Kubernetes cluster.
    • A full product for agent injection in Kubernetes will be coming soon in public preview.
    • A new informational only setting called k8s_operator.enabled (with NEW_RELIC_K8S_OPERATOR_ENABLED as an environment variable) was added, which is used to report when the agent is injected into a Kubernetes cluster. This setting does not enable/disable this function of the agent.
  • Add support for psycopg 3.0+

    • New instrumentation for psycopg 3.0+ has been added, providing database tracing for both the Connection and AsyncConnection classes.

Bug fixes

  • Fix Large Language Model event duration units

    • Previously, durations on LLM events were recorded in seconds which did not match some of the other language agents. This has been changed to be milliseconds.
  • Fix crash when using OpenAI's .with_raw_response.

    • Previously, an exception would be raised inside the instrumentation when .with_raw_response. was used. This no longer happens, the instrumentation successfuly records LLM data when .with_raw_response. is used.
  • Fix crash when using OpenAI's .with_streaming_response.

    • Previously, an exception would be raised inside the instrumentation when .with_streaming_response. was used. This no longer happens, the instrumentation is just skipped.
  • Fix a crash in ASGI when the Content-Length header is missing

    • Previously, an exception would be raised inside the instrumentation that injects the browser agent when an ASGI response was missing the Content-Length header. This issue has been fixed.

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.

May 23
Python agent v9.10.0

Notes

This release of the Python agent:

  • Adds instrumentation for AIOBotocore
  • Adds support for Meta Llama3 and Mistral AI in Amazon Bedrock
  • Fixes an error parsing issue in OpenAI
  • Updates Loguru's instrumentation to use milliseconds instead of seconds

Install the agent using easy_install/pip/distribute via the Python Package Index or download it directly from the New Relic download site.

New features

  • Add AIOBotocore instrumentation

    • Add instrumentation for AIOBotocore. Supports proxy mode in addition to standard operation.
  • Add new Amazon Bedrock models

    • Add instrumentation for the following Amazon Bedrock models:
      • Meta Llama3
      • Mistral AI

Bug fixes

  • Fix OpenAI error parsing

    • Previously, if an error in OpenAI was encountered, the Python Agent would attempt to override the default error.message within notice_error() with the one used in OpenAI. However, if there was no message attribute in the error, the Python Agent would crash. Now it defaults to the original methodology of error handling by the Python Agent.
  • Record timing in Loguru in milliseconds

    • Timing in Loguru is recorded as an integer and if that value was less than 1 second, it would record it as 0s. This changes the units to be in milliseconds instead. Thanks, (@julia-tadej-wwtech)[https://github.com/julia-tadej-wttech] for the contribution!

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.

May 13
Python agent v9.9.1

Notes

This release of the Python agent fixes Celery instrumentation on worker processes, adds new Langchain vectorstores, adds HTTP method attributes to urllib3 traces, and fixes an issue with URI detection in gRPC clients.

Install the agent using easy_install/pip/distribute via the Python Package Index or download it directly from the New Relic download site.

New features

  • Add new Langchain vectorstores

    • Support for the following Langchain vectorstores: Relyt, OracleVS, UpstashVectorStore, VLite

Bug fixes

  • Fix Celery instrumentation on worker processes

    • Instrumentation updates in v9.9.0 introduced a bug where Celery workers running with worker optimizations enabled would overwrite instrumentation. This has been fixed and instrumentation should now function the same with and without worker optimizations enabled.
  • Add HTTP method attributes to urllib3 traces

    • urllib3 traces did not include the HTTP method as an attribute previously. This has now been added.
  • Fix gRPC URI detection for client ExternalTraces

    • The latest version of gRPC changed the format of URIs used in clients, which caused the hostname to be reported as "dns" for all client requests. This has been fixed and hostnames should be reported correctly again.

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.

April 18
Python agent v9.9.0

Notes

This release of the Python agent updates Celery instrumentation, adds new Langchain vectorstores, adds configuration to capture memory usage runtime metrics per process, fixes a content reporting issue in Anthropic Claude, and upgrades internal version of urllib3 to v1.26.18.

Install the agent using easy_install/pip/distribute via the Python Package Index or download it directly from the New Relic download site.

Security

  • Upgrade internal version of urllib3 to v1.26.18

    • Upgrade the internal version of urllib3 used in the Python Agent to v1.26.18 to resolve security warnings.

New features

  • Update Celery instrumentation

    • Add support for distributed tracing in Celery over AMQP headers.
    • Remove duplicate function traces for some methods of running tasks.
      • All tasks should now only be instrumented once, and will report either an OtherTransaction, or a FunctionTrace if run under an existing transaction.
    • Fix instrumentation for grouped celery tasks APIs, such as task.map(), celery.group(), and celery.chunks().
      • Tasks run using task.map() or task.starmap() will now name tasks in the format Celery/celery.map/my_task to allow you to differentiate between map tasks.
      • Individual task runs created by the map() and starmap() tasks will be traced with a FunctionTrace to capture individual timings.
  • Add new Langchain vectorstores

    • Support for the following Langchain vectorstores: DuckDB, EcloudESVectorStore, InMemoryVectorStore, PathwayVectorClient, VDMS
  • Add configuration setting to enable capturing of memory usage runtime metrics per process

    • Add memory_runtime_pid_metrics.enabled configuration setting to toggle capturing of memory usage metrics (per process ID only) to reduce Metric Grouping Issues (MGI).

Bug fixes

  • Report only raw content dictionary for Anthropic Claude

    • Previously, AWS Bedrock's Anthropic Claude model would report a list of dictionaries of message content. Now it reports a single dictionary of message content.

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.

March 27
Python agent v9.8.0

Notes

This release of the Python agent adds support for the latest versions of asgiref and support for AI monitoring when using the following libraries: OpenAI, AWS Bedrock, and Langchain.

Install the agent using easy_install/pip/distribute via the Python Package Index or download it directly from the New Relic download site.

New features

  • Add support for asgiref 3.8.0 and above

    • Asgiref released a new version that resulted in missing transaction context. This has been fixed.
  • AI monitoring

    • New Relic AI monitoring is the industry’s first APM solution that provides end-to-end visibility for AI Large Language Model (LLM) applications. It enables end-to-end visibility into the key components of an AI LLM application. With AI monitoring, users can monitor, alert, and debug AI-powered applications for reliability, latency, performance, security and cost. AI monitoring also enables AI/LLM specific insights (metrics, events, logs and traces) which can easily integrate to build advanced guardrails for enterprise security, privacy and compliance.
    • AI monitoring offers custom-built insights and tracing for the complete lifecycle of an LLM’s prompts and responses, from raw user input to repaired/polished responses. AI monitoring provides built-in integrations with popular LLMs and components of the AI development stack. This release provides instrumentation for OpenAI, AWS Bedrock, and Langchain.
    • When AI monitoring is enabled with ai_monitoring.enabled = true, the agent will now capture AI LLM related data. This data will be visible under a new APM tab called AI Responses. See our AI Monitoring documentation for more details.
  • AI monitoring configuration

    • New configuration options are available specific to AI monitoring. These settings include:
      • ai_monitoring.enabled
      • ai_monitoring.streaming.enabled
      • ai_monitoring.content.enabled
  • AI monitoring public API methods

  • Add support for AWS Bedrock

    • Support for AWS Bedrock Large Language Model instrumentation has been added. Chat completion and embedding data for streaming and non-streaming is recorded for the following models:
      • amazon.titan-*
      • ai21.j2-*
      • anthropic.claude-*
      • cohere.command-*
      • meta.llama2-*
      • amazon.titan-embed*
      • cohere.embed*
  • Add support for Langchain

    • Support for Langchain Large Language Model instrumentation has been added. Langchain Agents, Chains, Tools, OpenAI, and Bedrock LLM data is recorded. Note streaming is not supported at this time.
  • Add support for OpenAI

    • Support for OpenAI Large Language Model instrumentation has been added. Synchronous and asynchronous chat completion and embedding data is recorded. Note streaming is only supported in chat completions at this time.

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.

March 11
Python agent v9.7.1

Notes

This release of the Python agent fixes a bug in the NewRelicContextFormatter where attributes were dropped from logs.

Install the agent using easy_install/pip/distribute via the Python Package Index or download it directly from the New Relic download site.

Bug fixes

  • Fix log attribute dropping in NewRelicContextFormatter
    • In v9.5.0, a bug in the NewRelicContextFormatter was introduced where message was added to the default set of keys to exclude. This caused extra attributes not in the default list to be dropped. This bug has been fixed.

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.

February 22
Python agent v9.7.0

Notes

This release of the Python agent no longer reports attributes with None values. It also attaches a transaction trace ID to the error traces even when distributed tracing is disabled.

Install the agent using easy_install/pip/distribute via the Python Package Index or download it directly from the New Relic download site.

New features

  • Remove reporting of attributes with None values

    • Previously, the agent recorded attributes with a value of None type as the string "None". The agent will no longer record user or agent attributes that have None type values.

Bug fixes

  • Add transaction trace ID to the error traces even when distributed tracing is disabled
    • Previously, certain trace attributes in error traces such as stack traces were only visible in the UI if distributed tracing was enabled. Linking the transaction trace to error traces by including the transaction trace ID on the error traces allows the user to have access to the transaction trace attributes in the UI.

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.

January 25
Python agent v9.6.0

Notes

This release of the Python agent fixes a bug when specifying processors in structlog, and updates the NewRelicLogForwardingHandler to support dictionary type logs and formatters.

Install the agent using easy_install/pip/distribute via the Python Package Index or download it directly from the New Relic download site.

New features

  • Support dictionary type logs in NewRelicLogForwardingHandler

    • Dictionary type log messages are now supported in NewRelicLogForwardingHandler when passed as the log message, or when a custom formatter returns a dictionary.
    • The key message will be extracted if available and treated as the log message, and any other items will be considered context data attributes and prefixed with message..
      • These attributes are subject to the same filtering rules as other context data. The message. prefix is not considered when filtering attributes from logs.
      • To report these attributes, enable context data forwarding and optionally configure include and exclude rules to filter the allowed attributes.
  • Support logging formatters in NewRelicLogForwardingHandler

    • Logging formatters added with setFormatter() are now supported, and may return a string or dicitionary log message type to be forwarded to New Relic.

Bug fixes

  • Fix a bug when specifying processors in structlog
    • Previously, there was a bug in the structlog instrumentation where processors was assumed to be list type. Now the instrumentation supports processors of all iterable types.

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.

January 11
Python agent v9.5.0

Notes

This release of the Python agent adds context data attributes to logs, support for dictionary type log messages, adds attribute support to record_log_event API, and obfuscates logged license keys and user API keys.

Install the agent using easy_install/pip/distribute via the Python Package Index or download it directly from the New Relic download site.

New features

  • Add context data attributes to logs

    • Context data available from logging frameworks can now be recorded as attributes on logs. These attributes are prefixed with context., which is not considered when filtering attributes from logs.
    • Context data may include extras, dictionary message attributes, and attributes provided by logging frameworks.
    • To report these attributes, enable context data forwarding and optionally configure include and exclude rules to filter the allowed attributes.
  • Add support for dictionary type log messages

    • Dictionary type log messages are now supported for logging frameworks which support dictionary type log messages (including the builtin logging module and structlog).
    • The key message will be extracted if available and treated as the log message, and any other items will be considered context data attributes and prefixed with message.. These attributes are subject to the same filtering rules as other context data.
  • Add attribute support to record_log_event API

    • The record_log_event API now allows passing context data in using the optional attributes keyword argument, and allows the message argument to be a dictionary as described above.
  • Obfuscate license keys and user API keys in logs

    • The agent now obfuscates all instances of license keys or user API keys in agent logs and audit logs.

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.

Copyright © 2024 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.