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

Remove graphql 2 & promise support #875

Merged
merged 136 commits into from
Aug 23, 2023
Merged
Show file tree
Hide file tree
Changes from 125 commits
Commits
Show all changes
136 commits
Select commit Hold shift + click to select a range
9a56f3a
Update Versioning Scheme (#651)
TimPansino Oct 10, 2022
65246e7
Fix Trace Finalizer Crashes (#652)
TimPansino Oct 10, 2022
b9bca3d
Add usage tracking metrics for Kafka clients. (#658)
umaannamalai Oct 17, 2022
968f3dc
Deprecate add_custom_parameter(s) API (#655)
lrafeei Oct 17, 2022
922db2f
Add usage metrics for Daphne and Hypercorn. (#665)
umaannamalai Oct 20, 2022
c96ffc5
Fix Flask view support in Code Level Metrics (#664)
TimPansino Oct 24, 2022
820e0b7
Fix aioredis version crash (#661)
TimPansino Oct 24, 2022
03131c9
Add double wrapped testing for Hypercorn and Daphne and dispatcher ar…
umaannamalai Oct 24, 2022
1e6c937
Add Python 3.11 Support (#654)
TimPansino Oct 24, 2022
ca420b3
Remove devcontainer submodule (#669)
TimPansino Oct 24, 2022
a66a33a
Uncomment NewRelicContextFormatter from agent.py (#676)
lrafeei Oct 26, 2022
7b82cb9
Fix botocore tests for botocore v1.28.1+ (#675)
lrafeei Oct 26, 2022
caa9485
Feature increased custom event limit (#674)
hmstepanek Oct 26, 2022
1d4e3e5
Add python 3.11 stable release to GHA (#671)
TimPansino Oct 26, 2022
1279bdf
Double kafka test runners (#677)
TimPansino Oct 27, 2022
d28f0d4
Fix failing flask_rest tests (#683)
hmstepanek Nov 5, 2022
cd7e150
Fix failing botocore tests (#684)
hmstepanek Nov 7, 2022
d4ff1ec
Add record_log_event to public api (#681)
hmstepanek Nov 7, 2022
062e702
Add patch for sentry SDK to correct ASGI v2/v3 detection. (#680)
umaannamalai Nov 10, 2022
f014708
Update pip install command (#688)
TimPansino Nov 10, 2022
52e1011
Validator transfer from fixtures.py to validators directory, Part 1 (…
lrafeei Nov 11, 2022
1bb2be4
Initialize ExternalNode properties (#687)
Nov 14, 2022
7ae0c94
Fix package_version_utils.py logic (#689)
lrafeei Nov 16, 2022
eb28b52
Pin Github Actions Runner to Ubuntu 20 for Py27 (#698)
TimPansino Nov 23, 2022
eead7a7
Fix Confluent Kafka Producer Arguments (#699)
TimPansino Nov 24, 2022
60a5d68
Fix tornado master tests & instrument redis 4.3.5 (#695)
hmstepanek Nov 28, 2022
67feaa7
Remove pylint codes from flake8 config (#701)
hmstepanek Nov 28, 2022
87b649f
Validator transfer from fixtures.py to validators directory, Part 2 (…
lrafeei Nov 30, 2022
864f086
Fix bug in celery where works don't report data (#696)
hmstepanek Nov 30, 2022
b849010
Reverts removal of flask_restful hooks. (#705)
TimPansino Dec 1, 2022
a63e33f
Update instrumented methods in redis. (#707)
TimPansino Dec 6, 2022
f977ba6
Add TraceCache Guarded Iteration (#704)
TimPansino Dec 7, 2022
fd0fd01
Fix Type Constructor Classes in Code Level Metrics (#708)
TimPansino Dec 7, 2022
9cbae01
Fix sanic and starlette tests (#734)
lrafeei Jan 3, 2023
d7987b9
Add methods to instrument (#738)
lrafeei Jan 9, 2023
045b8f8
Add card to instrumented methods in Redis (#740)
lrafeei Jan 11, 2023
05d8569
Add DevContainer (#711)
TimPansino Jan 18, 2023
b45bdd8
Module classmethod fix (#662)
lrafeei Jan 18, 2023
0db5fee
Fix log decorating to be JSON compatible (#736)
lrafeei Jan 20, 2023
01ceca7
Revert "Fix log decorating to be JSON compatible" (#746)
hmstepanek Jan 26, 2023
1d8d078
Add apdexPerfZone attribute to Transaction. (#753)
kanderson250 Jan 27, 2023
5844bb1
Fix tests in starlette v0.23.1 (#752)
lrafeei Jan 31, 2023
a765809
Support `redis.asyncio` (#744)
pauk-slon Jan 26, 2023
daf57b6
Redis Asyncio Testing (#750)
TimPansino Jan 31, 2023
0608ca4
CodeCov Integration (#710)
TimPansino Feb 9, 2023
b0d4e73
Mergify (#761)
TimPansino Feb 9, 2023
1bf6a65
Elasticsearch v8 support (#741)
lrafeei Feb 9, 2023
061ad59
Update contributors workspace link in CONTRIBUTING.rst. (#760)
umaannamalai Feb 9, 2023
300de2a
Add Retry to Pip Install (#763)
TimPansino Feb 9, 2023
3410270
Add aiohttp support for expected status codes (#735)
justin-richert Feb 10, 2023
6c06f9b
Fix PyPy Priority Sampling Test (#766)
TimPansino Feb 10, 2023
aae9563
Config linter fixes (#768)
lrafeei Feb 15, 2023
a75c076
Sync tests w/ agents/cross_agent_tests/pull/150 (#770)
hmstepanek Feb 15, 2023
59abb6a
Infinite Tracing Batching & Compression (#762)
TimPansino Feb 16, 2023
b54a7e9
Fix DT settings for txn feature tests (#771)
TimPansino Feb 16, 2023
86994c0
Fix pyramid testing versions (#764)
TimPansino Feb 16, 2023
b975754
Fix Ariadne Middleware Testing (#776)
TimPansino Mar 8, 2023
16a0b87
Exclude merged PRs from automatic mergify actions. (#774)
TimPansino Mar 8, 2023
572b24b
Refactor Code Coverage (#765)
TimPansino Mar 15, 2023
df9701c
Add GraphQL Introspection Setting (#783)
TimPansino Mar 20, 2023
fbb851e
Fix instance info tests for redis. (#784)
umaannamalai Mar 20, 2023
912d088
Fix Redis Instance Info (#790)
TimPansino Mar 30, 2023
637879a
Guard GraphQL Settings Lookup (#787)
TimPansino Mar 30, 2023
107c0a6
Errors Inbox Improvements (#791)
TimPansino Mar 30, 2023
11c1cda
Update Packages (#793)
TimPansino Apr 5, 2023
4d644c6
Remove Unused Instrumentation and Tests (#794)
TimPansino Apr 5, 2023
153690f
Fix Loguru Instrumentation for v0.7.0 (#798)
TimPansino Apr 12, 2023
caef2cc
Remove Twisted framework (#800)
lrafeei Apr 25, 2023
363122a
Pin virtualenv, fix pip arg deprecation & disable kafka tests (#803)
hmstepanek May 1, 2023
7103506
Add tests for pyodbc (#796)
hmstepanek May 1, 2023
be4fb3d
Add tests for Waitress (#797)
lrafeei May 1, 2023
fd0fa35
Add testing for genshi and mako. (#799)
umaannamalai May 2, 2023
3d82845
Omit some frameworks from coverage analysis (#810)
lrafeei May 3, 2023
a963649
Run coverage around pytest (#813)
hmstepanek May 9, 2023
c2d4629
Add required option for tox v4 (#795)
TimPansino May 10, 2023
f192c24
Fix Testing Failures (#828)
TimPansino Jun 12, 2023
3def8b0
Fix pytest test filtering when running tox (#823)
hmstepanek Jun 12, 2023
90ccb4c
Validator transfer p3 (#745)
lrafeei Jun 14, 2023
668b0a9
Fix set output warning using new GHA syntax (#833)
TimPansino Jun 21, 2023
abb6405
Remove Python 2.7 and pypy2 testing (#835)
lrafeei Jun 21, 2023
ab92daf
Containerized CI Pipeline (#836)
TimPansino Jun 22, 2023
4422b95
Fix CI Image Tagging (#838)
TimPansino Jun 22, 2023
4da4612
Temporarily Restore Old CI Pipeline (#841)
TimPansino Jun 22, 2023
658f818
Rework CI Pipeline (#839)
TimPansino Jun 22, 2023
57720fd
Fix Tests on New CI (#843)
TimPansino Jun 23, 2023
a7dfe33
Instrument Redis waitaof (#851)
TimPansino Jun 26, 2023
33aa111
Ignore patched hooks files. (#849)
umaannamalai Jun 26, 2023
e707cc0
Fix local scoped package reporting (#837)
hmstepanek Jun 26, 2023
ab590a2
MSSQL Testing (#852)
TimPansino Jun 27, 2023
db07523
Exclude command line functionality from test coverage (#855)
lrafeei Jun 27, 2023
c2fd5e3
FIX: resilient environment settings (#825)
aaeabdo Jun 27, 2023
9883c2b
Replace drop_transaction logic by using transaction context manager (…
lrafeei Jun 28, 2023
998b035
Upgrade to Pypy38 for TypedDict (#861)
lrafeei Jun 30, 2023
66c2e19
Add profile_trace testing (#858)
umaannamalai Jun 30, 2023
e663c36
Add Transaction API Tests (#857)
lrafeei Jun 30, 2023
3bdb013
Add tests for jinja2. (#842)
umaannamalai Jun 30, 2023
6644846
Add tests for newrelic/config.py (#860)
hmstepanek Jun 30, 2023
ee92363
Fix starlette testing matrix for updated behavior. (#869)
TimPansino Jul 14, 2023
53fc51a
Correct Serverless Distributed Tracing Logic (#870)
TimPansino Jul 14, 2023
2f580af
Fix Kafka CI (#863)
TimPansino Jul 14, 2023
a7080e9
Change image tag to latest (#871)
hmstepanek Jul 17, 2023
56ea815
Add full version for pypy3.8 to tox (#872)
lrafeei Jul 18, 2023
57b19c7
Remove graphql 2 support & promise support
hmstepanek Jul 19, 2023
a39c42b
Merge branch 'main' into remove-graphql-2
hmstepanek Jul 20, 2023
a248688
Instrument RedisCluster (#809)
hmstepanek Jul 27, 2023
08eec5e
Ignore Django instrumentation from older versions (#859)
lrafeei Jul 28, 2023
e4d1b8c
Remove py2_namespace from validator
hmstepanek Aug 1, 2023
29d5e6a
Fix differences w/ main
hmstepanek Aug 1, 2023
b6ac77f
Fixup
hmstepanek Aug 1, 2023
4b3768b
Modify postgresql tests to include WITH query (#885)
lrafeei Aug 2, 2023
9f6b640
Fixup: merge
hmstepanek Aug 2, 2023
e6739de
Fixup tests
hmstepanek Aug 3, 2023
4d49ea5
Fixup
hmstepanek Aug 3, 2023
1fad516
Fixup: remove old test files
hmstepanek Aug 3, 2023
4d6781e
Remove app specific ariadne tests
hmstepanek Aug 4, 2023
edae676
Fix ariadne middleware tests for all versions.
umaannamalai Aug 8, 2023
946017b
Fix broken graphene tests and update strawberry version logic.
umaannamalai Aug 9, 2023
d5190b7
Remove graphql starlette code.
umaannamalai Aug 9, 2023
10cc552
Merge branch 'main' into remove-graphql-2
umaannamalai Aug 9, 2023
17f8937
Develop redis addons (#888)
lrafeei Aug 10, 2023
36c4abb
Merge branch 'main' into remove-graphql-2
umaannamalai Aug 10, 2023
8ebe9a3
Add google firestore instrumentation (#893)
umaannamalai Aug 10, 2023
238b64d
Base Devcontainer on CI Image (#873)
TimPansino Aug 10, 2023
d1c119e
Merge branch 'develop-graphql-async' into remove-graphql-2
umaannamalai Aug 11, 2023
fe6f522
Use get_package_verison for graphql-core.
umaannamalai Aug 11, 2023
fc7aadf
Add import.
umaannamalai Aug 11, 2023
b6e2d17
Update concatenation in django rest tests.
umaannamalai Aug 15, 2023
dc87bd3
Add support for redis v5. (#895)
umaannamalai Aug 15, 2023
7d76243
Use importlib.metadata first to avoid deprecation warnings (#878)
renanivo Aug 16, 2023
f1a673e
Fix Normalization Rules (#894)
TimPansino Aug 16, 2023
745a1e3
Add py2_namespace back to code level metrics validator.
umaannamalai Aug 21, 2023
744d2ef
Fix flask rest rests.
umaannamalai Aug 21, 2023
67baa83
Add graphql version back.
umaannamalai Aug 21, 2023
e5d95a8
Disable instrumentation if graphql-core v2 is being used.
umaannamalai Aug 22, 2023
a413e7a
Clean up.
umaannamalai Aug 22, 2023
b2f0a98
Merge branch 'main' into remove-graphql-2
umaannamalai Aug 22, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions newrelic/hooks/component_graphqlserver.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
from newrelic.api.asgi_application import wrap_asgi_application
from newrelic.api.error_trace import ErrorTrace
from newrelic.api.graphql_trace import GraphQLOperationTrace
from newrelic.api.transaction import current_transaction
from newrelic.api.transaction_name import TransactionNameWrapper
from newrelic.common.object_names import callable_name
from newrelic.common.object_wrapper import wrap_function_wrapper
from newrelic.core.graphql_utils import graphql_statement
from newrelic.hooks.framework_graphql import (
framework_version as graphql_framework_version,
GRAPHQL_VERSION,
ignore_graphql_duplicate_exception,
)
from newrelic.hooks.framework_graphql import ignore_graphql_duplicate_exception


def framework_details():
import graphql_server

return ("GraphQLServer", getattr(graphql_server, "__version__", None))


def bind_query(schema, params, *args, **kwargs):
return getattr(params, "query", None)

Expand All @@ -32,7 +33,7 @@ def wrap_get_response(wrapped, instance, args, kwargs):

framework = framework_details()
transaction.add_framework_info(name=framework[0], version=framework[1])
transaction.add_framework_info(name="GraphQL", version=graphql_framework_version())
transaction.add_framework_info(name="GraphQL", version=GRAPHQL_VERSION)

if hasattr(query, "body"):
query = query.body
Expand All @@ -45,5 +46,6 @@ def wrap_get_response(wrapped, instance, args, kwargs):
with ErrorTrace(ignore=ignore_graphql_duplicate_exception):
return wrapped(*args, **kwargs)


def instrument_graphqlserver(module):
wrap_function_wrapper(module, "get_response", wrap_get_response)
wrap_function_wrapper(module, "get_response", wrap_get_response)
33 changes: 10 additions & 23 deletions newrelic/hooks/framework_ariadne.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,14 @@
from newrelic.api.wsgi_application import wrap_wsgi_application
from newrelic.common.object_names import callable_name
from newrelic.common.object_wrapper import wrap_function_wrapper
from newrelic.common.package_version_utils import get_package_version
from newrelic.core.graphql_utils import graphql_statement
from newrelic.hooks.framework_graphql import (
framework_version as graphql_framework_version,
GRAPHQL_VERSION,
ignore_graphql_duplicate_exception,
)
from newrelic.hooks.framework_graphql import ignore_graphql_duplicate_exception


def framework_details():
try:
import ariadne
version = ariadne.__version__
except Exception:
try:
import pkg_resources
version = pkg_resources.get_distribution("ariadne").version
except Exception:
version = None

return ("Ariadne", version)
ARIADNE_VERSION = get_package_version("ariadne")


def bind_graphql(schema, data, *args, **kwargs):
Expand All @@ -57,9 +46,8 @@ def wrap_graphql_sync(wrapped, instance, args, kwargs):
except TypeError:
return wrapped(*args, **kwargs)

framework = framework_details()
transaction.add_framework_info(name=framework[0], version=framework[1]) # No version info available on ariadne
transaction.add_framework_info(name="GraphQL", version=graphql_framework_version())
transaction.add_framework_info(name="Ariadne", version=ARIADNE_VERSION)
transaction.add_framework_info(name="GraphQL", version=GRAPHQL_VERSION)

query = data["query"]
if hasattr(query, "body"):
Expand Down Expand Up @@ -91,9 +79,8 @@ async def wrap_graphql(wrapped, instance, args, kwargs):
result = await result
return result

framework = framework_details()
transaction.add_framework_info(name=framework[0], version=framework[1]) # No version info available on ariadne
transaction.add_framework_info(name="GraphQL", version=graphql_framework_version())
transaction.add_framework_info(name="Ariadne", version=ARIADNE_VERSION)
transaction.add_framework_info(name="GraphQL", version=GRAPHQL_VERSION)

query = data["query"]
if hasattr(query, "body"):
Expand Down Expand Up @@ -121,9 +108,9 @@ def instrument_ariadne_execute(module):

def instrument_ariadne_asgi(module):
if hasattr(module, "GraphQL"):
wrap_asgi_application(module, "GraphQL.__call__", framework=framework_details())
wrap_asgi_application(module, "GraphQL.__call__", framework=("GraphQL", GRAPHQL_VERSION))


def instrument_ariadne_wsgi(module):
if hasattr(module, "GraphQL"):
wrap_wsgi_application(module, "GraphQL.__call__", framework=framework_details())
wrap_wsgi_application(module, "GraphQL.__call__", framework=("GraphQL", GRAPHQL_VERSION))
Loading