Repository navigation
Notes
This release of the Python agent adds support for Redis commands introduced in redis-py v8.2.0 and Kinesis methods introduced in botocore v1.44.5, adds the span.kind attribute to OpenTelemetry spans, stops truncating certain OpenTelemetry gen_ai span attributes, and classifies OpenTelemetry GenAI client spans as function traces. This release also validates custom event timestamps and fixes issues in the graphql-core 3.3, aiohttp, and OpenAI Responses instrumentation.
Install the agent using easy_install/pip/distribute via the Python Package Index, using conda via the Conda-Forge Package Index, or download it directly from the New Relic download site.
Security
-
This release includes a major overhaul of how the agent is built and released to improve security
- Immutable GitHub releases: Releases are now published as immutable GitHub releases. Once published, a release's tag can't be modified or replaced.
- Build provenance attestations: Release artifacts are published with signed provenance attestations hosted on both Github and PyPI.
- Reproducible builds: Wheels and source distributions are now fully reproducible from a tagged commit.
New features
-
Added Redis commands introduced in redis-py v8.2.0
- The Python agent now supports the new commands added in redis-py v8.2.0.
-
Added Kinesis methods introduced in botocore v1.44.5
- The Python agent now supports the new methods added to Kinesis in botocore v1.44.5.
Enhanced features
-
urllib3's SSLContext is now shared across agent reconnects
- This should improve performance by limiting certificate chain parsing to agent startup.
-
Added the
span.kindattribute to OpenTelemetry spans- All spans created with the OpenTelemetry API now include a
span.kindcustom attribute to match the OpenTelemetry span kind.
- All spans created with the OpenTelemetry API now include a
-
Exempted OpenTelemetry
gen_aispan attributes from truncation- The agent now exempts certain
gen_aispan attributes created with the OpenTelemetry API from being truncated. All other attributes are still subject to the standard attribute value length limit.
- The agent now exempts certain
-
Classified OpenTelemetry GenAI client spans as function traces
- Client spans created with the OpenTelemetry API that have
gen_ai.*attributes are now recorded as function traces.
- Client spans created with the OpenTelemetry API that have
Bug fixes
-
Fixed custom events being discarded when they have an invalid timestamp
- The agent now validates the
timestampof each custom event. Previously, an invalid timestamp could cause the server to discard the event.
- The agent now validates the
-
Fixed graphql-core v3.3 execution instrumentation
- Restored instrumentation of GraphQL query execution for graphql-core v3.3. The agent now supports the
FragmentDetailsandFieldDetailsobjects that v3.3 uses in place of AST nodes. - Thank you @BHARTIYAYASH for the contribution!
- Restored instrumentation of GraphQL query execution for graphql-core v3.3. The agent now supports the
-
Fixed the missing
http.statusCodeattribute for aiohttp client requests- Previously, the agent did not record the response status code on external calls made with the aiohttp client. The agent now records
http.statusCodeon these calls.
- Previously, the agent did not record the response status code on external calls made with the aiohttp client. The agent now records
-
Fixed OpenAI Responses streaming instrumentation
- Previously, the agent could leave the function trace open when a streamed response finished, which prevented parent spans from being recorded. The agent now closes the trace and records events when the final stream event arrives.
-
Fixed error recording for failed OpenAI Responses calls
- When an OpenAI Responses call fails, the agent now captures the error using the generic
openai.OpenAIErrorexception type instead ofopenai.APIError.
- When an OpenAI Responses call fails, the agent now captures the error using the generic
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.