diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d83782a4..09804301 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -23,7 +23,7 @@ jobs: make ./bin/TestCommon - name: Codecovage - uses: codecov/codecov-action@v1 + uses: codecov/codecov-action@v4 cpp-windows: runs-on: [windows-latest] diff --git a/plugins/PY/pinpointPy/libs/_pyRedis/PyRedisPlugins.py b/plugins/PY/pinpointPy/libs/_pyRedis/PyRedisPlugins.py index 80a5018c..e517dbae 100644 --- a/plugins/PY/pinpointPy/libs/_pyRedis/PyRedisPlugins.py +++ b/plugins/PY/pinpointPy/libs/_pyRedis/PyRedisPlugins.py @@ -26,6 +26,10 @@ from pinpointPy import Defines +def format_host(host, port, db) -> str: + return f'redis(host={host},port={port},db={db})' + + class PyRedisPlugins(Common.PinTrace): def __init__(self, name): @@ -37,8 +41,10 @@ def onBefore(self, parentId, *args, **kwargs): Defines.PP_INTERCEPTOR_NAME, self.getUniqueName(), trace_id) pinpoint.add_trace_header( Defines.PP_SERVER_TYPE, Defines.PP_REDIS, trace_id) - pinpoint.add_trace_header( - Defines.PP_DESTINATION, str(args[0]), trace_id) + from redis.connection import Connection + if isinstance(args[0], Connection): + pinpoint.add_trace_header( + Defines.PP_DESTINATION, format_host(args[0].host, args[0].port, args[0].db), trace_id) return trace_id, args, kwargs def onEnd(self, traceId, ret): @@ -62,8 +68,9 @@ def onBefore(self, parentId, *args, **kwargs): pipeLine = args[0] # fixed: Redis Collections Not release #612 # @quicksandznzn + connection_kwargs = pipeLine.connection_pool.connection_kwargs pinpoint.add_trace_header( - Defines.PP_DESTINATION, str(pipeLine.connection), trace_id) + Defines.PP_DESTINATION, format_host(connection_kwargs["host"], connection_kwargs["port"], connection_kwargs["db"]), trace_id) import sys if 'unittest' in sys.modules.keys(): pipeLine._pinpoint_ = True diff --git a/plugins/PY/pinpointPy/libs/_pyRedis/__init__.py b/plugins/PY/pinpointPy/libs/_pyRedis/__init__.py index e7a26803..f2f764d7 100644 --- a/plugins/PY/pinpointPy/libs/_pyRedis/__init__.py +++ b/plugins/PY/pinpointPy/libs/_pyRedis/__init__.py @@ -42,11 +42,13 @@ def monkey_patch(): __all__ = ['monkey_patch'] -__version__ = '0.0.3' +__version__ = '0.0.4' __author__ = 'liu.mingyi@navercorp.com' """ ## Changes +### 0.0.4 5/22/2024 +- fix 0.0.3 : use format_host ### 0.0.3 5/21/2024 - Redis Collections Not release #612 """