Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes for NR CSEC module support #819

Open
wants to merge 124 commits into
base: develop-k2-integration
Choose a base branch
from

Conversation

AnupamJuniwal
Copy link

Overview

The changes include all the necessary modifications to APM codebase to invoke and control NR CSEC module.

Related Github Issue

  • none

Testing

Automated test cases added

  • none

Manual test cases run

  • Verified the APM agent is loading CSEC agent correctly
  • Verified the APM agent reads the required config by CSEC agent correctly.
  • Verified the integration to be running with CSEC agent as expected.

1. Changes to start security module even before the agent is activated, thus, init on active_agent callback have been removed and instead added along with module load phase.
2. Updated agent refresh with policy and linking metadata along with agent config for security module
3. Removed deprecated security module configs constomer_id and accessor_token
lrafeei and others added 30 commits September 12, 2023 13:14
* Add async connection instrumentation

* Remove unsupported flask tests

* Remove old instrumentation from coverage analysis

* [Mega-Linter] Apply linters fixes

* Trigger tests

---------

Co-authored-by: lrafeei <lrafeei@users.noreply.github.com>
* Remove testing for unsupported package versions.

* Add no cover flags.

* [Mega-Linter] Apply linters fixes

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: umaannamalai <umaannamalai@users.noreply.github.com>
Co-authored-by: Timothy Pansino <11214426+TimPansino@users.noreply.github.com>
* Add tree model function traces (#691)

* Add sklearn to tox

* Add function traces around model methods

* Support Python 2.7 & 3.7 sklearn

* Add test for multiple calls to model method

* Fixup: add comments & organize

* Refactor

* Follow two digit convention

* Make if-else a one-liner

* Abstract to re-usable instrumentation function

* Use wrap_method_trace & change to Function group

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

* Fixup: use if-else one-liner

* Use hasattr instead of model name check

* Change component_sklearn to mlmodel_sklearn

* Fixup: replace in model names with hasattr

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

* Add config setting for sklearn inference event capture. (#706)

* Add sklearn to tox

* Add function traces around model methods

* Support Python 2.7 & 3.7 sklearn

* Add test for multiple calls to model method

* Fixup: add comments & organize

* Refactor

* Follow two digit convention

* Make if-else a one-liner

* Abstract to re-usable instrumentation function

* Add ML inference event capture config setting.

* [Mega-Linter] Apply linters fixes

* Fixup: remove component_sklearn files

* Add high security mode testing for ML events setting.

* [Mega-Linter] Apply linters fixes

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

* Capture scorer results (#694)

* Add score results attributes to metric scorers

* Test un-subclassable types

* [Mega-Linter] Apply linters fixes

* [Mega-Linter] Apply linters fixes

* Trigger tests

* Remove custom subclassing code.

* [Mega-Linter] Apply linters fixes

* Remove unused function

* Add test for iterable score results

* Change name of object proxy

* Fixup: rename proxy in tests too

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

* Add ensemble model function traces (#697)

* Add sklearn to tox

* Add function traces around model methods

* Support Python 2.7 & 3.7 sklearn

* Add test for multiple calls to model method

* Fixup: add comments & organize

* Add ensemble models

* Add ensemble model tests

* Edit tests

* Add ensemble library models from sklearn

* Start tests with empty commit

* Clean up tests

* Fix tests for various versions of sklearn

* Fix ensemble tests with changes from tree PR

* [Mega-Linter] Apply linters fixes

* Remove breakpoints

* Remove commited config files

* Group tests into more readable format

* Pin startlette latest < 0.23.1

* Convert PY3 checks to one-liners

* Use tuple checks for sklearn version

Use tuple checks for sklearn version, string checks can result in unexpected out of
order comparisons. Also use direct comparisons for easier readability.

* Fix VotingRegressor test

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

* Include training step in metric scorer name (#712)

* Include training step in scorer name

* Add fit_predict data proxying

* Remove name comments

* Fix predict being called before fit

* Re-use existing fixture

* Add cluster model function traces (#700)

* Add sklearn to tox

* Add function traces around model methods

* Support Python 2.7 & 3.7 sklearn

* Add test for multiple calls to model method

* Fixup: add comments & organize

* Add ensemble models

* Add ensemble model tests

* Edit tests

* Add ensemble library models from sklearn

* Start tests with empty commit

* Clean up tests

* Add cluster model instrumentaton

* Fix tests for various versions of sklearn

* Fix ensemble tests with changes from tree PR

* [Mega-Linter] Apply linters fixes

* Fix some cluster model tests

* Fix tests after ensemble PR merge

* Add transform to tests

* Remove accidental commits

* Modify cluster tests to be more readable

* Break up instrumentation models

* Remove duplicate ensemble module defs

* Modify VotingRegressor test

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

* Add calibration model function traces (#709)

* Add sklearn to tox

* Add function traces around model methods

* Support Python 2.7 & 3.7 sklearn

* Add test for multiple calls to model method

* Fixup: add comments & organize

* Add ensemble models

* Add ensemble model tests

* Edit tests

* Add ensemble library models from sklearn

* Start tests with empty commit

* Clean up tests

* Fix tests for various versions of sklearn

* Fix ensemble tests with changes from tree PR

* [Mega-Linter] Apply linters fixes

* Remove breakpoints

* Create tests/instrumentation for calibration models

* Fix calibration tests

* Remove commented out code

* Remove yaml file in commit

* Remove duplicate ensemble module defs

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

* Add svm model function traces (#733)

* Add svm models

* Remove extra conditionals from testing

* Add semi supervised models (#732)

* Add pipeline model function traces (#730)

* Add pipeline models

* Remove commented code

* Add neural network model function traces (#729)

* Add neural network models

* Fixup: merge conflict

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

* Add neighbors models (#728)

* Add mixture models (#725)

* Add model selection model function traces (#726)

* Add outline for model selection tests

* Add some testing to model selection

* Add hooks

* Add estimator

* Finish testing for model selection

* Add naive bayes models (#724)

* Add multioutput models (#723)

* Add multiclass models (#722)

* Add kernel ridge model function traces (#721)

* Add kernel ridge models

* Modify VotingRegressor test

* Add custom feature events for sklearn (#727)

* Add function traces around model methods

* Add test for multiple calls to model method

* Fixup: add comments & organize

* Refactor

* Instrument predict function.

* Add data trains fixture.

* Add testing and cleanup for custom feature events.

* Update test_tree_models.

* Add back training step logic to predict proxy.

* Remove unused files.

* Add tree model function traces (#691)

* Add sklearn to tox

* Add function traces around model methods

* Support Python 2.7 & 3.7 sklearn

* Add test for multiple calls to model method

* Fixup: add comments & organize

* Refactor

* Follow two digit convention

* Make if-else a one-liner

* Abstract to re-usable instrumentation function

* Use wrap_method_trace & change to Function group

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

* Fixup: use if-else one-liner

* Use hasattr instead of model name check

* Change component_sklearn to mlmodel_sklearn

* Fixup: replace in model names with hasattr

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

* Add config setting for sklearn inference event capture. (#706)

* Add sklearn to tox

* Add function traces around model methods

* Support Python 2.7 & 3.7 sklearn

* Add test for multiple calls to model method

* Fixup: add comments & organize

* Refactor

* Follow two digit convention

* Make if-else a one-liner

* Abstract to re-usable instrumentation function

* Add ML inference event capture config setting.

* [Mega-Linter] Apply linters fixes

* Fixup: remove component_sklearn files

* Add high security mode testing for ML events setting.

* [Mega-Linter] Apply linters fixes

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

* Capture scorer results (#694)

* Add score results attributes to metric scorers

* Test un-subclassable types

* [Mega-Linter] Apply linters fixes

* [Mega-Linter] Apply linters fixes

* Trigger tests

* Remove custom subclassing code.

* [Mega-Linter] Apply linters fixes

* Remove unused function

* Add test for iterable score results

* Change name of object proxy

* Fixup: rename proxy in tests too

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

* Add ensemble model function traces (#697)

* Add sklearn to tox

* Add function traces around model methods

* Support Python 2.7 & 3.7 sklearn

* Add test for multiple calls to model method

* Fixup: add comments & organize

* Add ensemble models

* Add ensemble model tests

* Edit tests

* Add ensemble library models from sklearn

* Start tests with empty commit

* Clean up tests

* Fix tests for various versions of sklearn

* Fix ensemble tests with changes from tree PR

* [Mega-Linter] Apply linters fixes

* Remove breakpoints

* Remove commited config files

* Group tests into more readable format

* Pin startlette latest < 0.23.1

* Convert PY3 checks to one-liners

* Use tuple checks for sklearn version

Use tuple checks for sklearn version, string checks can result in unexpected out of
order comparisons. Also use direct comparisons for easier readability.

* Fix VotingRegressor test

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

* Add function traces around model methods

* Add test for multiple calls to model method

* Fixup: add comments & organize

* Refactor

* Instrument predict function.

* Add data trains fixture.

* Add testing and cleanup for custom feature events.

* Update test_tree_models.

* Include training step in metric scorer name (#712)

* Include training step in scorer name

* Add fit_predict data proxying

* Remove name comments

* Fix predict being called before fit

* Re-use existing fixture

* Add cluster model function traces (#700)

* Add sklearn to tox

* Add function traces around model methods

* Support Python 2.7 & 3.7 sklearn

* Add test for multiple calls to model method

* Fixup: add comments & organize

* Add ensemble models

* Add ensemble model tests

* Edit tests

* Add ensemble library models from sklearn

* Start tests with empty commit

* Clean up tests

* Add cluster model instrumentaton

* Fix tests for various versions of sklearn

* Fix ensemble tests with changes from tree PR

* [Mega-Linter] Apply linters fixes

* Fix some cluster model tests

* Fix tests after ensemble PR merge

* Add transform to tests

* Remove accidental commits

* Modify cluster tests to be more readable

* Break up instrumentation models

* Remove duplicate ensemble module defs

* Modify VotingRegressor test

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

* Add calibration model function traces (#709)

* Add sklearn to tox

* Add function traces around model methods

* Support Python 2.7 & 3.7 sklearn

* Add test for multiple calls to model method

* Fixup: add comments & organize

* Add ensemble models

* Add ensemble model tests

* Edit tests

* Add ensemble library models from sklearn

* Start tests with empty commit

* Clean up tests

* Fix tests for various versions of sklearn

* Fix ensemble tests with changes from tree PR

* [Mega-Linter] Apply linters fixes

* Remove breakpoints

* Create tests/instrumentation for calibration models

* Fix calibration tests

* Remove commented out code

* Remove yaml file in commit

* Remove duplicate ensemble module defs

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

* Add back training step logic to predict proxy.

* Remove unused files.

* Address py27 test failures and review comments.

* Fix py 3.7 failures.

* Remove old component_sklearn.py file

* Fix lint errors

* [Mega-Linter] Apply linters fixes

* Merge redis fix.

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

* Add feature selection model function traces (#719)

* Add feature selection models

* Modify VotingRegressor test

* Add dummy model function traces (#718)

* Add gaussian process model function traces (#720)

* Add gaussian process models

* Modify VotingRegressor test

* Modify Gaussian Process models tests

* Add discriminant analysis model (#717)

* Add cross decomposition models (#716)

* Add covariance model (#714)

* Add compose models (#713)

* Add linear model function traces (#703)

* Add sklearn to tox

* Add function traces around model methods

* Support Python 2.7 & 3.7 sklearn

* Add test for multiple calls to model method

* Fixup: add comments & organize

* Add ensemble models

* Add ensemble model tests

* Edit tests

* Add ensemble library models from sklearn

* Start tests with empty commit

* Clean up tests

* Initial linear model commit

* Clean up tests for linear models

* Fix tests for various versions of sklearn

* Fix ensemble tests with changes from tree PR

* [Mega-Linter] Apply linters fixes

* Remove breakpoints

* Merge changes from ensemble PR

* Fix tests for v0.20.0

* Rewrite linear tests to be more readable

* Break up instrumentation in config

* Remove commented code

* Remove yaml file in commit

* Remove duplicate ensemble module defs

* Remove old no longer used file

* Remove commented out code.

* Change test name and modify VotingRegressor test

* Push empty commit

* Modify VotingRegression test

* Add estimator to VotingRegressor

* Revert VotingRegressor test

* Fix ensemble tests

* Add different models for VotingRegressor test

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

* Add ml_model function wrapper API (#739)

* Add function traces around model methods

* Add test for multiple calls to model method

* Fixup: add comments & organize

* Refactor

* Instrument predict function.

* Add data trains fixture.

* Add testing and cleanup for custom feature events.

* Update test_tree_models.

* Add back training step logic to predict proxy.

* Remove unused files.

* Add ml_model wrapper and tests.

* Add column name logic.

* Update branch.

* Update column name mapping logic.

* Fix py2 failures.

* Fix pypy37 failure.

* Revise feature_names logic.

* Add more ml_model wrapper testing.

* Fix linter unused import

* [Mega-Linter] Apply linters fixes

* Bump tests.

* Bump tests.

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

* Report feature event w/o value (#754)

Report the feature event w/o the raw value if
`machine_learning.inference_event_value.enabled` is False.

* Prediction metric stats (#715)

* Add function traces around model methods

* Add test for multiple calls to model method

* Fixup: add comments & organize

* Refactor

* Instrument predict function.

* Add data trains fixture.

* Add testing and cleanup for custom feature events.

* Update test_tree_models.

* Add back training step logic to predict proxy.

* Remove unused files.

* Update branch.

* Add impl and testing for label events.

* [Mega-Linter] Apply linters fixes

* Add feature_name to expected events for int test.

* Fix py37 test.

* Add function traces around model methods

* Add test for multiple calls to model method

* Fixup: add comments & organize

* Refactor

* Instrument predict function.

* Add data trains fixture.

* Add testing and cleanup for custom feature events.

* Update test_tree_models.

* Add back training step logic to predict proxy.

* Remove unused files.

* Update branch.

* Add impl and testing for label events.

* Add feature_name to expected events for int test.

* [Mega-Linter] Apply linters fixes

* Fix py37 test.

* Update logic to not report value when setting is disabled.

* Fixup flake8 unused import

* Touch up label event logic and rename test_feature_events to test_inference_events.

* Add test case for multilabel output.

* Fix 2D np array test.

* Add metrics about prediction data

* Fixup

* Fix user provided label names

* Fixup label related column name tests

* [Mega-Linter] Apply linters fixes

* Assert label events in multilabel output test

* Remove return of stats

* Remove spaces from version specification

* Fix py2.7 output difference in pandas test

---------

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

* Add new ML event type (#802)

* Add new machine learning event data type

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

* Validate new machine learning event data type

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

* Fixup: minor inconsistencies

* Fixup

* Remove code coverage fixture

* Fix lint errors

* Increase timeout for python tests

---------

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

* Add machine learning and ml_event config options (#811)

* Add machine learning config options

* machine_learning.enabled
* machine_learning.inference_events.enable
* machine_learning.inference_events.value.enabled
* event_harvest_config.harvest_limits.ml_event_data

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

* Replace all TODOs w/ new config settings

* [Mega-Linter] Apply linters fixes

* Trigger tests

* Add insights settings & tests

* Remove collect_custom_events & inference_events.enabled

* Revert inference_events_value=>.value

* Remove TODO

* Fixup: format docstring

* Remove file

* Add tests for machine_learning.enabled

---------

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

* Dimensional Metrics (#815)

* Wiring dimensional metrics

* Squashed commit of the following:

commit c2d4629dfd7787354b6607160bb952913975d5f7
Author: Timothy Pansino <11214426+TimPansino@users.noreply.github.com>
Date:   Wed May 10 15:59:13 2023 -0700

    Add required option for tox v4 (#795)

    * Add required option for tox v4

    * Update tox in GHA

    * Remove py27 no-cache-dir

commit a9636498ab5c20c266fb044a08359c0c9bbcf826
Author: Hannah Stepanek <hstepanek@newrelic.com>
Date:   Tue May 9 10:46:39 2023 -0700

    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

commit 3d8284540e0acd867c2cf680f43449bc128c0779
Author: Lalleh Rafeei <84813886+lrafeei@users.noreply.github.com>
Date:   Wed May 3 14:50:30 2023 -0700

    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>

commit fd0fa35466b630e34e8476cc53ad0e163564e2de
Author: Uma Annamalai <uannamalai@newrelic.com>
Date:   Tue May 2 10:55:36 2023 -0700

    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>

commit be4fb3dda0e734889acd6bc53cf91f26c18c2118
Author: Lalleh Rafeei <84813886+lrafeei@users.noreply.github.com>
Date:   Mon May 1 16:01:09 2023 -0700

    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>

commit 7103506ca5639d339e3e47dfb9e4affb546c839b
Author: Hannah Stepanek <hstepanek@newrelic.com>
Date:   Mon May 1 14:12:31 2023 -0700

    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>

commit 363122a0efe0ad9f4784fc1f67fda046cb9bb7e8
Author: Hannah Stepanek <hstepanek@newrelic.com>
Date:   Mon May 1 13:34:35 2023 -0700

    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 dimensional stats table to stats engine

* Add attribute processing to metric identity

* Add testing for dimensional metrics

* Cover tags as list not dict

* Commit suggestions from code review

* Add OTLP protocol class & protos (#821)

* Add protos under packages for otlp

* Add common otlp proto payload methods

* Add new oltp protocol class

* Remove ML event from log message

* Remove params, add api-key header & expose path

The params are not relevant to OTLP so remove these.
The api-key header is how we provide the license key to OTLP so add this.
The path to upload dimensional metrics and events are different in OTLP so expose
the path so it can be overriden inside the coresponding data_collector methods.

* Add otlp_port and otlp_host settings

* Default to JSON if protobuf not available & warn

* Move otlp_utils to core

* Call encode in protocol class

* Patch issues with data collector

* Move resource to utils & add log proto imports

---------

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

* 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>

* OTLP Serialization for Dimensional Metrics (#826)

* Add protos under packages for otlp

* Add common otlp proto payload methods

* Add new oltp protocol class

* Remove ML event from log message

* Remove params, add api-key header & expose path

The params are not relevant to OTLP so remove these.
The api-key header is how we provide the license key to OTLP so add this.
The path to upload dimensional metrics and events are different in OTLP so expose
the path so it can be overriden inside the coresponding data_collector methods.

* Add metric protos

* Use protos to create payload

* Squashed commit of the following:

commit 6f15520cea6a1098915c9ca340dbe42de6a5de1d
Author: Tim Pansino <timpansino@gmail.com>
Date:   Mon May 15 14:28:50 2023 -0700

    TEMP

commit 1a28d36f86dd3f1fa5ca7a8f56357d168aac69db
Author: Tim Pansino <timpansino@gmail.com>
Date:   Thu May 11 17:28:27 2023 -0700

    Cover tags as list not dict

commit 71261e3d468320569742a72c690f6ff4e9b3e621
Merge: 459e08567 c2d4629df
Author: Timothy Pansino <11214426+TimPansino@users.noreply.github.com>
Date:   Thu May 11 16:59:11 2023 -0700

    Merge branch 'main' into feature-dimensional-metrics

commit 459e08567102cfadce398b57d245ecf99408400d
Author: Tim Pansino <timpansino@gmail.com>
Date:   Thu May 11 16:57:16 2023 -0700

    Add testing for dimensional metrics

commit ed33957cd2b20bc1f6e9759a0bad5e4f4a86a38c
Author: Tim Pansino <timpansino@gmail.com>
Date:   Thu May 11 16:56:31 2023 -0700

    Add attribute processing to metric identity

commit 6caf71ef4386395d950060e0e996f80dbcbfbc32
Author: Tim Pansino <timpansino@gmail.com>
Date:   Thu May 11 16:56:16 2023 -0700

    Add dimensional stats table to stats engine

commit 5e1cc9dea6d0d9623130dedd0f787408a8439388
Author: Tim Pansino <timpansino@gmail.com>
Date:   Wed May 10 16:00:42 2023 -0700

    Squashed commit of the following:

    commit c2d4629dfd7787354b6607160bb952913975d5f7
    Author: Timothy Pansino <11214426+TimPansino@users.noreply.github.com>
    Date:   Wed May 10 15:59:13 2023 -0700

        Add required option for tox v4 (#795)

        * Add required option for tox v4

        * Update tox in GHA

        * Remove py27 no-cache-dir

    commit a9636498ab5c20c266fb044a08359c0c9bbcf826
    Author: Hannah Stepanek <hstepanek@newrelic.com>
    Date:   Tue May 9 10:46:39 2023 -0700

        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

    commit 3d8284540e0acd867c2cf680f43449bc128c0779
    Author: Lalleh Rafeei <84813886+lrafeei@users.noreply.github.com>
    Date:   Wed May 3 14:50:30 2023 -0700

        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>

    commit fd0fa35466b630e34e8476cc53ad0e163564e2de
    Author: Uma Annamalai <uannamalai@newrelic.com>
    Date:   Tue May 2 10:55:36 2023 -0700

        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>

    commit be4fb3dda0e734889acd6bc53cf91f26c18c2118
    Author: Lalleh Rafeei <84813886+lrafeei@users.noreply.github.com>
    Date:   Mon May 1 16:01:09 2023 -0700

        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>

    commit 7103506ca5639d339e3e47dfb9e4affb546c839b
    Author: Hannah Stepanek <hstepanek@newrelic.com>
    Date:   Mon May 1 14:12:31 2023 -0700

        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>

    commit 363122a0efe0ad9f4784fc1f67fda046cb9bb7e8
    Author: Hannah Stepanek <hstepanek@newrelic.com>
    Date:   Mon May 1 13:34:35 2023 -0700

        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

commit c2d4629dfd7787354b6607160bb952913975d5f7
Author: Timothy Pansino <11214426+TimPansino@users.noreply.github.com>
Date:   Wed May 10 15:59:13 2023 -0700

    Add required option for tox v4 (#795)

    * Add required option for tox v4

    * Update tox in GHA

    * Remove py27 no-cache-dir

commit a9636498ab5c20c266fb044a08359c0c9bbcf826
Author: Hannah Stepanek <hstepanek@newrelic.com>
Date:   Tue May 9 10:46:39 2023 -0700

    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

commit dc81a50a9fc5f2a5ce6978aa064fdfab1618328b
Author: Tim Pansino <timpansino@gmail.com>
Date:   Sat May 6 14:16:14 2023 -0700

    Wiring dimensional metrics

commit 3d8284540e0acd867c2cf680f43449bc128c0779
Author: Lalleh Rafeei <84813886+lrafeei@users.noreply.github.com>
Date:   Wed May 3 14:50:30 2023 -0700

    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>

commit fd0fa35466b630e34e8476cc53ad0e163564e2de
Author: Uma Annamalai <uannamalai@newrelic.com>
Date:   Tue May 2 10:55:36 2023 -0700

    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>

commit be4fb3dda0e734889acd6bc53cf91f26c18c2118
Author: Lalleh Rafeei <84813886+lrafeei@users.noreply.github.com>
Date:   Mon May 1 16:01:09 2023 -0700

    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>

commit 7103506ca5639d339e3e47dfb9e4affb546c839b
Author: Hannah Stepanek <hstepanek@newrelic.com>
Date:   Mon May 1 14:12:31 2023 -0700

    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>

* Squashed commit of the following:

commit 7a384c5935f8d6d24db9b488a7e48a6854efedd6
Author: Tim Pansino <timpansino@gmail.com>
Date:   Thu Jun 1 12:10:59 2023 -0700

    Cleaning out agent protocol

commit c87d31d5d3a91eb7c584f32f9831fbebc1ffe378
Author: Tim Pansino <timpansino@gmail.com>
Date:   Thu Jun 1 12:10:46 2023 -0700

    Change content-type header

commit 5750e546797b16f96e71161f794cb34a253418a6
Author: Tim Pansino <timpansino@gmail.com>
Date:   Thu Jun 1 12:05:52 2023 -0700

    Add common utilities for OTLP

* Remove testing logic

* Adding metric serialization helpers

* Squashed commit of the following:

commit a47e209925a210e85bb6c57f0a2efa9e99630b7f
Author: Tim Pansino <timpansino@gmail.com>
Date:   Tue Jun 6 11:11:30 2023 -0700

    Commit suggestions from code review

commit 1a28d36f86dd3f1fa5ca7a8f56357d168aac69db
Author: Tim Pansino <timpansino@gmail.com>
Date:   Thu May 11 17:28:27 2023 -0700

    Cover tags as list not dict

commit 71261e3d468320569742a72c690f6ff4e9b3e621
Merge: 459e08567 c2d4629df
Author: Timothy Pansino <11214426+TimPansino@users.noreply.github.com>
Date:   Thu May 11 16:59:11 2023 -0700

    Merge branch 'main' into feature-dimensional-metrics

commit 459e08567102cfadce398b57d245ecf99408400d
Author: Tim Pansino <timpansino@gmail.com>
Date:   Thu May 11 16:57:16 2023 -0700

    Add testing for dimensional metrics

commit ed33957cd2b20bc1f6e9759a0bad5e4f4a86a38c
Author: Tim Pansino <timpansino@gmail.com>
Date:   Thu May 11 16:56:31 2023 -0700

    Add attribute processing to metric identity

commit 6caf71ef4386395d950060e0e996f80dbcbfbc32
Author: Tim Pansino <timpansino@gmail.com>
Date:   Thu May 11 16:56:16 2023 -0700

    Add dimensional stats table to stats engine

commit 5e1cc9dea6d0d9623130dedd0f787408a8439388
Author: Tim Pansino <timpansino@gmail.com>
Date:   Wed May 10 16:00:42 2023 -0700

    Squashed commit of the following:

    commit c2d4629dfd7787354b6607160bb952913975d5f7
    Author: Timothy Pansino <11214426+TimPansino@users.noreply.github.com>
    Date:   Wed May 10 15:59:13 2023 -0700

        Add required option for tox v4 (#795)

        * Add required option for tox v4

        * Update tox in GHA

        * Remove py27 no-cache-dir

    commit a9636498ab5c20c266fb044a08359c0c9bbcf826
    Author: Hannah Stepanek <hstepanek@newrelic.com>
    Date:   Tue May 9 10:46:39 2023 -0700

        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

    commit 3d8284540e0acd867c2cf680f43449bc128c0779
    Author: Lalleh Rafeei <84813886+lrafeei@users.noreply.github.com>
    Date:   Wed May 3 14:50:30 2023 -0700

        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>

    commit fd0fa35466b630e34e8476cc53ad0e163564e2de
    Author: Uma Annamalai <uannamalai@newrelic.com>
    Date:   Tue May 2 10:55:36 2023 -0700

        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>

    commit be4fb3dda0e734889acd6bc53cf91f26c18c2118
    Author: Lalleh Rafeei <84813886+lrafeei@users.noreply.github.com>
    Date:   Mon May 1 16:01:09 2023 -0700

        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>

    commit 7103506ca5639d339e3e47dfb9e4affb546c839b
    Author: Hannah Stepanek <hstepanek@newrelic.com>
    Date:   Mon May 1 14:12:31 2023 -0700

        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>

    commit 363122a0efe0ad9f4784fc1f67fda046cb9bb7e8
    Author: Hannah Stepanek <hstepanek@newrelic.com>
    Date:   Mon May 1 13:34:35 2023 -0700

        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

commit c2d4629dfd7787354b6607160bb952913975d5f7
Author: Timothy Pansino <11214426+TimPansino@users.noreply.github.com>
Date:   Wed May 10 15:59:13 2023 -0700

    Add required option for tox v4 (#795)

    * Add required option for tox v4

    * Update tox in GHA

    * Remove py27 no-cache-dir

commit a9636498ab5c20c266fb044a08359c0c9bbcf826
Author: Hannah Stepanek <hstepanek@newrelic.com>
Date:   Tue May 9 10:46:39 2023 -0700

    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

commit dc81a50a9fc5f2a5ce6978aa064fdfab1618328b
Author: Tim Pansino <timpansino@gmail.com>
Date:   Sat May 6 14:16:14 2023 -0700

    Wiring dimensional metrics

commit 3d8284540e0acd867c2cf680f43449bc128c0779
Author: Lalleh Rafeei <84813886+lrafeei@users.noreply.github.com>
Date:   Wed May 3 14:50:30 2023 -0700

    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>

commit fd0fa35466b630e34e8476cc53ad0e163564e2de
Author: Uma Annamalai <uannamalai@newrelic.com>
Date:   Tue May 2 10:55:36 2023 -0700

    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>

commit be4fb3dda0e734889acd6bc53cf91f26c18c2118
Author: Lalleh Rafeei <84813886+lrafeei@users.noreply.github.com>
Date:   Mon May 1 16:01:09 2023 -0700

    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>

commit 7103506ca5639d339e3e47dfb9e4affb546c839b
Author: Hannah Stepanek <hstepanek@newrelic.com>
Date:   Mon May 1 14:12:31 2023 -0700

    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 protobuf to agent features tests

* Proper bucket dimensional metric serialization

* Wiring up OTLP protocol for metrics

* Correct metrics payloads

* Make default content-encoding header configurable

* Clean up otlp encoding

* Expand OTLP metrics testing

* Squashed commit of the following:

commit 30f0bf5ce27f239f70b236c639a49715f33ce948
Author: Hannah Stepanek <hstepanek@newrelic.com>
Date:   Fri Jun 9 16:12:09 2023 -0700

    Add OTLP protocol class & protos (#821)

    * Add protos under packages for otlp

    * Add common otlp proto payload methods

    * Add new oltp protocol class

    * Remove ML event from log message

    * Remove params, add api-key header & expose path

    The params are not relevant to OTLP so remove these.
    The api-key header is how we provide the license key to OTLP so add this.
    The path to upload dimensional metrics and events are different in OTLP so expose
    the path so it can be overriden inside the coresponding data_collector methods.

    * Add otlp_port and otlp_host settings

    * Default to JSON if protobuf not available & warn

    * Move otlp_utils to core

    * Call encode in protocol class

    * Patch issues with data collector

    * Move resource to utils & add log proto imports

    ---------

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

commit e970884dac0e1f9c703c6fdbff408fb923502f51
Author: Timothy Pansino <11214426+TimPansino@users.noreply.github.com>
Date:   Thu Jun 8 13:17:28 2023 -0700

    Dimensional Metrics (#815)

    * Wiring dimensional metrics

    * Squashed commit of the following:

    commit c2d4629dfd7787354b6607160bb952913975d5f7
    Author: Timothy Pansino <11214426+TimPansino@users.noreply.github.com>
    Date:   Wed May 10 15:59:13 2023 -0700

        Add required option for tox v4 (#795)

        * Add required option for tox v4

        * Update tox in GHA

        * Remove py27 no-cache-dir

    commit a9636498ab5c20c266fb044a08359c0c9bbcf826
    Author: Hannah Stepanek <hstepanek@newrelic.com>
    Date:   Tue May 9 10:46:39 2023 -0700

        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

    commit 3d8284540e0acd867c2cf680f43449bc128c0779
    Author: Lalleh Rafeei <84813886+lrafeei@users.noreply.github.com>
    Date:   Wed May 3 14:50:30 2023 -0700

        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>

    commit fd0fa35466b630e34e8476cc53ad0e163564e2de
    Author: Uma Annamalai <uannamalai@newrelic.com>
    Date:   Tue May 2 10:55:36 2023 -0700

        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>

    commit be4fb3dda0e734889acd6bc53cf91f26c18c2118
    Author: Lalleh Rafeei <84813886+lrafeei@users.noreply.github.com>
    Date:   Mon May 1 16:01:09 2023 -0700

        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>

    commit 7103506ca5639d339e3e47dfb9e4affb546c839b
    Author: Hannah Stepanek <hstepanek@newrelic.com>
    Date:   Mon May 1 14:12:31 2023 -0700

        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>

    commit 363122a0efe0ad9f4784fc1f67fda046cb9bb7e8
    Author: Hannah Stepanek <hstepanek@newrelic.com>
    Date:   Mon May 1 13:34:35 2023 -0700

        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 dimensional stats table to stats engine

    * Add attribute processing to metric identity

    * Add testing for dimensional metrics

    * Cover tags as list not dict

    * Commit suggestions from code review

* Fix missing resource error

* Add global settings override for otlp_host test

* Fix unbound local variable

* Remove redundant and miscategorized tests

* Migrate and merge otlp utils to core.

* Fix virtualenv for newer tox versions and Py27

* Fix validator for Py27

* Fix dimensional metric normalization

* Fix lint errors

* Fix pypy 27 naming

* Add debug override for metric serialization

* Fix exit code passthrough in tox script

* Make otlp_encode more robust

* Add json vs protobuf testing fixture

* Remove sklearn py27 testing

* Validate resource in OTLP

* Revert unrelated changes from code review

* Fixup: service.provider assertion

---------

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

* Fix attribute name mismatches from mlops sdk (#845)

* Convert numerical -> numeric

* Adjust attr names to match mlops sdk

* Add feature_/label_ prefix to type & name attrs
* model_name -> modelName

* Set event type to inferenceData

* Backport main into develop-scikitlearn (#847)

* 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>

* Fix pypy27 dependency

* Add skip for OTLP on py27

---------

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

* Use Dimensional Metrics in SKLearn (#850)

* Convert ML custom metrics to dimensional with tags

* Rename _class to class_

* Remove typo

* Adjust ML metric tests for dimensional metrics

* Pin sklearn to <1.11.0 for testing

* [Mega-Linter] Apply linters fixes

---------

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

* Fixup dependency pinning

* Hook up ml event to OTLP (#822)

* Use protos and otlp protocol class for ml_events

* inferenceData -> InferenceData

* Add LogsData import

* Add utf-8 encoding for json otlp payload

* Cast timestamp to int

* Use ml_event validator in tests

* Fixup payload tests

* Change str_value -> string_value

* Move event payload gen into otlp_utils

* Fixup: put back print

* Fixup: cast as str for py27

* Fixup lint errors

* Skip py2 protobuf

---------

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

* Fix OTLP Count Metric Serialization (#856)

* Fix metric filtering in OTLP encoding

* Add regression test for duplicate metrics

* Make error message more clear

* Add pylint ignore C0123

* Add explanation comment

* Linting fixups

* Merge main (#874)

* 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

* Fix merge conflict

* Fix tests for scikit-learn >= 1.3.0

In 1.3.0 sklearn renamed fit to _fit in BaseDecisionTree.

* Add gfortran to container

* Use ci image sha

* Add pkg-config

* New CI build

---------

Co-authored-by: Lalleh Rafeei <84813886+lrafeei@users.noreply.github.com>
Co-authored-by: Ahmed Helil <aaeabdo@gmail.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: lrafeei <lrafeei@users.noreply.github.com>
Co-authored-by: Tim Pansino <timpansino@gmail.com>
Co-authored-by: Uma Annamalai <uannamalai@newrelic.com>
Co-authored-by: hmstepanek <hmstepanek@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>

* Only send 1 event per prediction & fix tests (#867)

* Only send 1 event per prediction

This changes from sending 1 event per feature/label value to 1 event per prediction.
This change is referred to as a change in "schema".
* Replace feature_name & feature_value and label_name & label_value to
  feature.<name> = <value> and label.<name> = <value>.
* Remove feature_type and label_type.

* Add new_relic_data_schema_version

* Remove pypy3.8-scipy will not compile

* Remove scipy compile deps

* Set ci build back to latest

* Merge redis changes mlops (#914)

* 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 m…
Co-authored-by: Lalleh Rafeei <84813886+lrafeei@users.noreply.github.com>
* Update available python versions in CI

* Update makefile with overrides

* Fix default branch detection for arm builds

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
* Only get package version once

* Add disconnect method

* Add disconnect method

---------

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

* Add Python 2.7 support to get_package_version caching

* [Mega-Linter] Apply linters fixes

* Bump tests

---------

Co-authored-by: SlavaSkvortsov <29122694+SlavaSkvortsov@users.noreply.github.com>
Co-authored-by: TimPansino <TimPansino@users.noreply.github.com>
* Fix scan_iter for redis

* Replace generator methods

* Update instance info instrumentation

* Remove mistake from uninstrumented methods

* Add skip condition to asyncio generator tests

* Add skip condition to asyncio generator tests

---------

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

* Adding RPM action

* Add dry run

* Incorporating action into workflow

* Wire secret into custom action

* Enable action

* Correct action name

* Fix syntax

* Fix quoting issues

* Drop pre-verification. Does not work on python

* Fix merge artifact
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
* Bedrock Testing Infrastructure (newrelic#937)

* Add AWS Bedrock testing infrastructure

* Cache Package Version Lookups (newrelic#946)

* Cache _get_package_version

* Add Python 2.7 support to get_package_version caching

* [Mega-Linter] Apply linters fixes

* Bump tests

---------

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

* Fix Redis Generator Methods (newrelic#947)

* Fix scan_iter for redis

* Replace generator methods

* Update instance info instrumentation

* Remove mistake from uninstrumented methods

* Add skip condition to asyncio generator tests

* Add skip condition to asyncio generator tests

---------

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

* Automatic RPM System Updates (newrelic#948)

* Checkout old action

* Adding RPM action

* Add dry run

* Incorporating action into workflow

* Wire secret into custom action

* Enable action

* Correct action name

* Fix syntax

* Fix quoting issues

* Drop pre-verification. Does not work on python

* Fix merge artifact

* Remove OpenAI references

---------

Co-authored-by: Uma Annamalai <uannamalai@newrelic.com>
Co-authored-by: SlavaSkvortsov <29122694+SlavaSkvortsov@users.noreply.github.com>
Co-authored-by: TimPansino <TimPansino@users.noreply.github.com>
Co-authored-by: Lalleh Rafeei <lrafeei@newrelic.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

* Bedrock Sync Chat Completion Instrumentation (newrelic#953)

* Add AWS Bedrock testing infrastructure

* Squashed commit of the following:

commit 2834663
Author: Timothy Pansino <11214426+TimPansino@users.noreply.github.com>
Date:   Mon Oct 9 17:42:05 2023 -0700

    OpenAI Mock Backend (newrelic#929)

    * Add mock external openai server

    * Add mocked OpenAI server fixtures

    * Set up recorded responses.

    * Clean mock server to depend on http server

    * Linting

    * Pin flask version for flask restx tests. (newrelic#931)

    * Ignore new redis methods. (newrelic#932)

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

    * Remove approved paths

    * Update CI Image (newrelic#930)

    * Update available python versions in CI

    * Update makefile with overrides

    * Fix default branch detection for arm builds

    ---------

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

    * Add mocking for embedding endpoint

    * [Mega-Linter] Apply linters fixes

    * Add ratelimit headers

    * [Mega-Linter] Apply linters fixes

    * Only get package version once (newrelic#928)

    * Only get package version once

    * Add disconnect method

    * Add disconnect method

    ---------

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

    * Add datalib dependency for embedding testing.

    * Add OpenAI Test Infrastructure (newrelic#926)

    * Add openai to tox

    * Add OpenAI test files.

    * Add test functions.

    * [Mega-Linter] Apply linters fixes

    ---------

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

    * Add mock external openai server

    * Add mocked OpenAI server fixtures

    * Set up recorded responses.

    * Clean mock server to depend on http server

    * Linting

    * Remove approved paths

    * Add mocking for embedding endpoint

    * [Mega-Linter] Apply linters fixes

    * Add ratelimit headers

    * [Mega-Linter] Apply linters fixes

    * Add datalib dependency for embedding testing.

    ---------

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

commit db63d45
Author: Uma Annamalai <uannamalai@newrelic.com>
Date:   Mon Oct 2 15:31:38 2023 -0700

    Add OpenAI Test Infrastructure (newrelic#926)

    * Add openai to tox

    * Add OpenAI test files.

    * Add test functions.

    * [Mega-Linter] Apply linters fixes

    ---------

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

* Squashed commit of the following:

commit 182c7a8
Author: Uma Annamalai <uannamalai@newrelic.com>
Date:   Fri Oct 13 10:12:55 2023 -0700

    Add request/ response IDs.

commit f6d13f8
Author: Uma Annamalai <uannamalai@newrelic.com>
Date:   Thu Oct 12 13:23:39 2023 -0700

    Test cleanup.

commit d057663
Author: Uma Annamalai <uannamalai@newrelic.com>
Date:   Tue Oct 10 10:23:00 2023 -0700

    Remove commented code.

commit dd29433
Author: Uma Annamalai <uannamalai@newrelic.com>
Date:   Tue Oct 10 10:19:01 2023 -0700

    Add openai sync instrumentation.

commit 2834663
Author: Timothy Pansino <11214426+TimPansino@users.noreply.github.com>
Date:   Mon Oct 9 17:42:05 2023 -0700

    OpenAI Mock Backend (newrelic#929)

    * Add mock external openai server

    * Add mocked OpenAI server fixtures

    * Set up recorded responses.

    * Clean mock server to depend on http server

    * Linting

    * Pin flask version for flask restx tests. (newrelic#931)

    * Ignore new redis methods. (newrelic#932)

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

    * Remove approved paths

    * Update CI Image (newrelic#930)

    * Update available python versions in CI

    * Update makefile with overrides

    * Fix default branch detection for arm builds

    ---------

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

    * Add mocking for embedding endpoint

    * [Mega-Linter] Apply linters fixes

    * Add ratelimit headers

    * [Mega-Linter] Apply linters fixes

    * Only get package version once (newrelic#928)

    * Only get package version once

    * Add disconnect method

    * Add disconnect method

    ---------

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

    * Add datalib dependency for embedding testing.

    * Add OpenAI Test Infrastructure (newrelic#926)

    * Add openai to tox

    * Add OpenAI test files.

    * Add test functions.

    * [Mega-Linter] Apply linters fixes

    ---------

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

    * Add mock external openai server

    * Add mocked OpenAI server fixtures

    * Set up recorded responses.

    * Clean mock server to depend on http server

    * Linting

    * Remove approved paths

    * Add mocking for embedding endpoint

    * [Mega-Linter] Apply linters fixes

    * Add ratelimit headers

    * [Mega-Linter] Apply linters fixes

    * Add datalib dependency for embedding testing.

    ---------

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

commit db63d45
Author: Uma Annamalai <uannamalai@newrelic.com>
Date:   Mon Oct 2 15:31:38 2023 -0700

    Add OpenAI Test Infrastructure (newrelic#926)

    * Add openai to tox

    * Add OpenAI test files.

    * Add test functions.

    * [Mega-Linter] Apply linters fixes

    ---------

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

* Cache Package Version Lookups (newrelic#946)

* Cache _get_package_version

* Add Python 2.7 support to get_package_version caching

* [Mega-Linter] Apply linters fixes

* Bump tests

---------

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

* Fix Redis Generator Methods (newrelic#947)

* Fix scan_iter for redis

* Replace generator methods

* Update instance info instrumentation

* Remove mistake from uninstrumented methods

* Add skip condition to asyncio generator tests

* Add skip condition to asyncio generator tests

---------

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

* TEMP

* Automatic RPM System Updates (newrelic#948)

* Checkout old action

* Adding RPM action

* Add dry run

* Incorporating action into workflow

* Wire secret into custom action

* Enable action

* Correct action name

* Fix syntax

* Fix quoting issues

* Drop pre-verification. Does not work on python

* Fix merge artifact

* Bedrock titan extraction nearly complete

* Cleaning up titan bedrock implementation

* TEMP

* Tests for bedrock passing

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

* Cleaned up titan testing

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

* Parametrized bedrock testing

* Add support for AI21-J2 models

* Change to dynamic no conversation id events

* Drop all openai refs

* [Mega-Linter] Apply linters fixes

* Adding response_id and response_model

* Drop python 3.7 tests for Hypercorn (newrelic#954)

* Apply suggestions from code review

* Remove unused import

---------

Co-authored-by: Uma Annamalai <uannamalai@newrelic.com>
Co-authored-by: SlavaSkvortsov <29122694+SlavaSkvortsov@users.noreply.github.com>
Co-authored-by: TimPansino <TimPansino@users.noreply.github.com>
Co-authored-by: Lalleh Rafeei <lrafeei@newrelic.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@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: Lalleh Rafeei <84813886+lrafeei@users.noreply.github.com>

* Feature bedrock cohere instrumentation (newrelic#955)

* Add AWS Bedrock testing infrastructure

* Squashed commit of the following:

commit 2834663
Author: Timothy Pansino <11214426+TimPansino@users.noreply.github.com>
Date:   Mon Oct 9 17:42:05 2023 -0700

    OpenAI Mock Backend (newrelic#929)

    * Add mock external openai server

    * Add mocked OpenAI server fixtures

    * Set up recorded responses.

    * Clean mock server to depend on http server

    * Linting

    * Pin flask version for flask restx tests. (newrelic#931)

    * Ignore new redis methods. (newrelic#932)

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

    * Remove approved paths

    * Update CI Image (newrelic#930)

    * Update available python versions in CI

    * Update makefile with overrides

    * Fix default branch detection for arm builds

    ---------

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

    * Add mocking for embedding endpoint

    * [Mega-Linter] Apply linters fixes

    * Add ratelimit headers

    * [Mega-Linter] Apply linters fixes

    * Only get package version once (newrelic#928)

    * Only get package version once

    * Add disconnect method

    * Add disconnect method

    ---------

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

    * Add datalib dependency for embedding testing.

    * Add OpenAI Test Infrastructure (newrelic#926)

    * Add openai to tox

    * Add OpenAI test files.

    * Add test functions.

    * [Mega-Linter] Apply linters fixes

    ---------

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

    * Add mock external openai server

    * Add mocked OpenAI server fixtures

    * Set up recorded responses.

    * Clean mock server to depend on http server

    * Linting

    * Remove approved paths

    * Add mocking for embedding endpoint

    * [Mega-Linter] Apply linters fixes

    * Add ratelimit headers

    * [Mega-Linter] Apply linters fixes

    * Add datalib dependency for embedding testing.

    ---------

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

commit db63d45
Author: Uma Annamalai <uannamalai@newrelic.com>
Date:   Mon Oct 2 15:31:38 2023 -0700

    Add OpenAI Test Infrastructure (newrelic#926)

    * Add openai to tox

    * Add OpenAI test files.

    * Add test functions.

    * [Mega-Linter] Apply linters fixes

    ---------

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

* Squashed commit of the following:

commit 182c7a8
Author: Uma Annamalai <uannamalai@newrelic.com>
Date:   Fri Oct 13 10:12:55 2023 -0700

    Add request/ response IDs.

commit f6d13f8
Author: Uma Annamalai <uannamalai@newrelic.com>
Date:   Thu Oct 12 13:23:39 2023 -0700

    Test cleanup.

commit d057663
Author: Uma Annamalai <uannamalai@newrelic.com>
Date:   Tue Oct 10 10:23:00 2023 -0700

    Remove commented code.

commit dd29433
Author: Uma Annamalai <uannamalai@newrelic.com>
Date:   Tue Oct 10 10:19:01 2023 -0700

    Add openai sync instrumentation.

commit 2834663
Author: Timothy Pansino <11214426+TimPansino@users.noreply.github.com>
Date:   Mon Oct 9 17:42:05 2023 -0700

    OpenAI Mock Backend (newrelic#929)

    * Add mock external openai server

    * Add mocked OpenAI server fixtures

    * Set up recorded responses.

    * Clean mock server to depend on http server

    * Linting

    * Pin flask version for flask restx tests. (newrelic#931)

    * Ignore new redis methods. (newrelic#932)

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

    * Remove approved paths

    * Update CI Image (newrelic#930)

    * Update available python versions in CI

    * Update makefile with overrides

    * Fix default branch detection for arm builds

    ---------

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

    * Add mocking for embedding endpoint

    * [Mega-Linter] Apply linters fixes

    * Add ratelimit headers

    * [Mega-Linter] Apply linters fixes

    * Only get package version once (newrelic#928)

    * Only get package version once

    * Add disconnect method

    * Add disconnect method

    ---------

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

    * Add datalib dependency for embedding testing.

    * Add OpenAI Test Infrastructure (newrelic#926)

    * Add openai to tox

    * Add OpenAI test files.

    * Add test functions.

    * [Mega-Linter] Apply linters fixes

    ---------

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

    * Add mock external openai server

    * Add mocked OpenAI server fixtures

    * Set up recorded responses.

    * Clean mock server to depend on http server

    * Linting

    * Remove approved paths

    * Add mocking for embedding endpoint

    * [Mega-Linter] Apply linters fixes

    * Add ratelimit headers

    * [Mega-Linter] Apply linters fixes

    * Add datalib dependency for embedding testing.

    ---------

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

commit db63d45
Author: Uma Annamalai <uannamalai@newrelic.com>
Date:   Mon Oct 2 15:31:38 2023 -0700

    Add OpenAI Test Infrastructure (newrelic#926)

    * Add openai to tox

    * Add OpenAI test files.

    * Add test functions.

    * [Mega-Linter] Apply linters fixes

    ---------

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

* TEMP

* Bedrock titan extraction nearly complete

* Cleaning up titan bedrock implementation

* TEMP

* Tests for bedrock passing

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

* Cleaned up titan testing

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

* Parametrized bedrock testing

* Add support for AI21-J2 models

* Change to dynamic no conversation id events

* Add cohere model

* Remove openai instrumentation from this branch

* Remove OpenAI from newrelic/config.py

---------

Co-authored-by: Uma Annamalai <uannamalai@newrelic.com>
Co-authored-by: Tim Pansino <timpansino@gmail.com>
Co-authored-by: Lalleh Rafeei <lrafeei@users.noreply.github.com>
Co-authored-by: Hannah Stepanek <hmstepanek@users.noreply.github.com>

* AWS Bedrock Embedding Instrumentation (newrelic#957)

* AWS Bedrock embedding instrumentation

* Correct symbol name

* Add support for bedrock claude (newrelic#960)

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

* Combine Botocore Tests (newrelic#959)

* Initial file migration

* Enable DT on all span tests

* Add pytest skip for older botocore versions

* Fixup: app name merge conflict

---------

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

* Initial bedrock error tracing commit

* Add status code to mock bedrock server

* Updating error response recording logic

* Work on bedrock errror tracing

* Chat completion error tracing

* Adding embedding error tracing

* Delete comment

* Update moto

* Fix botocore tests & re-structure

* [Mega-Linter] Apply linters fixes

---------

Co-authored-by: Timothy Pansino <11214426+TimPansino@users.noreply.github.com>
Co-authored-by: Uma Annamalai <uannamalai@newrelic.com>
Co-authored-by: SlavaSkvortsov <29122694+SlavaSkvortsov@users.noreply.github.com>
Co-authored-by: TimPansino <TimPansino@users.noreply.github.com>
Co-authored-by: Lalleh Rafeei <lrafeei@newrelic.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@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: Lalleh Rafeei <84813886+lrafeei@users.noreply.github.com>
Co-authored-by: Tim Pansino <timpansino@gmail.com>
* Fix package version performance regression

* Update tests/agent_unittests/test_package_version_utils.py

* Update tests/agent_unittests/test_package_version_utils.py

* Update tests/agent_unittests/test_package_version_utils.py

* Skip test in python 2

---------

Co-authored-by: Hannah Stepanek <hstepanek@newrelic.com>
…op-k2-integration' into develop-k2-integration
* Add support for new synthetics info header

* Add testing for new synthetics headers

* Linting

* Fixup tests for synthetics headers

* Add tests for snake and camel casing

---------

Co-authored-by: Uma Annamalai <uannamalai@newrelic.com>
* Use shared directory for pyenv

* Simplify permissions

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
* Add capture_dependencies.enabled setting

* Change setting name

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
* Add support for new synthetics info header

* Add testing for new synthetics headers

* Linting

* Fixup tests for synthetics headers

* Add tests for snake and camel casing

---------

Co-authored-by: Uma Annamalai <uannamalai@newrelic.com>
* Docker cgroups v2 utilization

* Update docker cross agent tests with cgroups v2

* Updated cgroups detection logic

* Remove unnecessary grouping

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
* Replaced pkg_resources with importlib.metadata

* Add tested/working tests to tox

* importlib.metadata version and entry_points logic (newrelic#898)

* Replaced pkg_resources with importlib.metadata

* Fix entry_points logic for Py312

* Fix logic for entry_points

* Check to see if list or string

* Add Python 3.12 to container setup

* Pin dev CI image SHA

* Revert sha to latest

* Datastores: Replace __version__ with get_package_version (newrelic#899)

* Replaced pkg_resources with importlib.metadata

* Replace pkg_resources in wrapt/importer.py

* Add get_package_version from datastores

* [Mega-Linter] Apply linters fixes

* Push empty commit

* Add assert statements for version

---------

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

* Lambdas and Boto: Replace __version__ with get_package_version (newrelic#902)

* Replaced pkg_resources with importlib.metadata

* Replace pkg_resources in wrapt/importer.py

* Add get_package_version for lambdas/boto

* Unpin moto version in tests

* Fix graphql imports in tox

* Add 3.12 release candidate 2 to python versions

* Add remaining working 3.12 tests

* [Mega-Linter] Apply linters fixes

* Trigger test run

* [Mega-Linter] Apply linters fixes

* Fix some merge issues

* Fix some (more) merge issues

* Remove old tests in tox

* Remove unsupported Django testing (< v2.0)

* Fix some tests for agent_features

* Fix cherrypy test env in tox

* Pin hypercorn (for now)

* Add more py312 runs and unpin hypercorn

* Adding known working test suites

* Add remaining non-working test suites

* Fix SKLearn Py 3.12

* Fix typos in odbc

* Fix fixture scopes for hypercorn

* Add settings patch to fix local testing

---------

Co-authored-by: lrafeei <lrafeei@users.noreply.github.com>
Co-authored-by: Timothy Pansino <11214426+TimPansino@users.noreply.github.com>
Co-authored-by: Tim Pansino <timpansino@gmail.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
* Fix bug with CallsiteParameters.

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

* Add test for structlog processors.

* Add test file for structlog processors.

* Fix import ordering.

* Move asssertion logic into test file.

---------

Co-authored-by: Tim Pansino <tpansino@newrelic.com>
Co-authored-by: Hannah Stepanek <hstepanek@newrelic.com>
* Update wrapt to 1.16.0

* Import duplicate functions directly from wrapt

* Update object wrappers for wrapt 1.16.0

* Add warning to wrapt duplicate code

* Linting

* Use super rather than hard coded Object proxy

* Formatting

* Add test file for wrapper attributes

* Linting

* Add descriptions to assertions

* Overhaul test suite for clarity

* Move functions into fixtures

* [Mega-Linter] Apply linters fixes

* Bump tests

* Fix typo

* Larger timeout for protobuf

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: TimPansino <TimPansino@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants