From 089e835b781675d95712d415eba210a3a2884e56 Mon Sep 17 00:00:00 2001 From: Tim Pansino Date: Tue, 6 Jun 2023 11:25:58 -0700 Subject: [PATCH] Squashed commit of the following: commit a47e209925a210e85bb6c57f0a2efa9e99630b7f Author: Tim Pansino Date: Tue Jun 6 11:11:30 2023 -0700 Commit suggestions from code review commit 1a28d36f86dd3f1fa5ca7a8f56357d168aac69db Author: Tim Pansino 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 Date: Thu May 11 16:57:16 2023 -0700 Add testing for dimensional metrics commit ed33957cd2b20bc1f6e9759a0bad5e4f4a86a38c Author: Tim Pansino Date: Thu May 11 16:56:31 2023 -0700 Add attribute processing to metric identity commit 6caf71ef4386395d950060e0e996f80dbcbfbc32 Author: Tim Pansino Date: Thu May 11 16:56:16 2023 -0700 Add dimensional stats table to stats engine commit 5e1cc9dea6d0d9623130dedd0f787408a8439388 Author: Tim Pansino 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 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 Co-authored-by: Hannah Stepanek commit fd0fa35466b630e34e8476cc53ad0e163564e2de Author: Uma Annamalai 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 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 Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> commit 7103506ca5639d339e3e47dfb9e4affb546c839b Author: Hannah Stepanek 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 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 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 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 Co-authored-by: Hannah Stepanek commit fd0fa35466b630e34e8476cc53ad0e163564e2de Author: Uma Annamalai 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 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 Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> commit 7103506ca5639d339e3e47dfb9e4affb546c839b Author: Hannah Stepanek 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> --- newrelic/common/metric_utils.py | 6 ++---- newrelic/core/data_collector.py | 4 +--- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/newrelic/common/metric_utils.py b/newrelic/common/metric_utils.py index 654f8051c..ebffe8332 100644 --- a/newrelic/common/metric_utils.py +++ b/newrelic/common/metric_utils.py @@ -27,11 +27,9 @@ def create_metric_identity(name, tags=None): # Apply attribute system sanitization. # process_user_attribute returns (None, None) for results that fail sanitization. - # The filter removes these results fromt he iterable before creating the frozenset. + # The filter removes these results from the iterable before creating the frozenset. tags = frozenset(filter(lambda args: args[0] is not None, map(lambda args: process_user_attribute(*args), tags))) - # Set empty iterables after filtering to None - if not tags and tags is not None: - tags = None + tags = tags or None # Set empty iterables after filtering to None return (name, tags) diff --git a/newrelic/core/data_collector.py b/newrelic/core/data_collector.py index 7beefa38a..088946469 100644 --- a/newrelic/core/data_collector.py +++ b/newrelic/core/data_collector.py @@ -150,13 +150,11 @@ def send_dimensional_metric_data(self, start_time, end_time, metric_data): specific metrics. NOTE: This data is sent not sent to the normal agent endpoints but is sent - to the MELT API endpoints to keep the entity separate. This is for use + to the OTLP API endpoints to keep the entity separate. This is for use with the machine learning integration only. """ payload = (self.agent_run_id, start_time, end_time, metric_data) - - return self._otlp_protocol.send("dimensional_metric_data", payload) def send_log_events(self, sampling_info, log_event_data):