Skip to content

Commit

Permalink
Merge main into develop-graphql-async (#892)
Browse files Browse the repository at this point in the history
* Update Versioning Scheme (#651)

* Update versioning scheme to 3 semver digits

* Fix version indexing

Co-authored-by: Hannah Stepanek <hmstepanek@users.noreply.github.com>
Co-authored-by: Lalleh Rafeei <lrafeei@users.noreply.github.com>

* Remove version truncation

* [Mega-Linter] Apply linters fixes

* Bump tests

Co-authored-by: Hannah Stepanek <hmstepanek@users.noreply.github.com>
Co-authored-by: Lalleh Rafeei <lrafeei@users.noreply.github.com>
Co-authored-by: TimPansino <TimPansino@users.noreply.github.com>

* Fix Trace Finalizer Crashes (#652)

* Patch crashes in various traces with None settings

* Add tests for graphql trace types to unittests

* Add test to ensure traces don't crash in finalizer

* [Mega-Linter] Apply linters fixes

* Bump tests

Co-authored-by: TimPansino <TimPansino@users.noreply.github.com>
Co-authored-by: Lalleh Rafeei <84813886+lrafeei@users.noreply.github.com>

* Add usage tracking metrics for Kafka clients. (#658)

* Add usage tracking metrics for Kafka clients.

* Fix double import lint error

* [Mega-Linter] Apply linters fixes

* Create version util file and add metrics to consumer.

* Address linting errors.

* Add missing semi-colon.

* [Mega-Linter] Apply linters fixes

* Bump tests.

Co-authored-by: Hannah Stepanek <hstepanek@newrelic.com>
Co-authored-by: hmstepanek <hmstepanek@users.noreply.github.com>
Co-authored-by: umaannamalai <umaannamalai@users.noreply.github.com>

* Deprecate add_custom_parameter(s) API (#655)

* Deprecate add_custom_parameter(s) API

* Fix unicode tests and some pylint errors

* Fix more pylint errors

* Revert "Fix more pylint errors"

This reverts commit 807ec1c5c40fe421300ccdcd6fedd81f288dce2c.

* Edit deprecation message in add_custom_parameters

* Add usage metrics for Daphne and Hypercorn. (#665)

* Add usage metrics for Daphne and Hypercorn.

* [Mega-Linter] Apply linters fixes

Co-authored-by: umaannamalai <umaannamalai@users.noreply.github.com>

* Fix Flask view support in Code Level Metrics (#664)

* Fix Flask view support in Code Level Metrics

Co-authored-by: Lalleh Rafeei <lrafeei@users.noreply.github.com>
Co-authored-by: Hannah Stepanek <hmstepanek@users.noreply.github.com>
Co-authored-by: Uma Annamalai <umaannamalai@users.noreply.github.com>

* [Mega-Linter] Apply linters fixes

* Bump tests

* Fix CLM tests for flaskrest

* [Mega-Linter] Apply linters fixes

* Bump tests

Co-authored-by: Lalleh Rafeei <lrafeei@users.noreply.github.com>
Co-authored-by: Hannah Stepanek <hmstepanek@users.noreply.github.com>
Co-authored-by: Uma Annamalai <umaannamalai@users.noreply.github.com>
Co-authored-by: TimPansino <TimPansino@users.noreply.github.com>
Co-authored-by: Uma Annamalai <uannamalai@newrelic.com>

* Fix aioredis version crash (#661)

Co-authored-by: Uma Annamalai <uannamalai@newrelic.com>

* Add double wrapped testing for Hypercorn and Daphne and dispatcher argument to WSGI API.  (#667)

* Add double wrapped app tests.

* Fix linting errors.

* [Mega-Linter] Apply linters fixes

* Add co-authors.

Co-authored-by: Tim Pansino <tpansino@newrelic.com>
Co-authored-by: Lalleh Rafeei <lrafeei@newrelic.com>
Co-authored-by: Hannah Stepanek <hstepanek@newrelic.com>

Co-authored-by: umaannamalai <umaannamalai@users.noreply.github.com>
Co-authored-by: Tim Pansino <tpansino@newrelic.com>
Co-authored-by: Lalleh Rafeei <lrafeei@newrelic.com>
Co-authored-by: Hannah Stepanek <hstepanek@newrelic.com>

* Add Python 3.11 Support (#654)

* Add py311 tests

* Fix typo

* Added 3.11 support for aiohttp framework

Co-authored-by: Timothy Pansino <TimPansino@users.noreply.github.com>

* Set up environment to run Python 3.11

Co-authored-by: Timothy Pansino <TimPansino@users.noreply.github.com>

* Add Python 3.11 support for agent_features

Co-authored-by: Timothy Pansino <TimPansino@users.noreply.github.com>

* Partial Python 3.11 support added for Tornado

Co-authored-by: Timothy Pansino <TimPansino@users.noreply.github.com>

* Adjust postgres versions

* Fix tornado install path locally

* Remove aioredis py311 tests

* Update 3.11 to dev in tests

* Fix sanic instrumentation and imp/importlib deprecation

Co-authored-by: Timothy Pansino <TimPansino@users.noreply.github.com>

* Simplify wheel build options

* Update cibuildwheel for 3.11

* Remove falconmaster py311 test

Co-authored-by: Lalleh Rafeei <lrafeei@newrelic.com>
Co-authored-by: Timothy Pansino <TimPansino@users.noreply.github.com>

* Remove devcontainer submodule (#669)

* Uncomment NewRelicContextFormatter from agent.py (#676)

* Fix botocore tests for botocore v1.28.1+ (#675)

* Fix botocore tests for botocore v1.28.1+

Co-authored-by: Timothy Pansino <TimPansino@users.noreply.github.com>

* Fix boto3 tests for botocore v1.28.1+

Co-authored-by: Timothy Pansino <TimPansino@users.noreply.github.com>
Co-authored-by: Hannah Stepanek <hmstepanek@users.noreply.github.com>
Co-authored-by: Uma Annamalai <umaannamalai@users.noreply.github.com>

* Fix boto3 tests for python 2.7

Co-authored-by: Timothy Pansino <TimPansino@users.noreply.github.com>
Co-authored-by: Hannah Stepanek <hmstepanek@users.noreply.github.com>
Co-authored-by: Uma Annamalai <umaannamalai@users.noreply.github.com>

Co-authored-by: Timothy Pansino <TimPansino@users.noreply.github.com>
Co-authored-by: Hannah Stepanek <hmstepanek@users.noreply.github.com>
Co-authored-by: Uma Annamalai <umaannamalai@users.noreply.github.com>
Co-authored-by: Timothy Pansino <11214426+TimPansino@users.noreply.github.com>

* Feature increased custom event limit (#674)

* Update reservoir size for custom events.

* [Mega-Linter] Apply linters fixes

* Increase custom event limit. (#666)

* Remove duplicated CUSTOM_EVENT_RESERVOIR_SIZE

Co-authored-by: Tim Pansino <timpansino@gmail.com>
Co-authored-by: TimPansino <TimPansino@users.noreply.github.com>
Co-authored-by: Timothy Pansino <11214426+TimPansino@users.noreply.github.com>
Co-authored-by: Uma Annamalai <uannamalai@newrelic.com>

* Add python 3.11 stable release to GHA (#671)

* Double kafka test runners (#677)

Co-authored-by: Hannah Stepanek <hstepanek@newrelic.com>

* Fix failing flask_rest tests (#683)

* Pin flask-restx in flask_rest tests for 2.7

flask-restx dropped support for 2.7 in 1.0.1.

* Drop support for flask-restplus

flask-restx replaced flask-restplus. flask-restplus's latest version supports 3.6 which
we don't even support anymore.

* Fix failing botocore tests (#684)

* Change queue url for botocore>=1.29.0

botocore >=1.29.0 uses sqs.us-east-1.amazonaws.com url instead of queue.amazonaws.com.

* Use tuple version instead of str

* Change botocore129->botocore128

* Add record_log_event to public api (#681)

* Add patch for sentry SDK to correct ASGI v2/v3 detection. (#680)

* Add patch for sentry to correct ASGI v2/v3 detection.

Co-authored-by: Tim Pansino <tpansino@newrelic.com>
Co-authored-by: Lalleh Rafeei <lrafeei@newrelic.com>
Co-authored-by: Hannah Stepanek <hstepanek@newrelic.com>

* [Mega-Linter] Apply linters fixes

Co-authored-by: Tim Pansino <tpansino@newrelic.com>
Co-authored-by: Lalleh Rafeei <lrafeei@newrelic.com>
Co-authored-by: Hannah Stepanek <hstepanek@newrelic.com>
Co-authored-by: umaannamalai <umaannamalai@users.noreply.github.com>
Co-authored-by: Timothy Pansino <11214426+TimPansino@users.noreply.github.com>

* Update pip install command (#688)

* Validator transfer from fixtures.py to validators directory, Part 1 (#672)

* Move validate_transaction_metrics to validators directory

* Comment out original validate_transaction_metrics from fixtures.py

* Move validate_time_metrics_outside_transaction to validators directory

* Move validate_internal_metrics into validators directory and fixed validate_transaction_metrics

* Move validate_transaction_errors into validators directory

* Move validate_application_errors into validators directory

* Move validate_custom_parameters into validators directory

* Move validate_synthetics_event into validators directory

* Move validate_transaction_event_attributes into validators directory

* Move validate_non_transaction_error_event into validators directory

* Fix import issues

* Fix (more) import issues

* Fix validate_transaction_metrics import in aioredis

* Remove commented code from fixtures.py

* Initialize ExternalNode properties (#687)

Co-authored-by: Hannah Stepanek <hstepanek@newrelic.com>

* Fix package_version_utils.py logic (#689)

* Fix package_version_utils.py logic

Co-authored-by: Timothy Pansino <TimPansino@users.noreply.github.com>
Co-authored-by: Hannah Stepanek <hmstepanek@users.noreply.github.com>
Co-authored-by: Uma Annamalai <umaannamalai@users.noreply.github.com>

* Move description of func into func itself

* typecast lists into tuples

* Remove breakpoints

* Empty _test_package_version_utils.py

* Make changes to the test

Co-authored-by: Timothy Pansino <TimPansino@users.noreply.github.com>
Co-authored-by: Hannah Stepanek <hmstepanek@users.noreply.github.com>
Co-authored-by: Uma Annamalai <umaannamalai@users.noreply.github.com>

* Pin Github Actions Runner to Ubuntu 20 for Py27 (#698)

* Pin Github Actions runner to ubuntu 20 for Py27

* Upgrade setup-python

* Fix Confluent Kafka Producer Arguments (#699)

* Add confluentkafka test for posargs/kwargs

* Fix confluent kafka topic argument bug

* More sensible producer arguments

* Fix tornado master tests & instrument redis 4.3.5 (#695)

* Remove 3.7 testing of tornado master

tornadomaster dropped support for 3.7

* Instrument new redis 4.3.5 client methods

Co-authored-by: Lalleh Rafeei <84813886+lrafeei@users.noreply.github.com>
Co-authored-by: Timothy Pansino <11214426+TimPansino@users.noreply.github.com>

* Remove pylint codes from flake8 config (#701)

* Validator transfer from fixtures.py to validators directory, Part 2 (#690)

* Move validate_transaction_metrics to validators directory

* Comment out original validate_transaction_metrics from fixtures.py

* Move validate_time_metrics_outside_transaction to validators directory

* Move validate_internal_metrics into validators directory and fixed validate_transaction_metrics

* Move validate_transaction_errors into validators directory

* Move validate_application_errors into validators directory

* Move validate_custom_parameters into validators directory

* Move validate_synthetics_event into validators directory

* Move validate_transaction_event_attributes into validators directory

* Move validate_non_transaction_error_event into validators directory

* Move validate_application_error_trace_count into validators directory

* Move validate_application_error_event_count into validators directory

* Move validate_synthetics_transaction_trace into validators directory

* Move validate_tt_collector_json to validators directory

* Move validate_transaction_trace_attributes into validator directory

* Move validate_transaction_error_trace_attributes into validator directory

* Move validate_error_trace_collector_json into validator directory

* Move validate_error_event_collector_json into validator directory

* Move validate_transaction_event_collector_json into validator directory

* Fix import issues from merge

* Fix some pylint errors

* Revert 'raise ValueError' to be PY2 compatible

* Delete commented lines

* Fix bug in celery where works don't report data (#696)

This fixes Missing information from Celery workers when using MAX_TASKS_PER_CHILD
issue.

Previously, if celery was run with the --loglevel=INFO flag, an agent instance would be
created for the main celery process and after the first worker shutdown, all following
worker's agent instances would point to that agent instance instead of creating a new
instance. This was root caused to incorrectly creating an agent instance when
application activate was not set. Now no agent instance will be created for the main
celery process.

* Reverts removal of flask_restful hooks. (#705)

* Update instrumented methods in redis. (#707)

Co-authored-by: Lalleh Rafeei <lrafeei@users.noreply.github.com>
Co-authored-by: Uma Annamalai <umaannamalai@users.noreply.github.com>
Co-authored-by: Hannah Stepanek <hmstepanek@users.noreply.github.com>

Co-authored-by: Lalleh Rafeei <lrafeei@users.noreply.github.com>
Co-authored-by: Uma Annamalai <umaannamalai@users.noreply.github.com>
Co-authored-by: Hannah Stepanek <hmstepanek@users.noreply.github.com>

* Add TraceCache Guarded Iteration (#704)

* Add MutableMapping API to TraceCache

* Update trace cache usage to use guarded APIs.

* [Mega-Linter] Apply linters fixes

* Bump tests

* Fix keys iterator

* Comments for trace cache methods

* Reorganize tests

* Fix fixture refs

* Fix testing refs

* [Mega-Linter] Apply linters fixes

* Bump tests

* Upper case constant

Co-authored-by: TimPansino <TimPansino@users.noreply.github.com>
Co-authored-by: Lalleh Rafeei <84813886+lrafeei@users.noreply.github.com>

* Fix Type Constructor Classes in Code Level Metrics (#708)

* Fix CLM exception catching

* Reorganize CLM Tests

* Add type constructor tests to CLM

* Fix line number

* Pin tox version

* Fix lambda tests in CLM

* Fix lint issues

* Turn helper func into pytest fixture

Co-authored-by: Hannah Stepanek <hstepanek@newrelic.com>

* Fix sanic and starlette tests (#734)

* Fix sanic tests

* Tweak test fix for sanic

* Remove test for v18.12 in sanic (no longer supported)

* Pin starlette latest to v0.23.1 (for now)

* Add comment in tox about pinned starlette version

* Add methods to instrument (#738)

* Add card to instrumented methods in Redis (#740)

* Add DevContainer (#711)

* Add devcontainer setup

* Add newrelic env vars to passenv

* Add default extensions

* Add devcontainer instructions to contributing docs

* Convert smart quotes in contributing docs.

* Apply proper RST formatting

* [Mega-Linter] Apply linters fixes

* Add GHCR to prerequisites

* [Mega-Linter] Apply linters fixes

* Bump tests

Co-authored-by: TimPansino <TimPansino@users.noreply.github.com>

* Module classmethod fix (#662)

* Fix function_wrapper calls to module

* Fix wrapper in pika hook

* Revert elasticsearch instrumentation

* Revert some wrap_function_wrappers to orig

* Remove comments/breakpoints

* Fix hooks in elasticsearch

Co-authored-by: Timothy Pansino <11214426+TimPansino@users.noreply.github.com>

* Fix log decorating to be JSON compatible (#736)

* Initial addition of JSON capability

* Add NR-LINKING metadata JSON combatibility

* Remove breakpoint

* Hardcode local log decorating tests

* Tweak linking metatdata parsing/adding

* Revert "Fix log decorating to be JSON compatible" (#746)

* Revert "Fix log decorating to be JSON compatible (#736)"

This reverts commit 0db5fee1e5d44b0791dc517ac9f5d88d1240a340.

* [Mega-Linter] Apply linters fixes

* Trigger tests

Co-authored-by: hmstepanek <hmstepanek@users.noreply.github.com>

* Add apdexPerfZone attribute to Transaction. (#753)

Co-authored-by: Enriqueta De Leon <deleonenriqueta@users.noreply.github.com>
Co-authored-by: Kate Anderson <kanderson250@users.noreply.github.com>
Co-authored-by: Mary Martinez <mary-martinez@users.noreply.github.com>

Co-authored-by: Enriqueta De Leon <deleonenriqueta@users.noreply.github.com>
Co-authored-by: Kate Anderson <kanderson250@users.noreply.github.com>
Co-authored-by: Mary Martinez <mary-martinez@users.noreply.github.com>
Co-authored-by: Hannah Stepanek <hstepanek@newrelic.com>

* Fix tests in starlette v0.23.1 (#752)

* Fix tests in starlette v0.23.1

* Fix conditional tests

* Add comment to bg_task test

* Support `redis.asyncio` (#744)

* Support `redis.asyncio`

* Fix `flake8` issues

Co-authored-by: Timothy Pansino <11214426+TimPansino@users.noreply.github.com>

* Redis Asyncio Testing (#750)

* Add standardized method for package version tuples

* Adapt aioredis tests to redis.asyncio

* Standardize version tuple

* Refresh uninstrumented redis methods

* Fix aioredis version checking

* Remove aioredis version function

* CodeCov Integration (#710)

* Add aggregate coverage settings to tox.ini

* Refactor coverage fixture for GHA

* Send coverage data files

* Linter fixes

* Configure codecov report

* Yield cov handle from fixture

* Fix empty coverage fixture

* Specify artifact download dir

* Find coverage files with find command

* Add concurrency cancelling to github actions

* uncomment test deps

* Fix or symbol

* Fix concurrency groups

* Linter fixes

* Add comment for yield None in fixture

* [Mega-Linter] Apply linters fixes

* Bump Tests

---------

Co-authored-by: TimPansino <TimPansino@users.noreply.github.com>

* Mergify (#761)

* Add mergify config file

* Remove priority

* Clean up mergify rules

* Add non-draft requirement for merge

* Add merge method

* [Mega-Linter] Apply linters fixes

* Don't update draft PRs.

* Remove merge rules for develop branches

* Linting

---------

Co-authored-by: TimPansino <TimPansino@users.noreply.github.com>

* Elasticsearch v8 support (#741)

* Fix function_wrapper calls to module

* Fix wrapper in pika hook

* Revert elasticsearch instrumentation

* Revert some wrap_function_wrappers to orig

* Remove comments/breakpoints

* Fix hooks in elasticsearch

* Add new client methods from v8 and their hooks

* Add elasticsearch v8 to workflow and tox

* Fix indices for elasticsearch01

* Disable xpack security in elasticsearch v8.0

* Start to add try/except blocks in tests

* Add support for v8 transport

* add support for v8 connection

* Add tests-WIP

* Clean up most tests

* Clean up unused instrumentation

Co-authored-by: Lalleh Rafeei <lrafeei@users.noreply.github.com>
Co-authored-by: Enriqueta De Leon <deleonenriqueta@users.noreply.github.com>
Co-authored-by: Uma Annamalai <umaannamalai@users.noreply.github.com>
Co-authored-by: Kate Anderson <kanderson250@users.noreply.github.com>
Co-authored-by: Mary Martinez <mary.diana.martinez@gmail.com>
Co-authored-by: Hannah Stepanek <hmstepanek@users.noreply.github.com>

* Remove elastic search source code

* Elasticsearch v8 testing

Co-authored-by: Lalleh Rafeei <lrafeei@users.noreply.github.com>
Co-authored-by: Enriqueta De Leon <deleonenriqueta@users.noreply.github.com>
Co-authored-by: Uma Annamalai <umaannamalai@users.noreply.github.com>
Co-authored-by: Kate Anderson <kanderson250@users.noreply.github.com>
Co-authored-by: Mary Martinez <mary.diana.martinez@gmail.com>
Co-authored-by: Hannah Stepanek <hmstepanek@users.noreply.github.com>

* Scope ES fixture

* ES v8 only supports Python3.6+

* Refactor transport tests for v8

Co-authored-by: Lalleh Rafeei <lrafeei@users.noreply.github.com>
Co-authored-by: Uma Annamalai <umaannamalai@users.noreply.github.com>
Co-authored-by: Hannah Stepanek <hmstepanek@users.noreply.github.com>
Co-authored-by: Kate Anderson <kanderson250@users.noreply.github.com>
Co-authored-by: Enriqueta De Leon <deleonenriqueta@users.noreply.github.com>

* Remove extra comments

* Added perform_request_kwargs to test_transport

* Fix some linter issues

* Remove extra newline

* Group es v7 v8 process modules together

* Add auto signature detection & binding

* Use bind_arguments in ES

* Add test for wrapped function

* Add validator for datastore trace inputs

* Use common bind_arguments for PY3

* Fix tests in starlette v0.23.1 (#752)

* Fix tests in starlette v0.23.1

* Fix conditional tests

* Add comment to bg_task test

* Split below es 8 methods from es 8 methods

Note the previous tests in this file to check whether a method was instrumented, did not test anything because they were checking whether the list
of methods that we instrumented were instrumented instead of whether
there were uninstrumented methods on the es client that we missed.

Because we decided due to lack of reporting of bugs by our customers, to not support the buggy wrapping on previous es versions (below es8), we
only added tests to assert all methods were wrapped from es8+. We also
are only testing es8+ wrapping of methods since the previous versions
wrapping behavior may not have been correct due to the signature of the
methods changing without us detecting it due to lack of tests. Since our customers have not reported any issues, it seems not worth it at this time to go back and fix these bugs.

* Remove signature auto detection implementation

* Fixup: remove signature autodetection

* Fixup: cleanup

* Test method calls on all es versions

* Fixup: don't run some methods on es7

---------

Co-authored-by: Timothy Pansino <11214426+TimPansino@users.noreply.github.com>
Co-authored-by: mary-martinez <mmartinez@newrelic.com>
Co-authored-by: enriqueta <edeleon@newrelic.com>
Co-authored-by: Tim Pansino <timpansino@gmail.com>
Co-authored-by: Lalleh Rafeei <lrafeei@users.noreply.github.com>
Co-authored-by: Enriqueta De Leon <deleonenriqueta@users.noreply.github.com>
Co-authored-by: Uma Annamalai <umaannamalai@users.noreply.github.com>
Co-authored-by: Kate Anderson <kanderson250@users.noreply.github.com>
Co-authored-by: Mary Martinez <mary.diana.martinez@gmail.com>
Co-authored-by: Hannah Stepanek <hmstepanek@users.noreply.github.com>
Co-authored-by: Hannah Stepanek <hstepanek@newrelic.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

* Update contributors workspace link in CONTRIBUTING.rst. (#760)

* Update link in CONTRIBUTING.rst.

* Update to RST syntax.

* [Mega-Linter] Apply linters fixes

---------

Co-authored-by: umaannamalai <umaannamalai@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

* Add Retry to Pip Install (#763)

* Add retry to pip install

* Fix retry backoff constant

* Fix script failures

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

* Add aiohttp support for expected status codes (#735)

* Add aiohttp support for expected status codes

* Adjust naming convention

* Fix expected tests for new validator behavior

---------

Co-authored-by: Timothy Pansino <11214426+TimPansino@users.noreply.github.com>
Co-authored-by: Tim Pansino <timpansino@gmail.com>

* Fix PyPy Priority Sampling Test (#766)

* Fix pypy priority sampling

* [Mega-Linter] Apply linters fixes

* Bump tests

---------

Co-authored-by: TimPansino <TimPansino@users.noreply.github.com>

* Config linter fixes (#768)

* Fix default value and lazy logging pylint

* Fix default value and lazy logging pylint

* Fix unnecessary 'else' in pylint

* Fix logging-not-lazy in pylint

* Fix redefined built-in error in Pylint

* Fix implicit string concatenation in Pylint

* Fix dict() to {} in Pylint

* Make sure eval is OK to use for Pylint

* Fix logging format string for Pylint

* Change list comprehension to generator expression

* [Mega-Linter] Apply linters fixes

* Rerun tests

---------

Co-authored-by: lrafeei <lrafeei@users.noreply.github.com>

* Sync tests w/ agents/cross_agent_tests/pull/150 (#770)

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

* Infinite Tracing Batching & Compression (#762)

* Infinite Tracing Batching and Compression settings (#756)

* Add compression setting

* Add batching setting

* Infinite Tracing Compression (#758)

* Initial commit

* Add compression option in StreamingRPC

* Add compression default to tests

* Add test to confirm compression settings

* Remove commented out code

* Set compression settings from settings override

* Infinite Tracing Batching (#759)

* Initial infinite tracing batching implementation

* Add RecordSpanBatch method to mock grpc server

* Span batching settings and testing.

Co-authored-by: Lalleh Rafeei <lrafeei@users.noreply.github.com>
Co-authored-by: Hannah Stepanek <hmstepanek@users.noreply.github.com>
Co-authored-by: Uma Annamalai <umaannamalai@users.noreply.github.com>

* Add final 8t batching tests

* Rename serialization test

* Formatting

* Guard unittests from failing due to batching

* Linting

* Simplify batching algorithm

* Properly wire batching parametrization

* Fix incorrect validator use

* Data loss on reconnect regression testing

Co-authored-by: Uma Annamalai <umaannamalai@users.noreply.github.com>
Co-authored-by: Hannah Stepanek <hmstepanek@users.noreply.github.com>

* Test stream buffer batch sizes

* Fix logic in supportability metrics for spans

* Clean up nested conditionals in stream buffer

* Compression parametrization in serialization test

* Formatting

* Update 8t test_no_delay_on_ok

* Update protobufs

* Remove unnecessary patching from test

* Fix waiting in supportability metric tests

* Add sleep to waiting in test

* Reorder sleep and condition check

* Mark no data loss xfail for py2.

* Fix conditional check

* Fix flake8 linter issues

---------

Co-authored-by: Lalleh Rafeei <lrafeei@users.noreply.github.com>
Co-authored-by: Hannah Stepanek <hmstepanek@users.noreply.github.com>
Co-authored-by: Uma Annamalai <umaannamalai@users.noreply.github.com>
Co-authored-by: Hannah Stepanek <hstepanek@newrelic.com>

* Infinite Tracing Supportability Feature Toggle Metrics (#769)

* Add 8T feature toggle supportability metrics

* Remove supportability metrics when 8t is disabled.

* Formatting

---------

Co-authored-by: Lalleh Rafeei <84813886+lrafeei@users.noreply.github.com>
Co-authored-by: Lalleh Rafeei <lrafeei@users.noreply.github.com>
Co-authored-by: Hannah Stepanek <hmstepanek@users.noreply.github.com>
Co-authored-by: Uma Annamalai <umaannamalai@users.noreply.github.com>
Co-authored-by: Hannah Stepanek <hstepanek@newrelic.com>

* Fix DT settings for txn feature tests (#771)

* Fix pyramid testing versions (#764)

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

* Fix Ariadne Middleware Testing (#776)

* Fix ariadne middleware testing

Co-authored-by: Uma Annamalai <umaannamalai@users.noreply.github.com>
Co-authored-by: Lalleh Rafeei <lrafeei@users.noreply.github.com>

* [Mega-Linter] Apply linters fixes

* Bump tests

---------

Co-authored-by: Uma Annamalai <umaannamalai@users.noreply.github.com>
Co-authored-by: Lalleh Rafeei <lrafeei@users.noreply.github.com>
Co-authored-by: TimPansino <TimPansino@users.noreply.github.com>

* Exclude merged PRs from automatic mergify actions. (#774)

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

* Refactor Code Coverage (#765)

* Reorder dependency of code coverage fixture

* Fix tests with coverage disabled

* Refactor code coverage fixture

* Clean out old coverage settings

* Fix missing code coverage fixture

* Fix pypy priority sampling

* Start coverage from pytest-cov for better tracking

* Refactor coverage config file

* Ripping out coverage fixtures

* Move tool config to bottom of tox.ini

* Disabling py27 warning

* Renaming env var

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

* Add GraphQL Introspection Setting (#783)

* Add graphql introspection setting

* Sort settings object hierarchy

* Add test for introspection queries setting

* Expand introspection queries testing

* [Mega-Linter] Apply linters fixes

* Adjust introspection detection for graphql

---------

Co-authored-by: TimPansino <TimPansino@users.noreply.github.com>

* Fix instance info tests for redis. (#784)

* Fix instance info tests for redis.

* [Mega-Linter] Apply linters fixes

---------

Co-authored-by: umaannamalai <umaannamalai@users.noreply.github.com>

* Fix Redis Instance Info (#790)

* Fix failing redis test for new default behavior

* Revert "Fix instance info tests for redis. (#784)"

This reverts commit f7108e3c2a54ab02a1104f6c16bd5fd799b9fc7e.

* Guard GraphQL Settings Lookup (#787)

* Guard graphql settings lookup

* [Mega-Linter] Apply linters fixes

* Bump tests

* Update graphql settings test

---------

Co-authored-by: TimPansino <TimPansino@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

* Errors Inbox Improvements (#791)

* Errors inbox attributes and tests (#778)

* Initial errors inbox commit

Co-authored-by: Timothy Pansino <TimPansino@users.noreply.github.com>
Co-authored-by: Hannah Stepanek <hmstepanek@users.noreply.github.com>
Co-authored-by: Uma Annamalai <umaannamalai@users.noreply.github.com>

* Add enduser.id field

* Move validate_error_trace_attributes into validators directory

* Add error callback attributes test

* Add tests for enduser.id & error.group.name

Co-authored-by: Timothy Pansino <TimPansino@users.noreply.github.com>

* Uncomment code_coverage

* Drop commented out line

---------

Co-authored-by: Timothy Pansino <TimPansino@users.noreply.github.com>
Co-authored-by: Hannah Stepanek <hmstepanek@users.noreply.github.com>
Co-authored-by: Uma Annamalai <umaannamalai@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Timothy Pansino <11214426+TimPansino@users.noreply.github.com>

* Error Group Callback API (#785)

* Error group initial implementation

* Rewrite error callback to pass map of info

* Fixed incorrect validators causing errors

Co-authored-by: Uma Annamalai <umaannamalai@users.noreply.github.com>
Co-authored-by: Hannah Stepanek <hmstepanek@users.noreply.github.com>

* Fix validation of error trace attributes

* Expanded error callback test

* Add incorrect type to error callback testing

* Change error group callback to private setting

* Add testing for error group callback inputs

* Separate error group callback tests

* Add explicit testing for the set API

* Ensure error group is string

* Fix python 2 type validation

---------

Co-authored-by: Uma Annamalai <umaannamalai@users.noreply.github.com>
Co-authored-by: Hannah Stepanek <hmstepanek@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

* User Tracking for Errors Inbox (#789)

* Add user tracking feature for errors inbox.

* Address review comments,

* Add high_security test.

* Cleanup invalid tests test.

* Update user_id string check.

* Remove set_id outside txn test.

---------

Co-authored-by: Timothy Pansino <11214426+TimPansino@users.noreply.github.com>

---------

Co-authored-by: Lalleh Rafeei <84813886+lrafeei@users.noreply.github.com>
Co-authored-by: Timothy Pansino <TimPansino@users.noreply.github.com>
Co-authored-by: Hannah Stepanek <hmstepanek@users.noreply.github.com>
Co-authored-by: Uma Annamalai <umaannamalai@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Uma Annamalai <uannamalai@newrelic.com>

* Update Packages (#793)

* Update urllib3 to v1.26.15

* Update six to v1.16.0

* Update coverage exclude for newrelic/packages

* [Mega-Linter] Apply linters fixes

* Drop removed package from urllib3

* Update pytest

* Downgrade websockets version for old sanic testing

---------

Co-authored-by: TimPansino <TimPansino@users.noreply.github.com>

* Remove Unused Instrumentation and Tests (#794)

* Remove unused instrumentation files

* Remove testing for deprecated CherryPy versions

* Remove unused pyelasticsearch tests

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

* Fix Loguru Instrumentation for v0.7.0 (#798)

* Add autosignature implementation

* Fix loguru with auto-signature

* [Mega-Linter] Apply linters fixes

* Fix tests for Py2

* [Mega-Linter] Apply linters fixes

* Bump tests

* Remove unwrap from signature utils

* Fix arg unpacking

* Remove unwrap arg from bind_args

* Fix linter errors

---------

Co-authored-by: TimPansino <TimPansino@users.noreply.github.com>
Co-authored-by: Lalleh Rafeei <lrafeei@newrelic.com>

* Remove Twisted framework (#800)

* Initial twisted commit

* Remove Twisted Framework

* Pin virtualenv, fix pip arg deprecation & disable kafka tests (#803)

* Pin virtualenv

* Fixup: use 20.21.1 instead

* Replace install-options with config-settings

See https://github.com/pypa/pip/issues/11358.

* Temporarily disable kafka tests

* Add tests for pyodbc (#796)

* Add tests for pyodbc

* Move imports into tests to get import coverage

* Fixup: remove time import

* Trigger tests

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

* Add tests for Waitress (#797)

* Change import format

* Initial commit

* Add more tests to adapter_waitress

* Remove commented out code

* [Mega-Linter] Apply linters fixes

* Add assertions to all tests

* Add more NR testing to waitress

---------

Co-authored-by: lrafeei <lrafeei@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

* Add testing for genshi and mako. (#799)

* Add testing for genshi and mako.

* [Mega-Linter] Apply linters fixes

---------

Co-authored-by: umaannamalai <umaannamalai@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

* Omit some frameworks from coverage analysis (#810)

* Omit some frameworks from coverage analysis

* Remove commas

* Change format of omit

* Add relative_files option to coverage

* Add absolute directory

* Add envsitepackagedir

* Add coveragerc file

* Add codecov.yml

* [Mega-Linter] Apply linters fixes

* Revert coveragerc file settings

* Add files in packages and more frameworks

* Remove commented line

---------

Co-authored-by: lrafeei <lrafeei@users.noreply.github.com>
Co-authored-by: Hannah Stepanek <hstepanek@newrelic.com>

* Run coverage around pytest (#813)

* Run coverage around pytest

* Trigger tests

* Fixup

* Add redis client_no_touch to ignore list

* Temporarily remove kafka from coverage

* Remove coverage for old libs

* Add required option for tox v4 (#795)

* Add required option for tox v4

* Update tox in GHA

* Remove py27 no-cache-dir

* Fix Testing Failures (#828)

* Fix tastypie tests

* Adjust asgiref pinned version

* Make aioredis key PID unique

* Pin more asgiref versions

* Fix pytest test filtering when running tox (#823)

Co-authored-by: Uma Annamalai <uannamalai@newrelic.com>

* Validator transfer p3 (#745)

* Move validate_transaction_metrics to validators directory

* Comment out original validate_transaction_metrics from fixtures.py

* Move validate_time_metrics_outside_transaction to validators directory

* Move validate_internal_metrics into validators directory and fixed validate_transaction_metrics

* Move validate_transaction_errors into validators directory

* Move validate_application_errors into validators directory

* Move validate_custom_parameters into validators directory

* Move validate_synthetics_event into validators directory

* Move validate_transaction_event_attributes into validators directory

* Move validate_non_transaction_error_event into validators directory

* Move validate_application_error_trace_count into validators directory

* Move validate_application_error_event_count into validators directory

* Move validate_synthetics_transaction_trace into validators directory

* Move validate_tt_collector_json to validators directory

* Move validate_transaction_trace_attributes into validator directory

* Move validate_transaction_error_trace_attributes into validator directory

* Move validate_error_trace_collector_json into validator directory

* Move validate_error_event_collector_json into validator directory

* Move validate_transaction_event_collector_json into validator directory

* Move validate_custom_event_collector_json into validator directory

* Move validate_tt_parameters into validator directory

* Move validate_tt_parameters into validator directory

* Move validate_tt_segment_params into validator directory

* Move validate_browser_attributes into validators directory

* Move validate_error_event_attributes into validators directory

* Move validate_error_trace_attributes_outside_transaction into validators directory

* Move validate_error_event_attributes_outside_transaction into validators directory

* Fix some pylint errors

* Redirect check_error_attributes

* Fix more Pylint errors

* Fix import issues from move

* Fix more import shuffle errors

* Sort logging JSON test for PY2 consistency

* Fix Pylint errors in validators

* Fix import error

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

* Fix set output warning using new GHA syntax (#833)

* Fix set output warning using new GHA syntax

* Fix quoting

* Remove Python 2.7 and pypy2 testing (#835)

* Change setup-python to @v2 for py2.7

* Remove py27 and pypy testing

* Fix syntax errors

* Fix comma related syntax errors

* Fix more issues in tox

* Remove gearman test

* Containerized CI Pipeline (#836)

* Revert "Remove Python 2.7 and pypy2 testing (#835)"

This reverts commit abb6405d2bfd629ed83f48e8a17b4a28e3a3c352.

* Containerize CI process

* Publish new docker container for CI images

* Rename github actions job

* Copyright tag scripts

* Drop debug line

* Swap to new CI image

* Move pip install to just main python

* Remove libcurl special case from tox

* Install special case packages into main image

* Remove unused packages

* Remove all other triggers besides manual

* Add make run command

* Cleanup small bugs

* Fix CI Image Tagging (#838)

* Correct templated CI image name

* Pin pypy2.7 in image

* Fix up scripting

* Temporarily Restore Old CI Pipeline (#841)

* Restore old pipelines

* Remove python 2 from setup-python

* Rework CI Pipeline (#839)

Change pypy to pypy27 in tox.

Fix checkout logic

Pin tox requires

* Fix Tests on New CI (#843)

* Remove non-root user

* Test new CI image

* Change pypy to pypy27 in tox.

* Fix checkout logic

* Fetch git tags properly

* Pin tox requires

* Adjust default db settings for github actions

* Rename elasticsearch services

* Reset to new pipelines

* [Mega-Linter] Apply linters fixes

* Fix timezone

* Fix docker networking

* Pin dev image to new sha

* Standardize gearman DB settings

* Fix elasticsearch settings bug

* Fix gearman bug

* Add missing odbc headers

* Add more debug messages

* Swap out dev ci image

* Fix required virtualenv version

* Swap out dev ci image

* Swap out dev ci image

* Remove aioredis v1 for EOL

* Add coverage paths for docker container

* Unpin ci container

---------

Co-authored-by: TimPansino <TimPansino@users.noreply.github.com>

* Instrument Redis waitaof (#851)

* Add uninstrumented command to redis

* Update logic for datastore_aioredis instance info

* [Mega-Linter] Apply linters fixes

* Bump tests

* Update defaults for aioredis port

---------

Co-authored-by: TimPansino <TimPansino@users.noreply.github.com>

* Ignore patched hooks files. (#849)

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

* Fix local scoped package reporting (#837)

* Include isort stdlibs for determining stdlib modules

* Use isort & sys to eliminate std & builtin modules

Previously, the logic would fail to identify third party modules installed within the
local user socpe. This fixes that issue by skipping builtin and stdlib modules by name,
instead of attempting to identify third party modules based on file paths.

* Handle importlib_metadata.version being a callable

* Add isort into third party notices

* [Mega-Linter] Apply linters fixes

* Remove Python 2.7 and pypy2 testing (#835)

* Change setup-python to @v2 for py2.7

* Remove py27 and pypy testing

* Fix syntax errors

* Fix comma related syntax errors

* Fix more issues in tox

* Remove gearman test

* Containerized CI Pipeline (#836)

* Revert "Remove Python 2.7 and pypy2 testing (#835)"

This reverts commit abb6405d2bfd629ed83f48e8a17b4a28e3a3c352.

* Containerize CI process

* Publish new docker container for CI images

* Rename github actions job

* Copyright tag scripts

* Drop debug line

* Swap to new CI image

* Move pip install to just main python

* Remove libcurl special case from tox

* Install special case packages into main image

* Remove unused packages

* Remove all other triggers besides manual

* Add make run command

* Cleanup small bugs

* Fix CI Image Tagging (#838)

* Correct templated CI image name

* Pin pypy2.7 in image

* Fix up scripting

* Temporarily Restore Old CI Pipeline (#841)

* Restore old pipelines

* Remove python 2 from setup-python

* Rework CI Pipeline (#839)

Change pypy to pypy27 in tox.

Fix checkout logic

Pin tox requires

* Fix Tests on New CI (#843)

* Remove non-root user

* Test new CI image

* Change pypy to pypy27 in tox.

* Fix checkout logic

* Fetch git tags properly

* Pin tox requires

* Adjust default db settings for github actions

* Rename elasticsearch services

* Reset to new pipelines

* [Mega-Linter] Apply linters fixes

* Fix timezone

* Fix docker networking

* Pin dev image to new sha

* Standardize gearman DB settings

* Fix elasticsearch settings bug

* Fix gearman bug

* Add missing odbc headers

* Add more debug messages

* Swap out dev ci image

* Fix required virtualenv version

* Swap out dev ci image

* Swap out dev ci image

* Remove aioredis v1 for EOL

* Add coverage paths for docker container

* Unpin ci container

---------

Co-authored-by: TimPansino <TimPansino@users.noreply.github.com>

* Trigger tests

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: hmstepanek <hmstepanek@users.noreply.github.com>
Co-authored-by: Lalleh Rafeei <84813886+lrafeei@users.noreply.github.com>
Co-authored-by: Timothy Pansino <11214426+TimPansino@users.noreply.github.com>
Co-authored-by: TimPansino <TimPansino@users.noreply.github.com>
Co-authored-by: Uma Annamalai <uannamalai@newrelic.com>

* MSSQL Testing (#852)

* For mysql tests into mssql

* Add tox envs for mssql

* Add mssql DB settings

* Add correct MSSQL tests

* Add mssql to GHA

* Add MSSQL libs to CI image

* Pin to dev CI image sha

* Swap SQLServer container image

* Fix healthcheck

* Put MSSQL image back

* Drop pypy37 tests

* Unpin dev image sha

* Exclude command line functionality from test coverage (#855)

* FIX: resilient environment settings (#825)

if the application uses generalimport to manage optional depedencies,
it's possible that generalimport.MissingOptionalDependency is raised.
In this case, we should not report the module as it is not actually loaded and
is not a runtime dependency of the application.

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Hannah Stepanek <hstepanek@newrelic.com>

* Replace drop_transaction logic by using transaction context manager (#832)

* Replace drop_transaction call

* [Mega-Linter] Apply linters fixes

* Empty commit to start tests

* Change logic in BG Wrappers

---------

Co-authored-by: lrafeei <lrafeei@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

* Upgrade to Pypy38 for TypedDict (#861)

* Fix base branch

* Revert tox dependencies

* Replace all pypy37 with pypy38

* Remove action.yml file

* Push Empty Commit

* Fix skip_missing_interpreters behavior

* Fix skip_missing_interpreters behavior

* Pin dev CI image sha

* Remove unsupported Tornado tests

* Add latest tests to Tornado

* Remove pypy38 (for now)

---------

Co-authored-by: Tim Pansino <timpansino@gmail.com>

* Add profile_trace testing (#858)

* Include isort stdlibs for determining stdlib modules

* Use isort & sys to eliminate std & builtin modules

Previously, the logic would fail to identify third party modules installed within the
local user socpe. This fixes that issue by skipping builtin and stdlib modules by name,
instead of attempting to identify third party modules based on file paths.

* Handle importlib_metadata.version being a callable

* Add isort into third party notices

* [Mega-Linter] Apply linters fixes

* Remove Python 2.7 and pypy2 testing (#835)

* Change setup-python to @v2 for py2.7

* Remove py27 and pypy testing

* Fix syntax errors

* Fix comma related syntax errors

* Fix more issues in tox

* Remove gearman test

* Containerized CI Pipeline (#836)

* Revert "Remove Python 2.7 and pypy2 testing (#835)"

This reverts commit abb6405d2bfd629ed83f48e8a17b4a28e3a3c352.

* Containerize CI process

* Publish new docker container for CI images

* Rename github actions job

* Copyright tag scripts

* Drop debug line

* Swap to new CI image

* Move pip install to just main python

* Remove libcurl special case from tox

* Install special case packages into main image

* Remove unused packages

* Remove all other triggers besides manual

* Add make run command

* Cleanup small bugs

* Fix CI Image Tagging (#838)

* Correct templated CI image name

* Pin pypy2.7 in image

* Fix up scripting

* Temporarily Restore Old CI Pipeline (#841)

* Restore old pipelines

* Remove python 2 from setup-python

* Rework CI Pipeline (#839)

Change pypy to pypy27 in tox.

Fix checkout logic

Pin tox requires

* Fix Tests on New CI (#843)

* Remove non-root user

* Test new CI image

* Change pypy to pypy27 in tox.

* Fix checkout logic

* Fetch git tags properly

* Pin tox requires

* Adjust default db settings for github actions

* Rename elasticsearch services

* Reset to new pipelines

* [Mega-Linter] Apply linters fixes

* Fix timezone

* Fix docker networking

* Pin dev image to new sha

* Standardize gearman DB settings

* Fix elasticsearch settings bug

* Fix gearman bug

* Add missing odbc headers

* Add more debug messages

* Swap out dev ci image

* Fix required virtualenv version

* Swap out dev ci image

* Swap out dev ci image

* Remove aioredis v1 for EOL

* Add coverage paths for docker container

* Unpin ci container

---------

Co-authored-by: TimPansino <TimPansino@users.noreply.github.com>

* Trigger tests

* Add testing for profile trace.

* [Mega-Linter] Apply linters fixes

* Ignore __call__ from coverage on profile_trace.

* [Mega-Linter] Apply linters fixes

---------

Co-authored-by: Hannah Stepanek <hstepanek@newrelic.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: hmstepanek <hmstepanek@users.noreply.github.com>
Co-authored-by: Lalleh Rafeei <84813886+lrafeei@users.noreply.github.com>
Co-authored-by: Timothy Pansino <11214426+TimPansino@users.noreply.github.com>
Co-authored-by: TimPansino <TimPansino@users.noreply.github.com>
Co-authored-by: umaannamalai <umaannamalai@users.noreply.github.com>

* Add Transaction API Tests (#857)

* Test for suppress_apdex_metric

* Add custom_metrics tests

* Add distributed_trace_headers testing in existing tests

* [Mega-Linter] Apply linters fixes

* Remove redundant if-statement

* Ignore deprecated transaction function from coverage

* [Mega-Linter] Apply linters fixes

* Push empty commit

* Update newrelic/api/transaction.py

---------

Co-authored-by: lrafeei <lrafeei@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Timothy Pansino <11214426+TimPansino@users.noreply.github.com>
Co-authored-by: Uma Annamalai <uannamalai@newrelic.com>

* Add tests for jinja2. (#842)

* Add tests for jinja2.

* [Mega-Linter] Apply linters fixes

* Update tox.ini

Co-authored-by: Timothy Pansino <11214426+TimPansino@users.noreply.github.com>

---------

Co-authored-by: umaannamalai <umaannamalai@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Timothy Pansino <11214426+TimPansino@users.noreply.github.com>

* Add tests for newrelic/config.py (#860)

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

* Fix starlette testing matrix for updated behavior. (#869)

Co-authored-by: Lalleh Rafeei <lrafeei@users.noreply.github.com>
Co-authored-by: Hannah Stepanek <hmstepanek@users.noreply.github.com>
Co-authored-by: Uma Annamalai <umaannamalai@users.noreply.github.com>

* Correct Serverless Distributed Tracing Logic (#870)

* Fix serverless logic for distributed tracing

* Test stubs

* Collapse testing changes

* Add negative testing to regular DT test suite

* Apply linter fixes

* [Mega-Linter] Apply linters fixes

---------

Co-authored-by: TimPansino <TimPansino@users.noreply.github.com>

* Fix Kafka CI (#863)

* Reenable kafka testing

* Add kafka dev lib

* Sync install python with devcontainer

* Fix kafka local host setting

* Drop set -u flag

* Pin CI image dev sha

* Add parallel flag to kafka

* Fix proper exit status

* Build librdkafka from source

* Updated dev image sha

* Remove coverage exclusions

* Add new options to better emulate GHA

* Reconfigure kafka networking

Co-authored-by: Hannah Stepanek <hmstepanek@users.noreply.github.com>

* Fix kafka ports on GHA

* Run kafka tests serially

* Separate kafka consumer groups

* Put CI container makefile back

* Remove confluent kafka Py27 for latest

* Roll back ubuntu version update

* Update dev ci sha

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Hannah Stepanek <hmstepanek@users.noreply.github.com>

* Change image tag to latest (#871)

* Change image tag to latest

* Use built sha

* Fixup

* Replace w/ latest

* Add full version for pypy3.8 to tox (#872)

* Add full version for pypy3.8

* Remove solrpy from tests

* Instrument RedisCluster (#809)

* Add instrumentation for RedisCluster

* Add tests for redis cluster

* Ignore Django instrumentation from older versions (#859)

* Ignore Django instrumentation from older versions

* Ignore Django instrumentation from older versions

* Fix text concatenation

* Update newrelic/hooks/framework_django.py

Co-authored-by: Hannah Stepanek <hstepanek@newrelic.com>

* Update newrelic/hooks/framework_django.py

Co-authored-by: Hannah Stepanek <hstepanek@newrelic.com>

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Hannah Stepanek <hstepanek@newrelic.com>

* Modify postgresql tests to include WITH query (#885)

* Modify postgresql tests to include WITH

* [Mega-Linter] Apply linters fixes

---------

Co-authored-by: lrafeei <lrafeei@users.noreply.github.com>

* Develop redis addons (#888)

* Added separate instrumentation for redis.asyncio.client (#808)

* Added separate instrumentation for redis.asyncio.client

Merge main branch updates

Add tests for newrelic/config.py (#860)

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

* Modify redis tests

* removed redis.asyncio from aioredis instrumentation

removed aioredis instrumentation in redis asyncio client

removed redis.asyncio from aioredis instrumentation

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Lalleh Rafeei <lrafeei@newrelic.com>
Co-authored-by: Lalleh Rafeei <84813886+lrafeei@users.noreply.github.com>

* Redis asyncio testing (#881)

* Add/modify redis asyncio tests

* Change to psubscribe

* Tweak redis async tests/instrumentation

* [Mega-Linter] Apply linters fixes

* Push empty commit

* Exclude older instrumentation from coverage

* Resolve requested testing changes

* Tweak async pubsub test

* Fix pubsub test

---------

Co-authored-by: lrafeei <lrafeei@users.noreply.github.com>

* Remove aioredis and aredis from tox (#891)

* Remove aioredis and aredis from tox

* Add aredis and aioredis to coverage ignore

* Push empty commit

* Fix codecov ignore file

---------

Co-authored-by: Ahmed <ahmedhropewala@gmail.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: lrafeei <lrafeei@users.noreply.github.com>

* Fix drift

* Fix ariadne middleware tests for all versions.

---------

Co-authored-by: Hannah Stepanek <hmstepanek@users.noreply.github.com>
Co-authored-by: Lalleh Rafeei <lrafeei@users.noreply.github.com>
Co-authored-by: TimPansino <TimPansino@users.noreply.github.com>
Co-authored-by: Lalleh Rafeei <84813886+lrafeei@users.noreply.github.com>
Co-authored-by: Uma Annamalai <uannamalai@newrelic.com>
Co-authored-by: Hannah Stepanek <hstepanek@newrelic.com>
Co-authored-by: umaannamalai <umaannamalai@users.noreply.github.com>
Co-authored-by: Lalleh Rafeei <lrafeei@newrelic.com>
Co-authored-by: Kevin Morey <kevin@futurehaus.com>
Co-authored-by: Kate Anderson <90657569+kanderson250@users.noreply.github.com>
Co-authored-by: Enriqueta De Leon <deleonenriqueta@users.noreply.github.com>
Co-authored-by: Kate Anderson <kanderson250@users.noreply.github.com>
Co-authored-by: Mary Martinez <mary-martinez@users.noreply.github.com>
Co-authored-by: Dmitry Kolyagin <dmitry.kolyagin@gmail.com>
Co-authored-by: mary-martinez <mmartinez@newrelic.com>
Co-authored-by: enriqueta <edeleon@newrelic.com>
Co-authored-by: Mary Martinez <mary.diana.martinez@gmail.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Justin Richert <justin.richert@life.church>
Co-authored-by: Ahmed Helil <aaeabdo@gmail.com>
Co-authored-by: Ahmed <ahmedhropewala@gmail.com>
  • Loading branch information
22 people committed Aug 11, 2023
1 parent 619026e commit 16b707b
Show file tree
Hide file tree
Showing 449 changed files with 18,478 additions and 11,562 deletions.
4 changes: 4 additions & 0 deletions .devcontainer/Dockerfile
@@ -0,0 +1,4 @@
ARG IMAGE=ghcr.io/newrelic-experimental/pyenv-devcontainer:latest

# To target other architectures, change the --platform directive in the Dockerfile.
FROM --platform=linux/amd64 ${IMAGE}
35 changes: 35 additions & 0 deletions .devcontainer/devcontainer.json
@@ -0,0 +1,35 @@
// For format details, see https://containers.dev/implementors/json_reference/.
{
"name": "pyenv",
"build":{
// To target other architectures, change the --platform directive in the Dockerfile.
"dockerfile": "Dockerfile",
"args": {
"IMAGE": "ghcr.io/newrelic-experimental/pyenv-devcontainer:latest"
}
},
"remoteUser": "vscode",
"runArgs": ["--network=host"],
"features": {
// Available Features: https://containers.dev/features
// "ghcr.io/devcontainers/features/docker-from-docker:1": {"moby": false},
// "ghcr.io/devcontainers/features/aws-cli:1": {},
// "ghcr.io/devcontainers/features/github-cli:1": {}
},
"containerEnv": {
"NEW_RELIC_HOST": "${localEnv:NEW_RELIC_HOST}",
"NEW_RELIC_LICENSE_KEY": "${localEnv:NEW_RELIC_LICENSE_KEY}",
"NEW_RELIC_INSERT_KEY": "${localEnv:NEW_RELIC_INSERT_KEY}",
"NEW_RELIC_DEVELOPER_MODE": "${localEnv:NEW_RELIC_DEVELOPER_MODE}"
},
"customizations": {
"vscode": {
"settings": {},
"extensions": [
"ms-python.python",
"ms-vsliveshare.vsliveshare",
"eamodio.gitlens"
]
}
}
}
45 changes: 0 additions & 45 deletions .github/actions/setup-python-matrix/action.yml

This file was deleted.

98 changes: 98 additions & 0 deletions .github/containers/Dockerfile
@@ -0,0 +1,98 @@

# Copyright 2010 New Relic, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

FROM ubuntu:20.04

# Install OS packages
RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
apt-get install -y \
bash \
build-essential \
curl \
expat \
freetds-common \
freetds-dev \
gcc \
git \
libbz2-dev \
libcurl4-openssl-dev \
libffi-dev \
libgmp-dev \
libkrb5-dev \
liblzma-dev \
libmpfr-dev \
libncurses-dev \
libpq-dev \
libreadline-dev \
libsqlite3-dev \
libssl-dev \
locales \
make \
odbc-postgresql \
openssl \
python2-dev \
python3-dev \
python3-pip \
tzdata \
unixodbc-dev \
unzip \
wget \
zip \
zlib1g \
zlib1g-dev && \
rm -rf /var/lib/apt/lists/*

# Build librdkafka from source
ARG LIBRDKAFKA_VERSION=2.1.1
RUN cd /tmp && \
wget https://github.com/confluentinc/librdkafka/archive/refs/tags/v${LIBRDKAFKA_VERSION}.zip -O ./librdkafka.zip && \
unzip ./librdkafka.zip && \
rm ./librdkafka.zip && \
cd ./librdkafka-${LIBRDKAFKA_VERSION} && \
./configure && \
make all install && \
cd /tmp && \
rm -rf ./librdkafka-${LIBRDKAFKA_VERSION}

# Setup ODBC config
RUN sed -i 's|Driver=psqlodbca.so|Driver=/usr/lib/x86_64-linux-gnu/odbc/psqlodbca.so|g' /etc/odbcinst.ini && \
sed -i 's|Driver=psqlodbcw.so|Driver=/usr/lib/x86_64-linux-gnu/odbc/psqlodbcw.so|g' /etc/odbcinst.ini && \
sed -i 's|Setup=libodbcpsqlS.so|Setup=/usr/lib/x86_64-linux-gnu/odbc/libodbcpsqlS.so|g' /etc/odbcinst.ini

# Set the locale
RUN locale-gen --no-purge en_US.UTF-8
ENV LANG=en_US.UTF-8 \ LANGUAGE=en_US:en \ LC_ALL=en_US.UTF-8
ENV TZ="Etc/UTC"
RUN ln -fs "/usr/share/zoneinfo/${TZ}" /etc/localtime && \
dpkg-reconfigure -f noninteractive tzdata

# Use root user
ENV HOME /root
WORKDIR "${HOME}"

# Install pyenv
ENV PYENV_ROOT="${HOME}/.pyenv"
RUN curl https://pyenv.run/ | /bin/bash
ENV PATH="$PYENV_ROOT/bin:$PYENV_ROOT/shims:${PATH}"
RUN echo 'eval "$(pyenv init -)"' >>$HOME/.bashrc && \
pyenv update

# Install Python
ARG PYTHON_VERSIONS="3.10 3.9 3.8 3.7 3.11 2.7 pypy2.7-7.3.12 pypy3.8-7.3.11"
COPY --chown=1000:1000 --chmod=+x ./install-python.sh /tmp/install-python.sh
COPY ./requirements.txt /requirements.txt
RUN /tmp/install-python.sh && \
rm /tmp/install-python.sh
48 changes: 48 additions & 0 deletions .github/containers/Makefile
@@ -0,0 +1,48 @@
# Copyright 2010 New Relic, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Repository root for mounting into container.
MAKEFILE_DIR:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
REPO_ROOT:=$(realpath $(MAKEFILE_DIR)../../)

.PHONY: default
default: test

.PHONY: build
build:
@# Perform a shortened build for testing
@docker build $(MAKEFILE_DIR) \
-t ghcr.io/newrelic/newrelic-python-agent-ci:local \
--build-arg='PYTHON_VERSIONS=3.10 2.7'

.PHONY: test
test: build
@# Ensure python versions are usable
@docker run --rm ghcr.io/newrelic/python-agent-ci:local /bin/bash -c '\
python3.10 --version && \
python2.7 --version && \
touch tox.ini && tox --version && \
echo "Success! Python versions installed."'

.PHONY: run
run: build
@docker run --rm -it \
--mount type=bind,source="$(REPO_ROOT)",target=/home/github/python-agent \
--workdir=/home/github/python-agent \
--add-host=host.docker.internal:host-gateway \
-e NEW_RELIC_HOST="${NEW_RELIC_HOST}" \
-e NEW_RELIC_LICENSE_KEY="${NEW_RELIC_LICENSE_KEY}" \
-e NEW_RELIC_DEVELOPER_MODE="${NEW_RELIC_DEVELOPER_MODE}" \
-e GITHUB_ACTIONS="true" \
ghcr.io/newrelic/newrelic-python-agent-ci:local /bin/bash
53 changes: 53 additions & 0 deletions .github/containers/install-python.sh
@@ -0,0 +1,53 @@
#!/bin/bash
# Copyright 2010 New Relic, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

set -eo pipefail

main() {
# Coerce space separated string to array
if [[ ${#PYTHON_VERSIONS[@]} -eq 1 ]]; then
PYTHON_VERSIONS=($PYTHON_VERSIONS)
fi

if [[ -z "${PYTHON_VERSIONS[@]}" ]]; then
echo "No python versions specified. Make sure PYTHON_VERSIONS is set." 1>&2
exit 1
fi

# Find all latest pyenv supported versions for requested python versions
PYENV_VERSIONS=()
for v in "${PYTHON_VERSIONS[@]}"; do
LATEST=$(pyenv latest -k "$v" || pyenv latest -k "$v-dev")
if [[ -z "$LATEST" ]]; then
echo "Latest version could not be found for ${v}." 1>&2
exit 1
fi
PYENV_VERSIONS+=($LATEST)
done

# Install each specific version
for v in "${PYENV_VERSIONS[@]}"; do
pyenv install "$v" &
done
wait

# Set all installed versions as globally accessible
pyenv global ${PYENV_VERSIONS[@]}

# Install dependencies for main python installation
pyenv exec pip install --upgrade -r /requirements.txt
}

main
5 changes: 5 additions & 0 deletions .github/containers/requirements.txt
@@ -0,0 +1,5 @@
pip
setuptools
wheel
virtualenv<20.22.0
tox
80 changes: 80 additions & 0 deletions .github/mergify.yml
@@ -0,0 +1,80 @@
# For condition grammar see: https://docs.mergify.com/conditions/#grammar

shared:
conditions:
- and: &pr_ready_checks
- "#approved-reviews-by>=1" # A '#' pulls the length of the underlying list
- "label=ready-to-merge"
- "check-success=tests"
- "-draft" # Don't include draft PRs
- "-merged"
- or: # Only handle branches that target main or develop branches
- "base=main"
- "base~=^develop"

queue_rules:
- name: default
conditions:
- and: *pr_ready_checks
merge_method: squash

pull_request_rules:
# Merge Queue PR Rules
- name: Regular PRs - Add to merge queue on approval (squash)
conditions:
- and: *pr_ready_checks
- "-head~=^develop" # Don't include PRs from develop branches
actions:
queue:
method: squash

# Automatic PR Updates
- name: Automatic PR branch updates
conditions:
- "queue-position=-1" # Not queued
- "-draft" # Don't include draft PRs
- "-merged"
actions:
update:

# Automatic Labeling
- name: Clean up after merge
conditions:
- merged
actions:
delete_head_branch:
label:
remove:
- "merge-conflicts"
- "ready-to-merge"
- "tests-failing"

- name: Toggle label on merge conflicts
conditions:
- "-merged"
- conflict
actions:
label:
toggle:
- "merge-conflicts"

# Don't use a toggle for this, as the label constantly gets applied and removed when tests are rerun.
- name: Add label on test failures
conditions:
- "-merged"
- or:
- check-failure=tests
- check-skipped=tests
actions:
label:
add:
- "tests-failing"

- name: Remove label on test success
conditions:
- "-merged"
- check-success=tests
actions:
label:
remove:
- "tests-failing"

0 comments on commit 16b707b

Please sign in to comment.