Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/.trivyignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Ignored Vulnerabilities
# =======================

# Accepting risk due to Python 3.7 and 3.8 support.
# Accepting risk due to Python 3.8 support.
CVE-2025-50181

# Not relevant, only affects Pyodide
Expand Down
2 changes: 1 addition & 1 deletion .github/containers/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ RUN echo 'eval "$(pyenv init -)"' >>${HOME}/.bashrc && \
pyenv update

# Install Python
ARG PYTHON_VERSIONS="3.12 3.11 3.10 3.9 3.8 3.7 3.13 pypy3.10-7.3.17"
ARG PYTHON_VERSIONS="3.13 3.12 3.11 3.10 3.9 3.8 pypy3.10-7.3.17"
COPY --chown=0:0 --chmod=755 ./install-python.sh /tmp/install-python.sh
RUN /tmp/install-python.sh && \
rm /tmp/install-python.sh
Expand Down
37 changes: 0 additions & 37 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,42 +23,6 @@ permissions:
contents: read

jobs:
build-linux-py3-legacy:
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
wheel:
- cp37-manylinux
- cp37-musllinux

steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # 5.0.0
with:
persist-credentials: false
fetch-depth: 0

- name: Setup QEMU
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # 3.6.0

- name: Build Wheels
uses: pypa/cibuildwheel@8d945475ac4b1aac4ae08b2fd27db9917158b6ce # 2.17.0
env:
CIBW_PLATFORM: linux
CIBW_BUILD: "${{ matrix.wheel }}*"
CIBW_ARCHS_LINUX: x86_64 aarch64
CIBW_ENVIRONMENT: "LD_LIBRARY_PATH=/opt/rh/devtoolset-8/root/usr/lib64:/opt/rh/devtoolset-8/root/usr/lib:/opt/rh/devtoolset-8/root/usr/lib64/dyninst:/opt/rh/devtoolset-8/root/usr/lib/dyninst:/usr/local/lib64:/usr/local/lib"
CIBW_TEST_REQUIRES: pytest
CIBW_TEST_COMMAND: "PYTHONPATH={project}/tests pytest {project}/tests/agent_unittests -vx"

- name: Upload Artifacts
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # 4.6.2
with:
name: ${{ github.job }}-${{ matrix.wheel }}
path: ./wheelhouse/*.whl
if-no-files-found: error
retention-days: 1

build-linux-py3:
runs-on: ubuntu-24.04
strategy:
Expand Down Expand Up @@ -151,7 +115,6 @@ jobs:
attestations: write

needs:
- build-linux-py3-legacy
- build-linux-py3
- build-sdist

Expand Down
9 changes: 0 additions & 9 deletions THIRD_PARTY_NOTICES.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,6 @@ Distributed under the following license(s):
* [The Apache License, Version 2.0 License](https://opensource.org/license/apache-2-0/)


## [time.monotonic](newrelic/common/_monotonic.c)

Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Python Software Foundation; All Rights Reserved

Distributed under the following license(s):

* [Python Software Foundation](https://docs.python.org/3/license.html)


## [urllib3](https://pypi.org/project/urllib3)

Copyright (c) 2008-2019 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
Expand Down
90 changes: 40 additions & 50 deletions newrelic/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,56 +15,9 @@
from newrelic.api.application import application_instance as __application
from newrelic.api.application import application_settings as __application_settings
from newrelic.api.application import register_application as __register_application
from newrelic.api.log import NewRelicContextFormatter as __NewRelicContextFormatter
from newrelic.api.time_trace import add_custom_span_attribute as __add_custom_span_attribute
from newrelic.api.time_trace import current_trace as __current_trace
from newrelic.api.time_trace import get_linking_metadata as __get_linking_metadata
from newrelic.api.time_trace import notice_error as __notice_error
from newrelic.api.transaction import accept_distributed_trace_headers as __accept_distributed_trace_headers
from newrelic.api.transaction import add_custom_attribute as __add_custom_attribute
from newrelic.api.transaction import add_custom_attributes as __add_custom_attributes
from newrelic.api.transaction import add_framework_info as __add_framework_info
from newrelic.api.transaction import capture_request_params as __capture_request_params
from newrelic.api.transaction import current_span_id as __current_span_id
from newrelic.api.transaction import current_trace_id as __current_trace_id
from newrelic.api.transaction import current_transaction as __current_transaction
from newrelic.api.transaction import disable_browser_autorum as __disable_browser_autorum
from newrelic.api.transaction import end_of_transaction as __end_of_transaction
from newrelic.api.transaction import get_browser_timing_header as __get_browser_timing_header
from newrelic.api.transaction import ignore_transaction as __ignore_transaction
from newrelic.api.transaction import insert_distributed_trace_headers as __insert_distributed_trace_headers
from newrelic.api.transaction import record_custom_event as __record_custom_event
from newrelic.api.transaction import record_custom_metric as __record_custom_metric
from newrelic.api.transaction import record_custom_metrics as __record_custom_metrics
from newrelic.api.transaction import record_log_event as __record_log_event
from newrelic.api.transaction import record_ml_event as __record_ml_event
from newrelic.api.transaction import set_background_task as __set_background_task
from newrelic.api.transaction import set_transaction_name as __set_transaction_name
from newrelic.api.transaction import suppress_apdex_metric as __suppress_apdex_metric
from newrelic.api.transaction import suppress_transaction_trace as __suppress_transaction_trace
from newrelic.api.wsgi_application import WSGIApplicationWrapper as __WSGIApplicationWrapper
from newrelic.api.wsgi_application import wrap_wsgi_application as __wrap_wsgi_application
from newrelic.api.wsgi_application import wsgi_application as __wsgi_application
from newrelic.config import extra_settings as __extra_settings
from newrelic.config import initialize as __initialize
from newrelic.core.agent import register_data_source as __register_data_source
from newrelic.core.agent import shutdown_agent as __shutdown_agent
from newrelic.core.config import global_settings as __global_settings
from newrelic.samplers.decorators import data_source_factory as __data_source_factory
from newrelic.samplers.decorators import data_source_generator as __data_source_generator

try:
from newrelic.api.asgi_application import ASGIApplicationWrapper as __ASGIApplicationWrapper
from newrelic.api.asgi_application import asgi_application as __asgi_application
from newrelic.api.asgi_application import wrap_asgi_application as __wrap_asgi_application
except SyntaxError:

def __asgi_application(*args, **kwargs):
pass

__ASGIApplicationWrapper = __asgi_application
__wrap_asgi_application = __asgi_application

from newrelic.api.asgi_application import ASGIApplicationWrapper as __ASGIApplicationWrapper
from newrelic.api.asgi_application import asgi_application as __asgi_application
from newrelic.api.asgi_application import wrap_asgi_application as __wrap_asgi_application
from newrelic.api.background_task import BackgroundTask as __BackgroundTask
from newrelic.api.background_task import BackgroundTaskWrapper as __BackgroundTaskWrapper
from newrelic.api.background_task import background_task as __background_task
Expand Down Expand Up @@ -96,6 +49,7 @@ def __asgi_application(*args, **kwargs):
from newrelic.api.html_insertion import insert_html_snippet as __insert_html_snippet
from newrelic.api.html_insertion import verify_body_exists as __verify_body_exists
from newrelic.api.llm_custom_attributes import WithLlmCustomAttributes as __WithLlmCustomAttributes
from newrelic.api.log import NewRelicContextFormatter as __NewRelicContextFormatter
from newrelic.api.message_trace import MessageTrace as __MessageTrace
from newrelic.api.message_trace import MessageTraceWrapper as __MessageTraceWrapper
from newrelic.api.message_trace import message_trace as __message_trace
Expand All @@ -112,14 +66,43 @@ def __asgi_application(*args, **kwargs):
from newrelic.api.profile_trace import wrap_profile_trace as __wrap_profile_trace
from newrelic.api.settings import set_error_group_callback as __set_error_group_callback
from newrelic.api.supportability import wrap_api_call as __wrap_api_call
from newrelic.api.time_trace import add_custom_span_attribute as __add_custom_span_attribute
from newrelic.api.time_trace import current_trace as __current_trace
from newrelic.api.time_trace import get_linking_metadata as __get_linking_metadata
from newrelic.api.time_trace import notice_error as __notice_error
from newrelic.api.transaction import accept_distributed_trace_headers as __accept_distributed_trace_headers
from newrelic.api.transaction import add_custom_attribute as __add_custom_attribute
from newrelic.api.transaction import add_custom_attributes as __add_custom_attributes
from newrelic.api.transaction import add_framework_info as __add_framework_info
from newrelic.api.transaction import capture_request_params as __capture_request_params
from newrelic.api.transaction import current_span_id as __current_span_id
from newrelic.api.transaction import current_trace_id as __current_trace_id
from newrelic.api.transaction import current_transaction as __current_transaction
from newrelic.api.transaction import disable_browser_autorum as __disable_browser_autorum
from newrelic.api.transaction import end_of_transaction as __end_of_transaction
from newrelic.api.transaction import get_browser_timing_header as __get_browser_timing_header
from newrelic.api.transaction import ignore_transaction as __ignore_transaction
from newrelic.api.transaction import insert_distributed_trace_headers as __insert_distributed_trace_headers
from newrelic.api.transaction import record_custom_event as __record_custom_event
from newrelic.api.transaction import record_custom_metric as __record_custom_metric
from newrelic.api.transaction import record_custom_metrics as __record_custom_metrics
from newrelic.api.transaction import record_log_event as __record_log_event
from newrelic.api.transaction import record_ml_event as __record_ml_event
from newrelic.api.transaction import set_background_task as __set_background_task
from newrelic.api.transaction import set_transaction_name as __set_transaction_name
from newrelic.api.transaction import set_user_id as __set_user_id
from newrelic.api.transaction import suppress_apdex_metric as __suppress_apdex_metric
from newrelic.api.transaction import suppress_transaction_trace as __suppress_transaction_trace
from newrelic.api.transaction_name import TransactionNameWrapper as __TransactionNameWrapper
from newrelic.api.transaction_name import transaction_name as __transaction_name
from newrelic.api.transaction_name import wrap_transaction_name as __wrap_transaction_name
from newrelic.api.web_transaction import WebTransaction as __WebTransaction
from newrelic.api.web_transaction import WebTransactionWrapper as __WebTransactionWrapper
from newrelic.api.web_transaction import web_transaction as __web_transaction
from newrelic.api.web_transaction import wrap_web_transaction as __wrap_web_transaction
from newrelic.api.wsgi_application import WSGIApplicationWrapper as __WSGIApplicationWrapper
from newrelic.api.wsgi_application import wrap_wsgi_application as __wrap_wsgi_application
from newrelic.api.wsgi_application import wsgi_application as __wsgi_application
from newrelic.common.object_names import callable_name as __callable_name
from newrelic.common.object_wrapper import CallableObjectProxy as __CallableObjectProxy
from newrelic.common.object_wrapper import FunctionWrapper as __FunctionWrapper
Expand All @@ -143,6 +126,13 @@ def __asgi_application(*args, **kwargs):
from newrelic.common.object_wrapper import wrap_out_function as __wrap_out_function
from newrelic.common.object_wrapper import wrap_post_function as __wrap_post_function
from newrelic.common.object_wrapper import wrap_pre_function as __wrap_pre_function
from newrelic.config import extra_settings as __extra_settings
from newrelic.config import initialize as __initialize
from newrelic.core.agent import register_data_source as __register_data_source
from newrelic.core.agent import shutdown_agent as __shutdown_agent
from newrelic.core.config import global_settings as __global_settings
from newrelic.samplers.decorators import data_source_factory as __data_source_factory
from newrelic.samplers.decorators import data_source_generator as __data_source_generator

# EXPERIMENTAL - Generator traces are currently experimental and may not
# exist in this form in future versions of the agent.
Expand Down
155 changes: 0 additions & 155 deletions newrelic/common/_monotonic.c

This file was deleted.

2 changes: 1 addition & 1 deletion newrelic/common/package_version_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def int_or_str(value):
return version


@lru_cache()
@lru_cache
def _get_package_version(name):
module = sys.modules.get(name, None)
version = None
Expand Down
Loading