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 all 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
16 changes: 13 additions & 3 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
ARG IMAGE=ghcr.io/newrelic-experimental/pyenv-devcontainer:latest

# To target other architectures, change the --platform directive in the Dockerfile.
FROM --platform=linux/amd64 ${IMAGE}
ARG IMAGE_TAG=latest
FROM ghcr.io/newrelic/newrelic-python-agent-ci:${IMAGE_TAG}

# Setup non-root user
USER root
ARG UID=1000
ARG GID=$UID
ENV HOME /home/vscode
RUN mkdir -p ${HOME} && \
groupadd --gid ${GID} vscode && \
useradd --uid ${UID} --gid ${GID} --home ${HOME} vscode && \
chown -R ${UID}:${GID} /home/vscode
USER ${UID}:${GID}
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// To target other architectures, change the --platform directive in the Dockerfile.
"dockerfile": "Dockerfile",
"args": {
"IMAGE": "ghcr.io/newrelic-experimental/pyenv-devcontainer:latest"
"IMAGE_TAG": "latest"
}
},
"remoteUser": "vscode",
Expand Down
13 changes: 11 additions & 2 deletions .github/containers/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
build-essential \
curl \
expat \
fish \
fontconfig \
freetds-common \
freetds-dev \
gcc \
Expand All @@ -46,13 +48,16 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
python2-dev \
python3-dev \
python3-pip \
sudo \
tzdata \
unixodbc-dev \
unzip \
vim \
wget \
zip \
zlib1g \
zlib1g-dev && \
zlib1g-dev \
zsh && \
rm -rf /var/lib/apt/lists/*

# Build librdkafka from source
Expand Down Expand Up @@ -93,6 +98,10 @@ RUN echo 'eval "$(pyenv init -)"' >>$HOME/.bashrc && \
# Install Python
ARG PYTHON_VERSIONS="3.10 3.9 3.8 3.7 3.11 2.7 pypy2.7-7.3.12 pypy3.8-7.3.11"
COPY --chown=1000:1000 --chmod=+x ./install-python.sh /tmp/install-python.sh
COPY ./requirements.txt /requirements.txt
RUN /tmp/install-python.sh && \
rm /tmp/install-python.sh

# Install dependencies for main python installation
COPY ./requirements.txt /tmp/requirements.txt
RUN pyenv exec pip install --upgrade -r /tmp/requirements.txt && \
rm /tmp/requirements.txt
4 changes: 2 additions & 2 deletions .github/containers/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ REPO_ROOT:=$(realpath $(MAKEFILE_DIR)../../)
.PHONY: default
default: test

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

# Ensure python versions are usable
.PHONY: test
test: build
@# Ensure python versions are usable
@docker run --rm ghcr.io/newrelic/python-agent-ci:local /bin/bash -c '\
python3.10 --version && \
python2.7 --version && \
Expand Down
3 changes: 0 additions & 3 deletions .github/containers/install-python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@ main() {

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

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

main
8 changes: 6 additions & 2 deletions .github/containers/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
bandit
black
flake8
isort
pip
setuptools
wheel
tox
virtualenv<20.22.0
tox
wheel
2 changes: 1 addition & 1 deletion .github/workflows/build-ci-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,6 @@ jobs:
with:
push: ${{ github.event_name != 'pull_request' }}
context: .github/containers
platforms: linux/amd64
platforms: ${{ (github.ref == 'refs/head/main') && 'linux/amd64,linux/arm64' || 'linux/amd64' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
65 changes: 65 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1024,3 +1024,68 @@ jobs:
name: coverage-${{ github.job }}-${{ strategy.job-index }}
path: ./**/.coverage.*
retention-days: 1

firestore:
env:
TOTAL_GROUPS: 1

strategy:
fail-fast: false
matrix:
group-number: [1]

runs-on: ubuntu-20.04
container:
image: ghcr.io/newrelic/newrelic-python-agent-ci:latest
options: >-
--add-host=host.docker.internal:host-gateway
timeout-minutes: 30

services:
firestore:
# Image set here MUST be repeated down below in options. See comment below.
image: gcr.io/google.com/cloudsdktool/google-cloud-cli:437.0.1-emulators
ports:
- 8080:8080
# Set health checks to wait 5 seconds in lieu of an actual healthcheck
options: >-
--health-cmd "echo success"
--health-interval 10s
--health-timeout 5s
--health-retries 5
--health-start-period 5s
gcr.io/google.com/cloudsdktool/google-cloud-cli:437.0.1-emulators /bin/bash -c "gcloud emulators firestore start --host-port=0.0.0.0:8080" ||
# This is a very hacky solution. GitHub Actions doesn't provide APIs for setting commands on services, but allows adding arbitrary options.
# --entrypoint won't work as it only accepts an executable and not the [] syntax.
# Instead, we specify the image again the command afterwards like a call to docker create. The result is a few environment variables
# and the original command being appended to our hijacked docker create command. We can avoid any issues by adding || to prevent that
# from every being executed as bash commands.

steps:
- uses: actions/checkout@v3

- name: Fetch git tags
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
git fetch --tags origin

- name: Get Environments
id: get-envs
run: |
echo "envs=$(tox -l | grep '^${{ github.job }}\-' | ./.github/workflows/get-envs.py)" >> $GITHUB_OUTPUT
env:
GROUP_NUMBER: ${{ matrix.group-number }}

- name: Test
run: |
tox -vv -e ${{ steps.get-envs.outputs.envs }} -p auto
env:
TOX_PARALLEL_NO_SPINNER: 1
PY_COLORS: 0

- name: Upload Coverage Artifacts
uses: actions/upload-artifact@v3
with:
name: coverage-${{ github.job }}-${{ strategy.job-index }}
path: ./**/.coverage.*
retention-days: 1
14 changes: 7 additions & 7 deletions newrelic/api/database_trace.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import logging

from newrelic.api.time_trace import TimeTrace, current_trace
from newrelic.common.async_wrapper import async_wrapper
from newrelic.common.async_wrapper import async_wrapper as get_async_wrapper
from newrelic.common.object_wrapper import FunctionWrapper, wrap_object
from newrelic.core.database_node import DatabaseNode
from newrelic.core.stack_trace import current_stack
Expand Down Expand Up @@ -244,9 +244,9 @@ def create_node(self):
)


def DatabaseTraceWrapper(wrapped, sql, dbapi2_module=None):
def DatabaseTraceWrapper(wrapped, sql, dbapi2_module=None, async_wrapper=None):
def _nr_database_trace_wrapper_(wrapped, instance, args, kwargs):
wrapper = async_wrapper(wrapped)
wrapper = async_wrapper if async_wrapper is not None else get_async_wrapper(wrapped)
if not wrapper:
parent = current_trace()
if not parent:
Expand All @@ -273,9 +273,9 @@ def _nr_database_trace_wrapper_(wrapped, instance, args, kwargs):
return FunctionWrapper(wrapped, _nr_database_trace_wrapper_)


def database_trace(sql, dbapi2_module=None):
return functools.partial(DatabaseTraceWrapper, sql=sql, dbapi2_module=dbapi2_module)
def database_trace(sql, dbapi2_module=None, async_wrapper=None):
return functools.partial(DatabaseTraceWrapper, sql=sql, dbapi2_module=dbapi2_module, async_wrapper=async_wrapper)


def wrap_database_trace(module, object_path, sql, dbapi2_module=None):
wrap_object(module, object_path, DatabaseTraceWrapper, (sql, dbapi2_module))
def wrap_database_trace(module, object_path, sql, dbapi2_module=None, async_wrapper=None):
wrap_object(module, object_path, DatabaseTraceWrapper, (sql, dbapi2_module, async_wrapper))
Loading