From df6760c476788c8335bf50194f8736769f88d8d5 Mon Sep 17 00:00:00 2001 From: Munir Abdinur Date: Thu, 6 Feb 2025 13:16:19 -0500 Subject: [PATCH] remove int --- .riot/requirements/1761702.txt | 23 -- .riot/requirements/1cc7b0e.txt | 25 -- .riot/requirements/1f1e9b4.txt | 25 -- .riot/requirements/9b8251b.txt | 25 -- .riot/requirements/fda8aa6.txt | 25 -- ddtrace/_monkey.py | 1 - ddtrace/contrib/_yaaredis.py | 67 ----- ddtrace/contrib/internal/yaaredis/patch.py | 91 ------- docs/index.rst | 2 - docs/integrations.rst | 6 - docs/spelling_wordlist.txt | 1 - .../sources/min_compatible_versions.csv | 1 - min_compatible_versions.csv | 1 - .../remove-yaaredis-095441532392e12f.yaml | 4 + riotfile.py | 19 -- supported_versions_output.json | 6 - supported_versions_table.csv | 1 - tests/contrib/suitespec.yml | 16 -- tests/contrib/yaaredis/__init__.py | 0 tests/contrib/yaaredis/test_yaaredis.py | 237 ------------------ tests/contrib/yaaredis/test_yaaredis_patch.py | 31 --- ...est_yaaredis.test_analytics_with_rate.json | 38 --- ..._yaaredis.test_analytics_without_rate.json | 38 --- ...ib.yaaredis.test_yaaredis.test_basics.json | 37 --- ...dis.test_yaaredis.test_cmd_max_length.json | 37 --- ...full_command_in_resource_config[True].json | 82 ------ ...dis.test_full_command_in_resource_env.json | 82 ------ ...redis.test_yaaredis.test_long_command.json | 37 --- ...aredis.test_yaaredis.test_opentracing.json | 56 ----- ...test_yaaredis.test_pipeline_immediate.json | 72 ------ ...is.test_yaaredis.test_pipeline_traced.json | 36 --- ....test_schematization[service_schema0].json | 73 ------ ....test_schematization[service_schema1].json | 73 ------ ....test_schematization[service_schema2].json | 75 ------ ....test_schematization[service_schema3].json | 73 ------ ....test_schematization[service_schema4].json | 73 ------ ....test_schematization[service_schema5].json | 75 ------ ...b.yaaredis.test_yaaredis.test_unicode.json | 37 --- 38 files changed, 4 insertions(+), 1597 deletions(-) delete mode 100644 .riot/requirements/1761702.txt delete mode 100644 .riot/requirements/1cc7b0e.txt delete mode 100644 .riot/requirements/1f1e9b4.txt delete mode 100644 .riot/requirements/9b8251b.txt delete mode 100644 .riot/requirements/fda8aa6.txt delete mode 100644 ddtrace/contrib/_yaaredis.py delete mode 100644 ddtrace/contrib/internal/yaaredis/patch.py create mode 100644 releasenotes/notes/remove-yaaredis-095441532392e12f.yaml delete mode 100644 tests/contrib/yaaredis/__init__.py delete mode 100644 tests/contrib/yaaredis/test_yaaredis.py delete mode 100644 tests/contrib/yaaredis/test_yaaredis_patch.py delete mode 100644 tests/snapshots/tests.contrib.yaaredis.test_yaaredis.test_analytics_with_rate.json delete mode 100644 tests/snapshots/tests.contrib.yaaredis.test_yaaredis.test_analytics_without_rate.json delete mode 100644 tests/snapshots/tests.contrib.yaaredis.test_yaaredis.test_basics.json delete mode 100644 tests/snapshots/tests.contrib.yaaredis.test_yaaredis.test_cmd_max_length.json delete mode 100644 tests/snapshots/tests.contrib.yaaredis.test_yaaredis.test_full_command_in_resource_config[True].json delete mode 100644 tests/snapshots/tests.contrib.yaaredis.test_yaaredis.test_full_command_in_resource_env.json delete mode 100644 tests/snapshots/tests.contrib.yaaredis.test_yaaredis.test_long_command.json delete mode 100644 tests/snapshots/tests.contrib.yaaredis.test_yaaredis.test_opentracing.json delete mode 100644 tests/snapshots/tests.contrib.yaaredis.test_yaaredis.test_pipeline_immediate.json delete mode 100644 tests/snapshots/tests.contrib.yaaredis.test_yaaredis.test_pipeline_traced.json delete mode 100644 tests/snapshots/tests.contrib.yaaredis.test_yaaredis.test_schematization[service_schema0].json delete mode 100644 tests/snapshots/tests.contrib.yaaredis.test_yaaredis.test_schematization[service_schema1].json delete mode 100644 tests/snapshots/tests.contrib.yaaredis.test_yaaredis.test_schematization[service_schema2].json delete mode 100644 tests/snapshots/tests.contrib.yaaredis.test_yaaredis.test_schematization[service_schema3].json delete mode 100644 tests/snapshots/tests.contrib.yaaredis.test_yaaredis.test_schematization[service_schema4].json delete mode 100644 tests/snapshots/tests.contrib.yaaredis.test_yaaredis.test_schematization[service_schema5].json delete mode 100644 tests/snapshots/tests.contrib.yaaredis.test_yaaredis.test_unicode.json diff --git a/.riot/requirements/1761702.txt b/.riot/requirements/1761702.txt deleted file mode 100644 index e6ca01ea565..00000000000 --- a/.riot/requirements/1761702.txt +++ /dev/null @@ -1,23 +0,0 @@ -# -# This file is autogenerated by pip-compile with Python 3.10 -# by the following command: -# -# pip-compile --no-annotate .riot/requirements/1761702.in -# -attrs==23.1.0 -coverage[toml]==7.3.4 -exceptiongroup==1.2.0 -hypothesis==6.45.0 -iniconfig==2.0.0 -mock==5.1.0 -opentracing==2.4.0 -packaging==23.2 -pluggy==1.3.0 -pytest==7.4.3 -pytest-asyncio==0.21.1 -pytest-cov==4.1.0 -pytest-mock==3.12.0 -pytest-randomly==3.15.0 -sortedcontainers==2.4.0 -tomli==2.0.1 -yaaredis==3.0.0 diff --git a/.riot/requirements/1cc7b0e.txt b/.riot/requirements/1cc7b0e.txt deleted file mode 100644 index adb8f71e30b..00000000000 --- a/.riot/requirements/1cc7b0e.txt +++ /dev/null @@ -1,25 +0,0 @@ -# -# This file is autogenerated by pip-compile with Python 3.8 -# by the following command: -# -# pip-compile --no-annotate .riot/requirements/1cc7b0e.in -# -attrs==23.1.0 -coverage[toml]==7.3.4 -exceptiongroup==1.2.0 -hypothesis==6.45.0 -importlib-metadata==7.0.0 -iniconfig==2.0.0 -mock==5.1.0 -opentracing==2.4.0 -packaging==23.2 -pluggy==1.3.0 -pytest==7.4.3 -pytest-asyncio==0.21.1 -pytest-cov==4.1.0 -pytest-mock==3.12.0 -pytest-randomly==3.15.0 -sortedcontainers==2.4.0 -tomli==2.0.1 -yaaredis==2.0.4 -zipp==3.17.0 diff --git a/.riot/requirements/1f1e9b4.txt b/.riot/requirements/1f1e9b4.txt deleted file mode 100644 index d9b9189f22a..00000000000 --- a/.riot/requirements/1f1e9b4.txt +++ /dev/null @@ -1,25 +0,0 @@ -# -# This file is autogenerated by pip-compile with Python 3.9 -# by the following command: -# -# pip-compile --no-annotate .riot/requirements/1f1e9b4.in -# -attrs==23.1.0 -coverage[toml]==7.3.4 -exceptiongroup==1.2.0 -hypothesis==6.45.0 -importlib-metadata==7.0.0 -iniconfig==2.0.0 -mock==5.1.0 -opentracing==2.4.0 -packaging==23.2 -pluggy==1.3.0 -pytest==7.4.3 -pytest-asyncio==0.21.1 -pytest-cov==4.1.0 -pytest-mock==3.12.0 -pytest-randomly==3.15.0 -sortedcontainers==2.4.0 -tomli==2.0.1 -yaaredis==3.0.0 -zipp==3.17.0 diff --git a/.riot/requirements/9b8251b.txt b/.riot/requirements/9b8251b.txt deleted file mode 100644 index c6c4004b105..00000000000 --- a/.riot/requirements/9b8251b.txt +++ /dev/null @@ -1,25 +0,0 @@ -# -# This file is autogenerated by pip-compile with Python 3.8 -# by the following command: -# -# pip-compile --no-annotate .riot/requirements/9b8251b.in -# -attrs==23.1.0 -coverage[toml]==7.3.4 -exceptiongroup==1.2.0 -hypothesis==6.45.0 -importlib-metadata==7.0.0 -iniconfig==2.0.0 -mock==5.1.0 -opentracing==2.4.0 -packaging==23.2 -pluggy==1.3.0 -pytest==7.4.3 -pytest-asyncio==0.21.1 -pytest-cov==4.1.0 -pytest-mock==3.12.0 -pytest-randomly==3.15.0 -sortedcontainers==2.4.0 -tomli==2.0.1 -yaaredis==3.0.0 -zipp==3.17.0 diff --git a/.riot/requirements/fda8aa6.txt b/.riot/requirements/fda8aa6.txt deleted file mode 100644 index efa619edb1e..00000000000 --- a/.riot/requirements/fda8aa6.txt +++ /dev/null @@ -1,25 +0,0 @@ -# -# This file is autogenerated by pip-compile with Python 3.9 -# by the following command: -# -# pip-compile --no-annotate .riot/requirements/fda8aa6.in -# -attrs==23.1.0 -coverage[toml]==7.3.4 -exceptiongroup==1.2.0 -hypothesis==6.45.0 -importlib-metadata==7.0.0 -iniconfig==2.0.0 -mock==5.1.0 -opentracing==2.4.0 -packaging==23.2 -pluggy==1.3.0 -pytest==7.4.3 -pytest-asyncio==0.21.1 -pytest-cov==4.1.0 -pytest-mock==3.12.0 -pytest-randomly==3.15.0 -sortedcontainers==2.4.0 -tomli==2.0.1 -yaaredis==2.0.4 -zipp==3.17.0 diff --git a/ddtrace/_monkey.py b/ddtrace/_monkey.py index 9261af555d7..0b9f2972885 100644 --- a/ddtrace/_monkey.py +++ b/ddtrace/_monkey.py @@ -93,7 +93,6 @@ "pyodbc": True, "fastapi": True, "dogpile_cache": True, - "yaaredis": True, "asyncpg": True, "aws_lambda": True, # patch only in AWS Lambda environments "azure_functions": True, diff --git a/ddtrace/contrib/_yaaredis.py b/ddtrace/contrib/_yaaredis.py deleted file mode 100644 index 65917b03c29..00000000000 --- a/ddtrace/contrib/_yaaredis.py +++ /dev/null @@ -1,67 +0,0 @@ -""" -The yaaredis integration traces yaaredis requests. - - -Enabling -~~~~~~~~ - -The yaaredis integration is enabled automatically when using -:ref:`ddtrace-run` or :ref:`import ddtrace.auto`. - -Or use :func:`patch()` to manually enable the integration:: - - from ddtrace import patch - patch(yaaredis=True) - - -Global Configuration -~~~~~~~~~~~~~~~~~~~~ - -.. py:data:: ddtrace.config.yaaredis["service"] - - The service name reported by default for yaaredis traces. - - This option can also be set with the ``DD_YAAREDIS_SERVICE`` environment - variable. - - Default: ``"redis"`` - -.. py:data:: ddtrace.config.yaaredis["cmd_max_length"] - - Max allowable size for the yaaredis command span tag. - Anything beyond the max length will be replaced with ``"..."``. - - This option can also be set with the ``DD_YAAREDIS_CMD_MAX_LENGTH`` environment - variable. - - Default: ``1000`` - -.. py:data:: ddtrace.config.aredis["resource_only_command"] - - The span resource will only include the command executed. To include all - arguments in the span resource, set this value to ``False``. - - This option can also be set with the ``DD_REDIS_RESOURCE_ONLY_COMMAND`` environment - variable. - - Default: ``True`` - - -Instance Configuration -~~~~~~~~~~~~~~~~~~~~~~ - -To configure particular yaaredis instances use the :class:`Pin ` API:: - - import yaaredis - from ddtrace.trace import Pin - - client = yaaredis.StrictRedis(host="localhost", port=6379) - - # Override service name for this instance - Pin.override(client, service="my-custom-queue") - - # Traces reported for this client will now have "my-custom-queue" - # as the service name. - async def example(): - await client.get("my-key") -""" diff --git a/ddtrace/contrib/internal/yaaredis/patch.py b/ddtrace/contrib/internal/yaaredis/patch.py deleted file mode 100644 index f9cba77b5bb..00000000000 --- a/ddtrace/contrib/internal/yaaredis/patch.py +++ /dev/null @@ -1,91 +0,0 @@ -import os - -import wrapt -import yaaredis - -from ddtrace import config -from ddtrace._trace.utils_redis import _instrument_redis_cmd -from ddtrace._trace.utils_redis import _instrument_redis_execute_pipeline -from ddtrace.contrib.internal.redis_utils import _run_redis_command_async -from ddtrace.internal.schema import schematize_service_name -from ddtrace.internal.utils.deprecations import DDTraceDeprecationWarning -from ddtrace.internal.utils.formats import CMD_MAX_LEN -from ddtrace.internal.utils.formats import asbool -from ddtrace.internal.utils.formats import stringify_cache_args -from ddtrace.internal.utils.wrappers import unwrap -from ddtrace.trace import Pin -from ddtrace.vendor.debtcollector import deprecate - - -config._add( - "yaaredis", - dict( - _default_service=schematize_service_name("redis"), - cmd_max_length=int(os.getenv("DD_YAAREDIS_CMD_MAX_LENGTH", CMD_MAX_LEN)), - resource_only_command=asbool(os.getenv("DD_REDIS_RESOURCE_ONLY_COMMAND", True)), - ), -) - - -def get_version(): - # type: () -> str - return getattr(yaaredis, "__version__", "") - - -def patch(): - """Patch the instrumented methods""" - deprecate( - prefix="The yaaredis module is deprecated.", - message="The yaaredis module is deprecated and will be deleted.", - category=DDTraceDeprecationWarning, - removal_version="3.0.0", - ) - - if getattr(yaaredis, "_datadog_patch", False): - return - yaaredis._datadog_patch = True - - _w = wrapt.wrap_function_wrapper - - _w("yaaredis.client", "StrictRedis.execute_command", traced_execute_command) - _w("yaaredis.client", "StrictRedis.pipeline", traced_pipeline) - _w("yaaredis.pipeline", "StrictPipeline.execute", traced_execute_pipeline) - _w("yaaredis.pipeline", "StrictPipeline.immediate_execute_command", traced_execute_command) - Pin().onto(yaaredis.StrictRedis) - - -def unpatch(): - if getattr(yaaredis, "_datadog_patch", False): - yaaredis._datadog_patch = False - - unwrap(yaaredis.client.StrictRedis, "execute_command") - unwrap(yaaredis.client.StrictRedis, "pipeline") - unwrap(yaaredis.pipeline.StrictPipeline, "execute") - unwrap(yaaredis.pipeline.StrictPipeline, "immediate_execute_command") - - -async def traced_execute_command(func, instance, args, kwargs): - pin = Pin.get_from(instance) - if not pin or not pin.enabled(): - return await func(*args, **kwargs) - - with _instrument_redis_cmd(pin, config.yaaredis, instance, args) as ctx: - return await _run_redis_command_async(ctx=ctx, func=func, args=args, kwargs=kwargs) - - -async def traced_pipeline(func, instance, args, kwargs): - pipeline = await func(*args, **kwargs) - pin = Pin.get_from(instance) - if pin: - pin.onto(pipeline) - return pipeline - - -async def traced_execute_pipeline(func, instance, args, kwargs): - pin = Pin.get_from(instance) - if not pin or not pin.enabled(): - return await func(*args, **kwargs) - - cmds = [stringify_cache_args(c, cmd_max_len=config.yaaredis.cmd_max_length) for c, _ in instance.command_stack] - with _instrument_redis_execute_pipeline(pin, config.yaaredis, cmds, instance): - return await func(*args, **kwargs) diff --git a/docs/index.rst b/docs/index.rst index d71419dc03e..3526d6a6f18 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -182,8 +182,6 @@ contacting support. +--------------------------------------------------+---------------+----------------+ | :ref:`wsgi` | \* | No | +--------------------------------------------------+---------------+----------------+ -| :ref:`yaaredis` | >= 2.0.0 | Yes | -+--------------------------------------------------+---------------+----------------+ .. [1] Libraries that are automatically instrumented when the diff --git a/docs/integrations.rst b/docs/integrations.rst index d14c03bcfb7..f9601e3aeb0 100644 --- a/docs/integrations.rst +++ b/docs/integrations.rst @@ -505,12 +505,6 @@ Vertica ^^^^^^^ .. automodule:: ddtrace.contrib._vertica -.. _yaaredis: - -yaaredis -^^^^^^^^ -.. automodule:: ddtrace.contrib._yaaredis - .. _wsgi: WSGI diff --git a/docs/spelling_wordlist.txt b/docs/spelling_wordlist.txt index 913ad7f8319..cc2969bd5c9 100644 --- a/docs/spelling_wordlist.txt +++ b/docs/spelling_wordlist.txt @@ -315,4 +315,3 @@ workflow Wrapt wsgi xfail -yaaredis diff --git a/lib-injection/sources/min_compatible_versions.csv b/lib-injection/sources/min_compatible_versions.csv index c7366036a89..0c61576da1a 100644 --- a/lib-injection/sources/min_compatible_versions.csv +++ b/lib-injection/sources/min_compatible_versions.csv @@ -191,6 +191,5 @@ webtest,0 werkzeug,<1.0 wheel,0 xmltodict,>=0.12 -yaaredis,~=2.0.0 yarl,~=1.0 zeep,0 diff --git a/min_compatible_versions.csv b/min_compatible_versions.csv index 382aec7fd6a..dd91aedc2b4 100644 --- a/min_compatible_versions.csv +++ b/min_compatible_versions.csv @@ -192,6 +192,5 @@ webtest,0 werkzeug,<1.0 wheel,0 xmltodict,>=0.12 -yaaredis,~=2.0.0 yarl,~=1.0 zeep,0 diff --git a/releasenotes/notes/remove-yaaredis-095441532392e12f.yaml b/releasenotes/notes/remove-yaaredis-095441532392e12f.yaml new file mode 100644 index 00000000000..ce5ae6da6c1 --- /dev/null +++ b/releasenotes/notes/remove-yaaredis-095441532392e12f.yaml @@ -0,0 +1,4 @@ +--- +upgrade: + - | + yaaredis: Removes the yaaredis integration from ``ddtrace``. For yaaredis support pin ddtrace to an older version. \ No newline at end of file diff --git a/riotfile.py b/riotfile.py index fe4aece3126..f04523d3057 100644 --- a/riotfile.py +++ b/riotfile.py @@ -2091,25 +2091,6 @@ def select_pys(min_version: str = MIN_PYTHON_VERSION, max_version: str = MAX_PYT "pytest-randomly": latest, }, ), - Venv( - name="yaaredis", - command="pytest {cmdargs} tests/contrib/yaaredis", - pkgs={ - "pytest-asyncio": "==0.21.1", - "pytest-randomly": latest, - }, - venvs=[ - Venv( - pys=select_pys(min_version="3.8", max_version="3.9"), - pkgs={"yaaredis": ["~=2.0.0", latest]}, - ), - Venv( - # yaaredis added support for Python 3.10 in 3.0 - pys="3.10", - pkgs={"yaaredis": latest}, - ), - ], - ), Venv( name="sanic", command="pytest {cmdargs} tests/contrib/sanic", diff --git a/supported_versions_output.json b/supported_versions_output.json index 06eff37be25..7b158105f97 100644 --- a/supported_versions_output.json +++ b/supported_versions_output.json @@ -305,11 +305,5 @@ "minimum_tracer_supported": "1.71.1", "max_tracer_supported": "1.71.1", "auto-instrumented": true - }, - { - "integration": "yaaredis", - "minimum_tracer_supported": "2.0.4", - "max_tracer_supported": "3.0.0", - "auto-instrumented": true } ] \ No newline at end of file diff --git a/supported_versions_table.csv b/supported_versions_table.csv index edbe73503cd..1f230039d50 100644 --- a/supported_versions_table.csv +++ b/supported_versions_table.csv @@ -49,4 +49,3 @@ tornado *,4.5.3,6.4,False urllib3,1.24.3,2.2.3,False valkey,6.0.0,6.0.2,True vertexai,1.71.1,1.71.1,True -yaaredis,2.0.4,3.0.0,True diff --git a/tests/contrib/suitespec.yml b/tests/contrib/suitespec.yml index c49f3e79dbf..2f857e300fd 100644 --- a/tests/contrib/suitespec.yml +++ b/tests/contrib/suitespec.yml @@ -202,8 +202,6 @@ components: - ddtrace/contrib/internal/redis/* - ddtrace/contrib/_aredis.py - ddtrace/contrib/internal/aredis/* - - ddtrace/contrib/_yaaredis.py - - ddtrace/contrib/internal/yaaredis/* - ddtrace/_trace/utils_redis.py - ddtrace/contrib/internal/redis_utils.py - ddtrace/ext/redis.py @@ -1167,20 +1165,6 @@ suites: - tests/snapshots/tests.contrib.wsgi.* runner: riot snapshot: true - yaaredis: - paths: - - '@core' - - '@bootstrap' - - '@contrib' - - '@tracing' - - '@redis' - - tests/contrib/yaaredis/* - - tests/snapshots/tests.contrib.yaaredis.* - pattern: yaaredis$ - runner: riot - services: - - redis - snapshot: true valkey: parallelism: 5 paths: diff --git a/tests/contrib/yaaredis/__init__.py b/tests/contrib/yaaredis/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/tests/contrib/yaaredis/test_yaaredis.py b/tests/contrib/yaaredis/test_yaaredis.py deleted file mode 100644 index df064817aef..00000000000 --- a/tests/contrib/yaaredis/test_yaaredis.py +++ /dev/null @@ -1,237 +0,0 @@ -# -*- encoding: utf-8 -*- -import os -import uuid - -import pytest -from wrapt import ObjectProxy -import yaaredis - -from ddtrace.contrib.internal.yaaredis.patch import patch -from ddtrace.contrib.internal.yaaredis.patch import unpatch -from ddtrace.trace import Pin -from tests.opentracer.utils import init_tracer -from tests.utils import override_config - -from ..config import REDIS_CONFIG - - -@pytest.fixture(autouse=True) -async def traced_yaaredis(): - r = yaaredis.StrictRedis(port=REDIS_CONFIG["port"]) - await r.flushall() - - patch() - try: - yield r - finally: - unpatch() - - r = yaaredis.StrictRedis(port=REDIS_CONFIG["port"]) - await r.flushall() - - -def test_patching(): - """ - When patching yaaredis library - We wrap the correct methods - When unpatching yaaredis library - We unwrap the correct methods - """ - assert isinstance(yaaredis.client.StrictRedis.execute_command, ObjectProxy) - assert isinstance(yaaredis.client.StrictRedis.pipeline, ObjectProxy) - assert isinstance(yaaredis.pipeline.StrictPipeline.execute, ObjectProxy) - assert isinstance(yaaredis.pipeline.StrictPipeline.immediate_execute_command, ObjectProxy) - - unpatch() - - assert not isinstance(yaaredis.client.StrictRedis.execute_command, ObjectProxy) - assert not isinstance(yaaredis.client.StrictRedis.pipeline, ObjectProxy) - assert not isinstance(yaaredis.pipeline.StrictPipeline.execute, ObjectProxy) - assert not isinstance(yaaredis.pipeline.StrictPipeline.immediate_execute_command, ObjectProxy) - - -@pytest.mark.asyncio -async def test_long_command(snapshot_context, traced_yaaredis): - with snapshot_context(): - await traced_yaaredis.mget(*range(1000)) - - -@pytest.mark.asyncio -@pytest.mark.snapshot -async def test_cmd_max_length(traced_yaaredis): - with override_config("yaaredis", dict(cmd_max_length=7)): - await traced_yaaredis.get("here-is-a-long-key") - - -@pytest.mark.skip(reason="No traces sent to the test agent") -@pytest.mark.subprocess(env=dict(DD_YAAREDIS_CMD_MAX_LENGTH="10"), ddtrace_run=True) -@pytest.mark.snapshot -def test_cmd_max_length_env(): - import asyncio - - import yaaredis - - from tests.contrib.config import REDIS_CONFIG - - async def main(): - r = yaaredis.StrictRedis(port=REDIS_CONFIG["port"]) - await r.get("here-is-a-long-key") - - asyncio.run(main()) - - -@pytest.mark.asyncio -async def test_basics(snapshot_context, traced_yaaredis): - with snapshot_context(): - await traced_yaaredis.get("cheese") - - -@pytest.mark.asyncio -async def test_unicode(snapshot_context, traced_yaaredis): - with snapshot_context(): - await traced_yaaredis.get("😐") - - -@pytest.mark.asyncio -async def test_pipeline_traced(snapshot_context, traced_yaaredis): - with snapshot_context(): - p = await traced_yaaredis.pipeline(transaction=False) - await p.set("blah", 32) - await p.rpush("foo", "éé") - await p.hgetall("xxx") - await p.execute() - - -@pytest.mark.asyncio -async def test_pipeline_immediate(snapshot_context, traced_yaaredis): - with snapshot_context(): - p = await traced_yaaredis.pipeline() - await p.set("a", 1) - await p.immediate_execute_command("SET", "a", 1) - await p.execute() - - -@pytest.mark.asyncio -async def test_meta_override(tracer, test_spans, traced_yaaredis): - pin = Pin.get_from(traced_yaaredis) - assert pin is not None - pin._clone(tags={"cheese": "camembert"}, tracer=tracer).onto(traced_yaaredis) - - await traced_yaaredis.get("cheese") - test_spans.assert_trace_count(1) - test_spans.assert_span_count(1) - assert test_spans.spans[0].service == "redis" - assert test_spans.spans[0].get_tag("component") == "yaaredis" - assert test_spans.spans[0].get_tag("span.kind") == "client" - assert test_spans.spans[0].get_tag("db.system") == "redis" - assert "cheese" in test_spans.spans[0].get_tags() and test_spans.spans[0].get_tag("cheese") == "camembert" - - -@pytest.mark.asyncio -async def test_service_name(tracer, test_spans, traced_yaaredis): - service = str(uuid.uuid4()) - Pin._override(traced_yaaredis, service=service, tracer=tracer) - - await traced_yaaredis.set("cheese", "1") - test_spans.assert_trace_count(1) - test_spans.assert_span_count(1) - assert test_spans.spans[0].service == service - - -@pytest.mark.asyncio -async def test_service_name_config(tracer, test_spans, traced_yaaredis): - service = str(uuid.uuid4()) - with override_config("yaaredis", dict(service=service)): - Pin._override(traced_yaaredis, tracer=tracer) - await traced_yaaredis.set("cheese", "1") - test_spans.assert_trace_count(1) - test_spans.assert_span_count(1) - assert test_spans.spans[0].service == service - - -@pytest.mark.asyncio -async def test_opentracing(tracer, snapshot_context, traced_yaaredis): - """Ensure OpenTracing works with redis.""" - - with snapshot_context(): - pin = Pin.get_from(traced_yaaredis) - ot_tracer = init_tracer("redis_svc", pin.tracer) - - with ot_tracer.start_active_span("redis_get"): - await traced_yaaredis.get("cheese") - - -@pytest.mark.parametrize( - "service_schema", - [ - (None, None), - (None, "v0"), - (None, "v1"), - ("mysvc", None), - ("mysvc", "v0"), - ("mysvc", "v1"), - ], -) -@pytest.mark.snapshot() -def test_schematization(ddtrace_run_python_code_in_subprocess, service_schema): - service, schema = service_schema - code = """ -import sys - -import pytest - -from tests.contrib.yaaredis.test_yaaredis import traced_yaaredis - -@pytest.mark.asyncio -async def test_basics(traced_yaaredis): - async for client in traced_yaaredis: - await client.get("cheese") - - -if __name__ == "__main__": - sys.exit(pytest.main(["-x", __file__])) - """ - env = os.environ.copy() - if service: - env["DD_SERVICE"] = service - if schema: - env["DD_TRACE_SPAN_ATTRIBUTE_SCHEMA"] = schema - out, err, status, _ = ddtrace_run_python_code_in_subprocess(code, env=env) - assert status == 0, (err.decode(), out.decode()) - assert err == b"", err.decode() - - -@pytest.mark.subprocess(env=dict(DD_REDIS_RESOURCE_ONLY_COMMAND="false")) -@pytest.mark.snapshot -def test_full_command_in_resource_env(): - import asyncio - - import yaaredis - - import ddtrace - from tests.contrib.config import REDIS_CONFIG - - async def traced_client(): - with ddtrace.tracer.trace("web-request", service="test"): - redis_client = yaaredis.StrictRedis(port=REDIS_CONFIG["port"]) - await redis_client.get("put_key_in_resource") - p = await redis_client.pipeline(transaction=False) - await p.set("pipeline-cmd1", 1) - await p.set("pipeline-cmd2", 2) - await p.execute() - - ddtrace.patch(yaaredis=True) - asyncio.run(traced_client()) - - -@pytest.mark.snapshot -@pytest.mark.asyncio -@pytest.mark.parametrize("use_global_tracer", [True]) -async def test_full_command_in_resource_config(tracer, traced_yaaredis): - with override_config("yaaredis", dict(resource_only_command=False)): - with tracer.trace("web-request", service="test"): - await traced_yaaredis.get("put_key_in_resource") - p = await traced_yaaredis.pipeline(transaction=False) - await p.set("pipeline-cmd1", 1) - await p.set("pipeline-cmd2", 2) - await p.execute() diff --git a/tests/contrib/yaaredis/test_yaaredis_patch.py b/tests/contrib/yaaredis/test_yaaredis_patch.py deleted file mode 100644 index d93247a1faa..00000000000 --- a/tests/contrib/yaaredis/test_yaaredis_patch.py +++ /dev/null @@ -1,31 +0,0 @@ -# This test script was automatically generated by the contrib-patch-tests.py -# script. If you want to make changes to it, you should make sure that you have -# removed the ``_generated`` suffix from the file name, to prevent the content -# from being overwritten by future re-generations. - -from ddtrace.contrib.internal.yaaredis.patch import get_version -from ddtrace.contrib.internal.yaaredis.patch import patch - - -try: - from ddtrace.contrib.internal.yaaredis.patch import unpatch -except ImportError: - unpatch = None -from tests.contrib.patch import PatchTestCase - - -class TestYaaredisPatch(PatchTestCase.Base): - __integration_name__ = "yaaredis" - __module_name__ = "yaaredis" - __patch_func__ = patch - __unpatch_func__ = unpatch - __get_version__ = get_version - - def assert_module_patched(self, yaaredis): - pass - - def assert_not_module_patched(self, yaaredis): - pass - - def assert_not_module_double_patched(self, yaaredis): - pass diff --git a/tests/snapshots/tests.contrib.yaaredis.test_yaaredis.test_analytics_with_rate.json b/tests/snapshots/tests.contrib.yaaredis.test_yaaredis.test_analytics_with_rate.json deleted file mode 100644 index 2a94b63ab1c..00000000000 --- a/tests/snapshots/tests.contrib.yaaredis.test_yaaredis.test_analytics_with_rate.json +++ /dev/null @@ -1,38 +0,0 @@ -[[ - { - "name": "redis.command", - "service": "redis", - "resource": "GET", - "trace_id": 0, - "span_id": 1, - "parent_id": 0, - "type": "redis", - "error": 0, - "meta": { - "_dd.base_service": "tests.contrib.yaaredis", - "_dd.p.dm": "-0", - "_dd.p.tid": "654a694400000000", - "component": "yaaredis", - "db.system": "redis", - "language": "python", - "out.host": "localhost", - "redis.raw_command": "GET cheese", - "runtime-id": "4d0d479c17be4095b8e0dee5a0839596", - "server.address": "localhost", - "span.kind": "client" - }, - "metrics": { - "_dd.measured": 1, - "_dd.top_level": 1, - "_dd.tracer_kr": 1.0, - "_dd1.sr.eausr": 0.5, - "_sampling_priority_v1": 1, - "db.row_count": 0, - "network.destination.port": 6379, - "out.redis_db": 0, - "process_id": 5119, - "redis.args_length": 2 - }, - "duration": 309666, - "start": 1692650065803420466 - }]] diff --git a/tests/snapshots/tests.contrib.yaaredis.test_yaaredis.test_analytics_without_rate.json b/tests/snapshots/tests.contrib.yaaredis.test_yaaredis.test_analytics_without_rate.json deleted file mode 100644 index 40703c30619..00000000000 --- a/tests/snapshots/tests.contrib.yaaredis.test_yaaredis.test_analytics_without_rate.json +++ /dev/null @@ -1,38 +0,0 @@ -[[ - { - "name": "redis.command", - "service": "redis", - "resource": "GET", - "trace_id": 0, - "span_id": 1, - "parent_id": 0, - "type": "redis", - "error": 0, - "meta": { - "_dd.base_service": "tests.contrib.yaaredis", - "_dd.p.dm": "-0", - "_dd.p.tid": "654a694400000000", - "component": "yaaredis", - "db.system": "redis", - "language": "python", - "out.host": "localhost", - "redis.raw_command": "GET cheese", - "runtime-id": "4d0d479c17be4095b8e0dee5a0839596", - "server.address": "localhost", - "span.kind": "client" - }, - "metrics": { - "_dd.measured": 1, - "_dd.top_level": 1, - "_dd.tracer_kr": 1.0, - "_dd1.sr.eausr": 1.0, - "_sampling_priority_v1": 1, - "db.row_count": 0, - "network.destination.port": 6379, - "out.redis_db": 0, - "process_id": 5119, - "redis.args_length": 2 - }, - "duration": 277750, - "start": 1692650065792499174 - }]] diff --git a/tests/snapshots/tests.contrib.yaaredis.test_yaaredis.test_basics.json b/tests/snapshots/tests.contrib.yaaredis.test_yaaredis.test_basics.json deleted file mode 100644 index 64a0dc8fcee..00000000000 --- a/tests/snapshots/tests.contrib.yaaredis.test_yaaredis.test_basics.json +++ /dev/null @@ -1,37 +0,0 @@ -[[ - { - "name": "redis.command", - "service": "redis", - "resource": "GET", - "trace_id": 0, - "span_id": 1, - "parent_id": 0, - "type": "redis", - "error": 0, - "meta": { - "_dd.base_service": "tests.contrib.yaaredis", - "_dd.p.dm": "-0", - "_dd.p.tid": "654a694400000000", - "component": "yaaredis", - "db.system": "redis", - "language": "python", - "out.host": "localhost", - "redis.raw_command": "GET cheese", - "runtime-id": "4d0d479c17be4095b8e0dee5a0839596", - "server.address": "localhost", - "span.kind": "client" - }, - "metrics": { - "_dd.measured": 1, - "_dd.top_level": 1, - "_dd.tracer_kr": 1.0, - "_sampling_priority_v1": 1, - "db.row_count": 0, - "network.destination.port": 6379, - "out.redis_db": 0, - "process_id": 5119, - "redis.args_length": 2 - }, - "duration": 199667, - "start": 1692650065770875215 - }]] diff --git a/tests/snapshots/tests.contrib.yaaredis.test_yaaredis.test_cmd_max_length.json b/tests/snapshots/tests.contrib.yaaredis.test_yaaredis.test_cmd_max_length.json deleted file mode 100644 index b39a54205e8..00000000000 --- a/tests/snapshots/tests.contrib.yaaredis.test_yaaredis.test_cmd_max_length.json +++ /dev/null @@ -1,37 +0,0 @@ -[[ - { - "name": "redis.command", - "service": "redis", - "resource": "GET", - "trace_id": 0, - "span_id": 1, - "parent_id": 0, - "type": "redis", - "error": 0, - "meta": { - "_dd.base_service": "tests.contrib.yaaredis", - "_dd.p.dm": "-0", - "_dd.p.tid": "654a694400000000", - "component": "yaaredis", - "db.system": "redis", - "language": "python", - "out.host": "localhost", - "redis.raw_command": "GET here...", - "runtime-id": "4d0d479c17be4095b8e0dee5a0839596", - "server.address": "localhost", - "span.kind": "client" - }, - "metrics": { - "_dd.measured": 1, - "_dd.top_level": 1, - "_dd.tracer_kr": 1.0, - "_sampling_priority_v1": 1, - "db.row_count": 0, - "network.destination.port": 6379, - "out.redis_db": 0, - "process_id": 5119, - "redis.args_length": 2 - }, - "duration": 227917, - "start": 1692650065760107632 - }]] diff --git a/tests/snapshots/tests.contrib.yaaredis.test_yaaredis.test_full_command_in_resource_config[True].json b/tests/snapshots/tests.contrib.yaaredis.test_yaaredis.test_full_command_in_resource_config[True].json deleted file mode 100644 index f453d45ceb2..00000000000 --- a/tests/snapshots/tests.contrib.yaaredis.test_yaaredis.test_full_command_in_resource_config[True].json +++ /dev/null @@ -1,82 +0,0 @@ -[[ - { - "name": "web-request", - "service": "test", - "resource": "web-request", - "trace_id": 0, - "span_id": 1, - "parent_id": 0, - "type": "", - "error": 0, - "meta": { - "_dd.base_service": "tests.contrib.yaaredis", - "_dd.p.dm": "-0", - "language": "python", - "runtime-id": "8684af00a9414982b4794ddcadcd26ec" - }, - "metrics": { - "_dd.top_level": 1, - "_dd.tracer_kr": 1.0, - "_sampling_priority_v1": 1, - "process_id": 78504 - }, - "duration": 1603000, - "start": 1698860084361738000 - }, - { - "name": "redis.command", - "service": "redis", - "resource": "GET put_key_in_resource", - "trace_id": 0, - "span_id": 2, - "parent_id": 1, - "type": "redis", - "error": 0, - "meta": { - "_dd.base_service": "tests.contrib.yaaredis", - "component": "yaaredis", - "db.system": "redis", - "out.host": "localhost", - "redis.raw_command": "GET put_key_in_resource", - "server.address": "localhost", - "span.kind": "client" - }, - "metrics": { - "_dd.measured": 1, - "_dd.top_level": 1, - "db.row_count": 0, - "network.destination.port": 6379, - "out.redis_db": 0, - "redis.args_length": 2 - }, - "duration": 659000, - "start": 1698860084362141000 - }, - { - "name": "redis.command", - "service": "redis", - "resource": "SET pipeline-cmd1 1\nSET pipeline-cmd2 2", - "trace_id": 0, - "span_id": 3, - "parent_id": 1, - "type": "redis", - "error": 0, - "meta": { - "_dd.base_service": "tests.contrib.yaaredis", - "component": "yaaredis", - "db.system": "redis", - "out.host": "localhost", - "redis.raw_command": "SET pipeline-cmd1 1\nSET pipeline-cmd2 2", - "server.address": "localhost", - "span.kind": "client" - }, - "metrics": { - "_dd.measured": 1, - "_dd.top_level": 1, - "network.destination.port": 6379, - "out.redis_db": 0, - "redis.pipeline_length": 2 - }, - "duration": 442000, - "start": 1698860084362884000 - }]] diff --git a/tests/snapshots/tests.contrib.yaaredis.test_yaaredis.test_full_command_in_resource_env.json b/tests/snapshots/tests.contrib.yaaredis.test_yaaredis.test_full_command_in_resource_env.json deleted file mode 100644 index 09c08bf56a0..00000000000 --- a/tests/snapshots/tests.contrib.yaaredis.test_yaaredis.test_full_command_in_resource_env.json +++ /dev/null @@ -1,82 +0,0 @@ -[[ - { - "name": "web-request", - "service": "test", - "resource": "web-request", - "trace_id": 0, - "span_id": 1, - "parent_id": 0, - "type": "", - "error": 0, - "meta": { - "_dd.base_service": "ddtrace_subprocess_dir", - "_dd.p.dm": "-0", - "language": "python", - "runtime-id": "3c2060b13ff1469387b2c823d7d43f18" - }, - "metrics": { - "_dd.top_level": 1, - "_dd.tracer_kr": 1.0, - "_sampling_priority_v1": 1, - "process_id": 78507 - }, - "duration": 14945000, - "start": 1698860084269055000 - }, - { - "name": "redis.command", - "service": "redis", - "resource": "GET put_key_in_resource", - "trace_id": 0, - "span_id": 2, - "parent_id": 1, - "type": "redis", - "error": 0, - "meta": { - "_dd.base_service": "ddtrace_subprocess_dir", - "component": "yaaredis", - "db.system": "redis", - "out.host": "localhost", - "redis.raw_command": "GET put_key_in_resource", - "server.address": "localhost", - "span.kind": "client" - }, - "metrics": { - "_dd.measured": 1, - "_dd.top_level": 1, - "db.row_count": 0, - "network.destination.port": 6379, - "out.redis_db": 0, - "redis.args_length": 2 - }, - "duration": 12481000, - "start": 1698860084269179000 - }, - { - "name": "redis.command", - "service": "redis", - "resource": "SET pipeline-cmd1 1\nSET pipeline-cmd2 2", - "trace_id": 0, - "span_id": 3, - "parent_id": 1, - "type": "redis", - "error": 0, - "meta": { - "_dd.base_service": "ddtrace_subprocess_dir", - "component": "yaaredis", - "db.system": "redis", - "out.host": "localhost", - "redis.raw_command": "SET pipeline-cmd1 1\nSET pipeline-cmd2 2", - "server.address": "localhost", - "span.kind": "client" - }, - "metrics": { - "_dd.measured": 1, - "_dd.top_level": 1, - "network.destination.port": 6379, - "out.redis_db": 0, - "redis.pipeline_length": 2 - }, - "duration": 2254000, - "start": 1698860084281737000 - }]] diff --git a/tests/snapshots/tests.contrib.yaaredis.test_yaaredis.test_long_command.json b/tests/snapshots/tests.contrib.yaaredis.test_yaaredis.test_long_command.json deleted file mode 100644 index c21f8fc51f5..00000000000 --- a/tests/snapshots/tests.contrib.yaaredis.test_yaaredis.test_long_command.json +++ /dev/null @@ -1,37 +0,0 @@ -[[ - { - "name": "redis.command", - "service": "redis", - "resource": "MGET", - "trace_id": 0, - "span_id": 1, - "parent_id": 0, - "type": "redis", - "error": 0, - "meta": { - "_dd.base_service": "tests.contrib.yaaredis", - "_dd.p.dm": "-0", - "_dd.p.tid": "654a694400000000", - "component": "yaaredis", - "db.system": "redis", - "language": "python", - "out.host": "localhost", - "redis.raw_command": "MGET 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 36...", - "runtime-id": "4d0d479c17be4095b8e0dee5a0839596", - "server.address": "localhost", - "span.kind": "client" - }, - "metrics": { - "_dd.measured": 1, - "_dd.top_level": 1, - "_dd.tracer_kr": 1.0, - "_sampling_priority_v1": 1, - "db.row_count": 0, - "network.destination.port": 6379, - "out.redis_db": 0, - "process_id": 5119, - "redis.args_length": 1001 - }, - "duration": 4141542, - "start": 1692650065704941632 - }]] diff --git a/tests/snapshots/tests.contrib.yaaredis.test_yaaredis.test_opentracing.json b/tests/snapshots/tests.contrib.yaaredis.test_yaaredis.test_opentracing.json deleted file mode 100644 index ccee94088be..00000000000 --- a/tests/snapshots/tests.contrib.yaaredis.test_yaaredis.test_opentracing.json +++ /dev/null @@ -1,56 +0,0 @@ -[[ - { - "name": "redis_get", - "service": "redis_svc", - "resource": "redis_get", - "trace_id": 0, - "span_id": 1, - "parent_id": 0, - "type": "", - "error": 0, - "meta": { - "_dd.base_service": "tests.contrib.yaaredis", - "_dd.p.dm": "-0", - "_dd.p.tid": "654a694400000000", - "language": "python", - "runtime-id": "4d0d479c17be4095b8e0dee5a0839596" - }, - "metrics": { - "_dd.top_level": 1, - "_dd.tracer_kr": 1.0, - "_sampling_priority_v1": 1, - "process_id": 5119 - }, - "duration": 402211, - "start": 1692650065865079296 - }, - { - "name": "redis.command", - "service": "redis", - "resource": "GET", - "trace_id": 0, - "span_id": 2, - "parent_id": 1, - "type": "redis", - "error": 0, - "meta": { - "_dd.base_service": "tests.contrib.yaaredis", - "_dd.p.tid": "654a694400000000", - "component": "yaaredis", - "db.system": "redis", - "out.host": "localhost", - "redis.raw_command": "GET cheese", - "server.address": "localhost", - "span.kind": "client" - }, - "metrics": { - "_dd.measured": 1, - "_dd.top_level": 1, - "db.row_count": 0, - "network.destination.port": 6379, - "out.redis_db": 0, - "redis.args_length": 2 - }, - "duration": 271333, - "start": 1692650065865181924 - }]] diff --git a/tests/snapshots/tests.contrib.yaaredis.test_yaaredis.test_pipeline_immediate.json b/tests/snapshots/tests.contrib.yaaredis.test_yaaredis.test_pipeline_immediate.json deleted file mode 100644 index d8843f3ac0c..00000000000 --- a/tests/snapshots/tests.contrib.yaaredis.test_yaaredis.test_pipeline_immediate.json +++ /dev/null @@ -1,72 +0,0 @@ -[[ - { - "name": "redis.command", - "service": "redis", - "resource": "SET", - "trace_id": 0, - "span_id": 1, - "parent_id": 0, - "type": "redis", - "error": 0, - "meta": { - "_dd.base_service": "tests.contrib.yaaredis", - "_dd.p.dm": "-0", - "_dd.p.tid": "654a694400000000", - "component": "yaaredis", - "db.system": "redis", - "language": "python", - "out.host": "localhost", - "redis.raw_command": "SET a 1", - "runtime-id": "4d0d479c17be4095b8e0dee5a0839596", - "server.address": "localhost", - "span.kind": "client" - }, - "metrics": { - "_dd.measured": 1, - "_dd.top_level": 1, - "_dd.tracer_kr": 1.0, - "_sampling_priority_v1": 1, - "network.destination.port": 6379, - "out.redis_db": 0, - "process_id": 5119, - "redis.args_length": 3 - }, - "duration": 246375, - "start": 1692650065826740341 - }], -[ - { - "name": "redis.command", - "service": "redis", - "resource": "SET", - "trace_id": 1, - "span_id": 1, - "parent_id": 0, - "type": "redis", - "error": 0, - "meta": { - "_dd.base_service": "tests.contrib.yaaredis", - "_dd.p.dm": "-0", - "_dd.p.tid": "654a694400000000", - "component": "yaaredis", - "db.system": "redis", - "language": "python", - "out.host": "localhost", - "redis.raw_command": "SET a 1", - "runtime-id": "4d0d479c17be4095b8e0dee5a0839596", - "server.address": "localhost", - "span.kind": "client" - }, - "metrics": { - "_dd.measured": 1, - "_dd.top_level": 1, - "_dd.tracer_kr": 1.0, - "_sampling_priority_v1": 1, - "network.destination.port": 6379, - "out.redis_db": 0, - "process_id": 5119, - "redis.pipeline_length": 1 - }, - "duration": 181666, - "start": 1692650065827078091 - }]] diff --git a/tests/snapshots/tests.contrib.yaaredis.test_yaaredis.test_pipeline_traced.json b/tests/snapshots/tests.contrib.yaaredis.test_yaaredis.test_pipeline_traced.json deleted file mode 100644 index 945d5fc508d..00000000000 --- a/tests/snapshots/tests.contrib.yaaredis.test_yaaredis.test_pipeline_traced.json +++ /dev/null @@ -1,36 +0,0 @@ -[[ - { - "name": "redis.command", - "service": "redis", - "resource": "SET\nRPUSH\nHGETALL", - "trace_id": 0, - "span_id": 1, - "parent_id": 0, - "type": "redis", - "error": 0, - "meta": { - "_dd.base_service": "tests.contrib.yaaredis", - "_dd.p.dm": "-0", - "_dd.p.tid": "654a694400000000", - "component": "yaaredis", - "db.system": "redis", - "language": "python", - "out.host": "localhost", - "redis.raw_command": "SET blah 32\nRPUSH foo \u00e9\u00e9\nHGETALL xxx", - "runtime-id": "4d0d479c17be4095b8e0dee5a0839596", - "server.address": "localhost", - "span.kind": "client" - }, - "metrics": { - "_dd.measured": 1, - "_dd.top_level": 1, - "_dd.tracer_kr": 1.0, - "_sampling_priority_v1": 1, - "network.destination.port": 6379, - "out.redis_db": 0, - "process_id": 5119, - "redis.pipeline_length": 3 - }, - "duration": 278208, - "start": 1692650065814935466 - }]] diff --git a/tests/snapshots/tests.contrib.yaaredis.test_yaaredis.test_schematization[service_schema0].json b/tests/snapshots/tests.contrib.yaaredis.test_yaaredis.test_schematization[service_schema0].json deleted file mode 100644 index d541510cbcd..00000000000 --- a/tests/snapshots/tests.contrib.yaaredis.test_yaaredis.test_schematization[service_schema0].json +++ /dev/null @@ -1,73 +0,0 @@ -[[ - { - "name": "redis.command", - "service": "redis", - "resource": "FLUSHALL", - "trace_id": 0, - "span_id": 1, - "parent_id": 0, - "type": "redis", - "error": 0, - "meta": { - "_dd.base_service": "ddtrace_subprocess_dir", - "_dd.p.dm": "-0", - "_dd.p.tid": "654a694400000000", - "component": "yaaredis", - "db.system": "redis", - "language": "python", - "out.host": "localhost", - "redis.raw_command": "FLUSHALL", - "runtime-id": "392b844b532747b7a2327f4996a26d26", - "server.address": "localhost", - "span.kind": "client" - }, - "metrics": { - "_dd.measured": 1, - "_dd.top_level": 1, - "_dd.tracer_kr": 1.0, - "_sampling_priority_v1": 1, - "network.destination.port": 6379, - "out.redis_db": 0, - "process_id": 5140, - "redis.args_length": 1 - }, - "duration": 17837625, - "start": 1692650066908323174 - }], -[ - { - "name": "redis.command", - "service": "redis", - "resource": "GET", - "trace_id": 1, - "span_id": 1, - "parent_id": 0, - "type": "redis", - "error": 0, - "meta": { - "_dd.base_service": "ddtrace_subprocess_dir", - "_dd.p.dm": "-0", - "_dd.p.tid": "654a694400000000", - "component": "yaaredis", - "db.system": "redis", - "language": "python", - "out.host": "localhost", - "redis.raw_command": "GET cheese", - "runtime-id": "392b844b532747b7a2327f4996a26d26", - "server.address": "localhost", - "span.kind": "client" - }, - "metrics": { - "_dd.measured": 1, - "_dd.top_level": 1, - "_dd.tracer_kr": 1.0, - "_sampling_priority_v1": 1, - "db.row_count": 0, - "network.destination.port": 6379, - "out.redis_db": 0, - "process_id": 5140, - "redis.args_length": 2 - }, - "duration": 308291, - "start": 1692650066953965133 - }]] diff --git a/tests/snapshots/tests.contrib.yaaredis.test_yaaredis.test_schematization[service_schema1].json b/tests/snapshots/tests.contrib.yaaredis.test_yaaredis.test_schematization[service_schema1].json deleted file mode 100644 index f0075f33b51..00000000000 --- a/tests/snapshots/tests.contrib.yaaredis.test_yaaredis.test_schematization[service_schema1].json +++ /dev/null @@ -1,73 +0,0 @@ -[[ - { - "name": "redis.command", - "service": "redis", - "resource": "FLUSHALL", - "trace_id": 0, - "span_id": 1, - "parent_id": 0, - "type": "redis", - "error": 0, - "meta": { - "_dd.base_service": "ddtrace_subprocess_dir", - "_dd.p.dm": "-0", - "_dd.p.tid": "654a694400000000", - "component": "yaaredis", - "db.system": "redis", - "language": "python", - "out.host": "localhost", - "redis.raw_command": "FLUSHALL", - "runtime-id": "f9e411adfc7a4c2cabc38392dd511dbf", - "server.address": "localhost", - "span.kind": "client" - }, - "metrics": { - "_dd.measured": 1, - "_dd.top_level": 1, - "_dd.tracer_kr": 1.0, - "_sampling_priority_v1": 1, - "network.destination.port": 6379, - "out.redis_db": 0, - "process_id": 5145, - "redis.args_length": 1 - }, - "duration": 13703875, - "start": 1692650068046894758 - }], -[ - { - "name": "redis.command", - "service": "redis", - "resource": "GET", - "trace_id": 1, - "span_id": 1, - "parent_id": 0, - "type": "redis", - "error": 0, - "meta": { - "_dd.base_service": "ddtrace_subprocess_dir", - "_dd.p.dm": "-0", - "_dd.p.tid": "654a694400000000", - "component": "yaaredis", - "db.system": "redis", - "language": "python", - "out.host": "localhost", - "redis.raw_command": "GET cheese", - "runtime-id": "f9e411adfc7a4c2cabc38392dd511dbf", - "server.address": "localhost", - "span.kind": "client" - }, - "metrics": { - "_dd.measured": 1, - "_dd.top_level": 1, - "_dd.tracer_kr": 1.0, - "_sampling_priority_v1": 1, - "db.row_count": 0, - "network.destination.port": 6379, - "out.redis_db": 0, - "process_id": 5145, - "redis.args_length": 2 - }, - "duration": 337542, - "start": 1692650068093153508 - }]] diff --git a/tests/snapshots/tests.contrib.yaaredis.test_yaaredis.test_schematization[service_schema2].json b/tests/snapshots/tests.contrib.yaaredis.test_yaaredis.test_schematization[service_schema2].json deleted file mode 100644 index f1067bca0f9..00000000000 --- a/tests/snapshots/tests.contrib.yaaredis.test_yaaredis.test_schematization[service_schema2].json +++ /dev/null @@ -1,75 +0,0 @@ -[[ - { - "name": "redis.command", - "service": "ddtrace_subprocess_dir", - "resource": "FLUSHALL", - "trace_id": 0, - "span_id": 1, - "parent_id": 0, - "type": "redis", - "error": 0, - "meta": { - "_dd.p.dm": "-0", - "_dd.p.tid": "654a694400000000", - "_dd.peer.service.source": "out.host", - "component": "yaaredis", - "db.system": "redis", - "language": "python", - "out.host": "localhost", - "peer.service": "localhost", - "redis.command": "FLUSHALL", - "runtime-id": "6512d363c3094051ae21a945fbfcf82b", - "server.address": "localhost", - "span.kind": "client" - }, - "metrics": { - "_dd.measured": 1, - "_dd.top_level": 1, - "_dd.tracer_kr": 1.0, - "_sampling_priority_v1": 1, - "network.destination.port": 6379, - "out.redis_db": 0, - "process_id": 14223, - "redis.args_length": 1 - }, - "duration": 4711000, - "start": 1685545835531199000 - }], -[ - { - "name": "redis.command", - "service": "ddtrace_subprocess_dir", - "resource": "GET", - "trace_id": 1, - "span_id": 1, - "parent_id": 0, - "type": "redis", - "error": 0, - "meta": { - "_dd.p.dm": "-0", - "_dd.p.tid": "654a694400000000", - "_dd.peer.service.source": "out.host", - "component": "yaaredis", - "db.system": "redis", - "language": "python", - "out.host": "localhost", - "peer.service": "localhost", - "redis.command": "GET cheese", - "runtime-id": "6512d363c3094051ae21a945fbfcf82b", - "server.address": "localhost", - "span.kind": "client" - }, - "metrics": { - "_dd.measured": 1, - "_dd.top_level": 1, - "_dd.tracer_kr": 1.0, - "_sampling_priority_v1": 1, - "db.row_count": 0, - "network.destination.port": 6379, - "out.redis_db": 0, - "process_id": 14223, - "redis.args_length": 2 - }, - "duration": 420000, - "start": 1685545835574013000 - }]] diff --git a/tests/snapshots/tests.contrib.yaaredis.test_yaaredis.test_schematization[service_schema3].json b/tests/snapshots/tests.contrib.yaaredis.test_yaaredis.test_schematization[service_schema3].json deleted file mode 100644 index 94285cbff91..00000000000 --- a/tests/snapshots/tests.contrib.yaaredis.test_yaaredis.test_schematization[service_schema3].json +++ /dev/null @@ -1,73 +0,0 @@ -[[ - { - "name": "redis.command", - "service": "redis", - "resource": "FLUSHALL", - "trace_id": 0, - "span_id": 1, - "parent_id": 0, - "type": "redis", - "error": 0, - "meta": { - "_dd.base_service": "mysvc", - "_dd.p.dm": "-0", - "_dd.p.tid": "654a694400000000", - "component": "yaaredis", - "db.system": "redis", - "language": "python", - "out.host": "localhost", - "redis.raw_command": "FLUSHALL", - "runtime-id": "b99b2a231e9242f5b3e0fb971df07ef8", - "server.address": "localhost", - "span.kind": "client" - }, - "metrics": { - "_dd.measured": 1, - "_dd.top_level": 1, - "_dd.tracer_kr": 1.0, - "_sampling_priority_v1": 1, - "network.destination.port": 6379, - "out.redis_db": 0, - "process_id": 5155, - "redis.args_length": 1 - }, - "duration": 9568708, - "start": 1692650070456463426 - }], -[ - { - "name": "redis.command", - "service": "redis", - "resource": "GET", - "trace_id": 1, - "span_id": 1, - "parent_id": 0, - "type": "redis", - "error": 0, - "meta": { - "_dd.base_service": "mysvc", - "_dd.p.dm": "-0", - "_dd.p.tid": "654a694400000000", - "component": "yaaredis", - "db.system": "redis", - "language": "python", - "out.host": "localhost", - "redis.raw_command": "GET cheese", - "runtime-id": "b99b2a231e9242f5b3e0fb971df07ef8", - "server.address": "localhost", - "span.kind": "client" - }, - "metrics": { - "_dd.measured": 1, - "_dd.top_level": 1, - "_dd.tracer_kr": 1.0, - "_sampling_priority_v1": 1, - "db.row_count": 0, - "network.destination.port": 6379, - "out.redis_db": 0, - "process_id": 5155, - "redis.args_length": 2 - }, - "duration": 304459, - "start": 1692650070493672884 - }]] diff --git a/tests/snapshots/tests.contrib.yaaredis.test_yaaredis.test_schematization[service_schema4].json b/tests/snapshots/tests.contrib.yaaredis.test_yaaredis.test_schematization[service_schema4].json deleted file mode 100644 index e0a5fe04089..00000000000 --- a/tests/snapshots/tests.contrib.yaaredis.test_yaaredis.test_schematization[service_schema4].json +++ /dev/null @@ -1,73 +0,0 @@ -[[ - { - "name": "redis.command", - "service": "redis", - "resource": "FLUSHALL", - "trace_id": 0, - "span_id": 1, - "parent_id": 0, - "type": "redis", - "error": 0, - "meta": { - "_dd.base_service": "mysvc", - "_dd.p.dm": "-0", - "_dd.p.tid": "654a694400000000", - "component": "yaaredis", - "db.system": "redis", - "language": "python", - "out.host": "localhost", - "redis.raw_command": "FLUSHALL", - "runtime-id": "d8705f1ada1545908f6144a2d6b15900", - "server.address": "localhost", - "span.kind": "client" - }, - "metrics": { - "_dd.measured": 1, - "_dd.top_level": 1, - "_dd.tracer_kr": 1.0, - "_sampling_priority_v1": 1, - "network.destination.port": 6379, - "out.redis_db": 0, - "process_id": 5160, - "redis.args_length": 1 - }, - "duration": 10873959, - "start": 1692650071606791218 - }], -[ - { - "name": "redis.command", - "service": "redis", - "resource": "GET", - "trace_id": 1, - "span_id": 1, - "parent_id": 0, - "type": "redis", - "error": 0, - "meta": { - "_dd.base_service": "mysvc", - "_dd.p.dm": "-0", - "_dd.p.tid": "654a694400000000", - "component": "yaaredis", - "db.system": "redis", - "language": "python", - "out.host": "localhost", - "redis.raw_command": "GET cheese", - "runtime-id": "d8705f1ada1545908f6144a2d6b15900", - "server.address": "localhost", - "span.kind": "client" - }, - "metrics": { - "_dd.measured": 1, - "_dd.top_level": 1, - "_dd.tracer_kr": 1.0, - "_sampling_priority_v1": 1, - "db.row_count": 0, - "network.destination.port": 6379, - "out.redis_db": 0, - "process_id": 5160, - "redis.args_length": 2 - }, - "duration": 328375, - "start": 1692650071643705427 - }]] diff --git a/tests/snapshots/tests.contrib.yaaredis.test_yaaredis.test_schematization[service_schema5].json b/tests/snapshots/tests.contrib.yaaredis.test_yaaredis.test_schematization[service_schema5].json deleted file mode 100644 index 6be40ba43d8..00000000000 --- a/tests/snapshots/tests.contrib.yaaredis.test_yaaredis.test_schematization[service_schema5].json +++ /dev/null @@ -1,75 +0,0 @@ -[[ - { - "name": "redis.command", - "service": "mysvc", - "resource": "FLUSHALL", - "trace_id": 0, - "span_id": 1, - "parent_id": 0, - "type": "redis", - "error": 0, - "meta": { - "_dd.p.dm": "-0", - "_dd.p.tid": "654a694400000000", - "_dd.peer.service.source": "out.host", - "component": "yaaredis", - "db.system": "redis", - "language": "python", - "out.host": "localhost", - "peer.service": "localhost", - "redis.command": "FLUSHALL", - "runtime-id": "1993bf3ea65c4b658bffdda053387eca", - "server.address": "localhost", - "span.kind": "client" - }, - "metrics": { - "_dd.measured": 1, - "_dd.top_level": 1, - "_dd.tracer_kr": 1.0, - "_sampling_priority_v1": 1, - "network.destination.port": 6379, - "out.redis_db": 0, - "process_id": 14262, - "redis.args_length": 1 - }, - "duration": 7419000, - "start": 1685545839462874000 - }], -[ - { - "name": "redis.command", - "service": "mysvc", - "resource": "GET", - "trace_id": 1, - "span_id": 1, - "parent_id": 0, - "type": "redis", - "error": 0, - "meta": { - "_dd.p.dm": "-0", - "_dd.p.tid": "654a694400000000", - "_dd.peer.service.source": "out.host", - "component": "yaaredis", - "db.system": "redis", - "language": "python", - "out.host": "localhost", - "peer.service": "localhost", - "redis.command": "GET cheese", - "runtime-id": "1993bf3ea65c4b658bffdda053387eca", - "server.address": "localhost", - "span.kind": "client" - }, - "metrics": { - "_dd.measured": 1, - "_dd.top_level": 1, - "_dd.tracer_kr": 1.0, - "_sampling_priority_v1": 1, - "db.row_count": 0, - "network.destination.port": 6379, - "out.redis_db": 0, - "process_id": 14262, - "redis.args_length": 2 - }, - "duration": 326000, - "start": 1685545839502613000 - }]] diff --git a/tests/snapshots/tests.contrib.yaaredis.test_yaaredis.test_unicode.json b/tests/snapshots/tests.contrib.yaaredis.test_yaaredis.test_unicode.json deleted file mode 100644 index cb687c7f283..00000000000 --- a/tests/snapshots/tests.contrib.yaaredis.test_yaaredis.test_unicode.json +++ /dev/null @@ -1,37 +0,0 @@ -[[ - { - "name": "redis.command", - "service": "redis", - "resource": "GET", - "trace_id": 0, - "span_id": 1, - "parent_id": 0, - "type": "redis", - "error": 0, - "meta": { - "_dd.base_service": "tests.contrib.yaaredis", - "_dd.p.dm": "-0", - "_dd.p.tid": "654a694400000000", - "component": "yaaredis", - "db.system": "redis", - "language": "python", - "out.host": "localhost", - "redis.raw_command": "GET \ud83d\ude10", - "runtime-id": "4d0d479c17be4095b8e0dee5a0839596", - "server.address": "localhost", - "span.kind": "client" - }, - "metrics": { - "_dd.measured": 1, - "_dd.top_level": 1, - "_dd.tracer_kr": 1.0, - "_sampling_priority_v1": 1, - "db.row_count": 0, - "network.destination.port": 6379, - "out.redis_db": 0, - "process_id": 5119, - "redis.args_length": 2 - }, - "duration": 211291, - "start": 1692650065781665049 - }]]