Skip to content

Commit b550b0d

Browse files
authored
Merge pull request #1234 from jairhenrique/valkey
Adds Valkey support
2 parents 515b9ba + 998c577 commit b550b0d

16 files changed

+2554
-2
lines changed

.github/workflows/tests.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ jobs:
4949
- redis
5050
- rediscluster
5151
- solr
52+
- valkey
5253

5354
steps:
5455
- name: Success
@@ -1198,3 +1199,65 @@ jobs:
11981199
name: coverage-${{ github.job }}-${{ strategy.job-index }}
11991200
path: ./**/.coverage.*
12001201
retention-days: 1
1202+
1203+
valkey:
1204+
env:
1205+
TOTAL_GROUPS: 2
1206+
1207+
strategy:
1208+
fail-fast: false
1209+
matrix:
1210+
group-number: [1, 2]
1211+
1212+
runs-on: ubuntu-latest
1213+
container:
1214+
image: ghcr.io/newrelic/newrelic-python-agent-ci:latest
1215+
options: >-
1216+
--add-host=host.docker.internal:host-gateway
1217+
timeout-minutes: 30
1218+
services:
1219+
valkey:
1220+
image: valkey/valkey:latest
1221+
ports:
1222+
- 8080:6379
1223+
- 8081:6379
1224+
# Set health checks to wait until valkey has started
1225+
options: >-
1226+
--health-cmd "valkey-cli ping"
1227+
--health-interval 10s
1228+
--health-timeout 5s
1229+
--health-retries 5
1230+
1231+
steps:
1232+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # 4.1.1
1233+
1234+
- name: Fetch git tags
1235+
run: |
1236+
git config --global --add safe.directory "$GITHUB_WORKSPACE"
1237+
git fetch --tags origin
1238+
1239+
- name: Configure pip cache
1240+
run: |
1241+
mkdir -p /github/home/.cache/pip
1242+
chown -R $(whoami) /github/home/.cache/pip
1243+
1244+
- name: Get Environments
1245+
id: get-envs
1246+
run: |
1247+
echo "envs=$(tox -l | grep '^${{ github.job }}\-' | ./.github/workflows/get-envs.py)" >> $GITHUB_OUTPUT
1248+
env:
1249+
GROUP_NUMBER: ${{ matrix.group-number }}
1250+
1251+
- name: Test
1252+
run: |
1253+
tox -vv -e ${{ steps.get-envs.outputs.envs }} -p auto
1254+
env:
1255+
TOX_PARALLEL_NO_SPINNER: 1
1256+
PY_COLORS: 0
1257+
1258+
- name: Upload Coverage Artifacts
1259+
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # 4.3.1
1260+
with:
1261+
name: coverage-${{ github.job }}-${{ strategy.job-index }}
1262+
path: ./**/.coverage.*
1263+
retention-days: 1

newrelic/config.py

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3622,6 +3622,61 @@ def _process_module_builtin_defaults():
36223622
"redis.commands.graph.commands", "newrelic.hooks.datastore_redis", "instrument_redis_commands_graph_commands"
36233623
)
36243624

3625+
_process_module_definition(
3626+
"valkey.asyncio.client", "newrelic.hooks.datastore_valkey", "instrument_asyncio_valkey_client"
3627+
)
3628+
3629+
_process_module_definition(
3630+
"valkey.asyncio.commands", "newrelic.hooks.datastore_valkey", "instrument_asyncio_valkey_client"
3631+
)
3632+
3633+
_process_module_definition(
3634+
"valkey.asyncio.connection", "newrelic.hooks.datastore_valkey", "instrument_asyncio_valkey_connection"
3635+
)
3636+
3637+
_process_module_definition(
3638+
"valkey.connection",
3639+
"newrelic.hooks.datastore_valkey",
3640+
"instrument_valkey_connection",
3641+
)
3642+
_process_module_definition("valkey.client", "newrelic.hooks.datastore_valkey", "instrument_valkey_client")
3643+
3644+
_process_module_definition(
3645+
"valkey.commands.cluster", "newrelic.hooks.datastore_valkey", "instrument_valkey_commands_cluster"
3646+
)
3647+
3648+
_process_module_definition(
3649+
"valkey.commands.core", "newrelic.hooks.datastore_valkey", "instrument_valkey_commands_core"
3650+
)
3651+
3652+
_process_module_definition(
3653+
"valkey.commands.sentinel", "newrelic.hooks.datastore_valkey", "instrument_valkey_commands_sentinel"
3654+
)
3655+
3656+
_process_module_definition(
3657+
"valkey.commands.json.commands", "newrelic.hooks.datastore_valkey", "instrument_valkey_commands_json_commands"
3658+
)
3659+
3660+
_process_module_definition(
3661+
"valkey.commands.search.commands",
3662+
"newrelic.hooks.datastore_valkey",
3663+
"instrument_valkey_commands_search_commands",
3664+
)
3665+
3666+
_process_module_definition(
3667+
"valkey.commands.timeseries.commands",
3668+
"newrelic.hooks.datastore_valkey",
3669+
"instrument_valkey_commands_timeseries_commands",
3670+
)
3671+
3672+
_process_module_definition(
3673+
"valkey.commands.bf.commands", "newrelic.hooks.datastore_valkey", "instrument_valkey_commands_bf_commands"
3674+
)
3675+
3676+
_process_module_definition(
3677+
"valkey.commands.graph.commands", "newrelic.hooks.datastore_valkey", "instrument_valkey_commands_graph_commands"
3678+
)
3679+
36253680
_process_module_definition("motor", "newrelic.hooks.datastore_motor", "patch_motor")
36263681

36273682
_process_module_definition(

0 commit comments

Comments
 (0)