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

feat: add valkey instrumentation support #12060

Merged
merged 1 commit into from
Feb 5, 2025
Merged

Conversation

ZStriker19
Copy link
Contributor

@ZStriker19 ZStriker19 commented Jan 23, 2025

This PR is the work of AhmadMasry

Moving from #12003 since we have issues running certain tests on forked repos.

The Valkey instrumentation is based on the current implementation of the Redis instrumentation, but keeping into consideration that the two projects may deviate and lose compatibility, the Valkey instrumentation is created as a separated module.

Checklist

  • PR author has checked that all the criteria below are met
  • The PR description includes an overview of the change
  • The PR description articulates the motivation for the change
  • The change includes tests OR the PR description describes a testing strategy
  • The PR description notes risks associated with the change, if any
  • Newly-added code is easy to change
  • The change follows the library release note guidelines
  • The change includes or references documentation updates if necessary
  • Backport labels are set (if applicable)

Reviewer Checklist

  • Reviewer has checked that all the criteria below are met
  • Title is accurate
  • All changes are related to the pull request's stated goal
  • Avoids breaking API changes
  • Testing strategy adequately addresses listed risks
  • Newly-added code is easy to change
  • Release note makes sense to a user of the library
  • If necessary, author has acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment
  • Backport labels are set in a manner that is consistent with the release branch maintenance policy

Copy link
Contributor

github-actions bot commented Jan 23, 2025

CODEOWNERS have been resolved as:

.riot/requirements/11ac941.txt                                          @DataDog/apm-python
.riot/requirements/1e98e9b.txt                                          @DataDog/apm-python
.riot/requirements/4aa2a2a.txt                                          @DataDog/apm-python
.riot/requirements/7219cf4.txt                                          @DataDog/apm-python
.riot/requirements/b96b665.txt                                          @DataDog/apm-python
.riot/requirements/dd68acc.txt                                          @DataDog/apm-python
ddtrace/_trace/utils_valkey.py                                          @DataDog/apm-sdk-api-python
ddtrace/contrib/internal/valkey/asyncio_patch.py                        @DataDog/apm-core-python @DataDog/apm-idm-python
ddtrace/contrib/internal/valkey/patch.py                                @DataDog/apm-core-python @DataDog/apm-idm-python
ddtrace/contrib/internal/valkey_utils.py                                @DataDog/apm-core-python @DataDog/apm-idm-python
ddtrace/contrib/valkey/__init__.py                                      @DataDog/apm-core-python @DataDog/apm-idm-python
ddtrace/ext/valkey.py                                                   @DataDog/apm-core-python @DataDog/apm-idm-python
releasenotes/notes/add-valkey-support-6cc9f41351dc0cd9.yaml             @DataDog/apm-python
tests/contrib/valkey/__init__.py                                        @DataDog/apm-core-python @DataDog/apm-idm-python
tests/contrib/valkey/test_valkey.py                                     @DataDog/apm-core-python @DataDog/apm-idm-python
tests/contrib/valkey/test_valkey_asyncio.py                             @DataDog/apm-core-python @DataDog/apm-idm-python
tests/contrib/valkey/test_valkey_cluster.py                             @DataDog/apm-core-python @DataDog/apm-idm-python
tests/contrib/valkey/test_valkey_cluster_asyncio.py                     @DataDog/apm-core-python @DataDog/apm-idm-python
tests/contrib/valkey/test_valkey_patch.py                               @DataDog/apm-core-python @DataDog/apm-idm-python
tests/snapshots/tests.contrib.valkey.test_valkey.test_analytics_with_rate.json  @DataDog/apm-python
tests/snapshots/tests.contrib.valkey.test_valkey.test_analytics_without_rate.json  @DataDog/apm-python
tests/snapshots/tests.contrib.valkey.test_valkey.test_basics.json       @DataDog/apm-python
tests/snapshots/tests.contrib.valkey.test_valkey.test_custom_cmd_length.json  @DataDog/apm-python
tests/snapshots/tests.contrib.valkey.test_valkey.test_custom_cmd_length_env.json  @DataDog/apm-python
tests/snapshots/tests.contrib.valkey.test_valkey.test_env_user_specified_valkey_service.json  @DataDog/apm-python
tests/snapshots/tests.contrib.valkey.test_valkey.test_full_command_in_resource_config.json  @DataDog/apm-python
tests/snapshots/tests.contrib.valkey.test_valkey.test_full_command_in_resource_env.json  @DataDog/apm-python
tests/snapshots/tests.contrib.valkey.test_valkey.test_long_command.json  @DataDog/apm-python
tests/snapshots/tests.contrib.valkey.test_valkey.test_meta_override.json  @DataDog/apm-python
tests/snapshots/tests.contrib.valkey.test_valkey.test_opentracing.json  @DataDog/apm-python
tests/snapshots/tests.contrib.valkey.test_valkey.test_pipeline_immediate.json  @DataDog/apm-python
tests/snapshots/tests.contrib.valkey.test_valkey.test_pipeline_traced.json  @DataDog/apm-python
tests/snapshots/tests.contrib.valkey.test_valkey.test_service_precedence.json  @DataDog/apm-python
tests/snapshots/tests.contrib.valkey.test_valkey.test_unicode.json      @DataDog/apm-python
tests/snapshots/tests.contrib.valkey.test_valkey.test_user_specified_service.json  @DataDog/apm-python
tests/snapshots/tests.contrib.valkey.test_valkey_asyncio.test_basic_request.json  @DataDog/apm-python
tests/snapshots/tests.contrib.valkey.test_valkey_asyncio.test_client_name.json  @DataDog/apm-python
tests/snapshots/tests.contrib.valkey.test_valkey_asyncio.test_connection_error.json  @DataDog/apm-python
tests/snapshots/tests.contrib.valkey.test_valkey_asyncio.test_decoding_non_utf8_args.json  @DataDog/apm-python
tests/snapshots/tests.contrib.valkey.test_valkey_asyncio.test_decoding_non_utf8_pipeline_args.json  @DataDog/apm-python
tests/snapshots/tests.contrib.valkey.test_valkey_asyncio.test_long_command.json  @DataDog/apm-python
tests/snapshots/tests.contrib.valkey.test_valkey_asyncio.test_override_service_name.json  @DataDog/apm-python
tests/snapshots/tests.contrib.valkey.test_valkey_asyncio.test_parenting.json  @DataDog/apm-python
tests/snapshots/tests.contrib.valkey.test_valkey_asyncio.test_pin.json  @DataDog/apm-python
tests/snapshots/tests.contrib.valkey.test_valkey_asyncio.test_pipeline_traced.json  @DataDog/apm-python
tests/snapshots/tests.contrib.valkey.test_valkey_asyncio.test_pipeline_traced_context_manager_transaction.json  @DataDog/apm-python
tests/snapshots/tests.contrib.valkey.test_valkey_asyncio.test_two_traced_pipelines.json  @DataDog/apm-python
tests/snapshots/tests.contrib.valkey.test_valkey_asyncio.test_unicode_request.json  @DataDog/apm-python
.github/COMMIT_TEMPLATE.txt                                             @DataDog/python-guild @DataDog/apm-core-python
.gitlab/services.yml                                                    @DataDog/python-guild @DataDog/apm-core-python
ddtrace/_monkey.py                                                      @DataDog/apm-core-python
ddtrace/_trace/trace_handlers.py                                        @DataDog/apm-sdk-api-python
ddtrace/ext/__init__.py                                                 @DataDog/apm-core-python @DataDog/apm-idm-python
docker-compose.yml                                                      @DataDog/apm-core-python
docs/index.rst                                                          @DataDog/python-guild
docs/integrations.rst                                                   @DataDog/python-guild
docs/spelling_wordlist.txt                                              @DataDog/python-guild
min_compatible_versions.csv                                             @DataDog/apm-core-python
riotfile.py                                                             @DataDog/apm-python
supported_versions_output.json                                          @DataDog/apm-core-python
supported_versions_table.csv                                            @DataDog/apm-core-python
tests/contrib/config.py                                                 @DataDog/apm-core-python @DataDog/apm-idm-python
tests/contrib/suitespec.yml                                             @DataDog/apm-core-python @DataDog/apm-idm-python

@ZStriker19 ZStriker19 marked this pull request as ready for review January 23, 2025 21:18
@ZStriker19 ZStriker19 requested review from a team as code owners January 23, 2025 21:18
@datadog-dd-trace-py-rkomorn
Copy link

datadog-dd-trace-py-rkomorn bot commented Jan 23, 2025

Datadog Report

Branch report: main-AhmadMasry
Commit report: 345d5d2
Test service: dd-trace-py

✅ 0 Failed, 130 Passed, 1184 Skipped, 3m 28.46s Total duration (25m 10.97s time saved)

docs/integrations.rst Outdated Show resolved Hide resolved
@ZStriker19 ZStriker19 enabled auto-merge (squash) January 23, 2025 22:24
@pr-commenter
Copy link

pr-commenter bot commented Jan 23, 2025

Benchmarks

Benchmark execution time: 2025-02-05 20:18:52

Comparing candidate commit 345d5d2 in PR branch main-AhmadMasry with baseline commit b17990b in branch 3.x-staging.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 394 metrics, 2 unstable metrics.

@ZStriker19
Copy link
Contributor Author

Waiting on a pr for the valkey image to be approved so we can use it in testing. Should be approved shortly and then we can merge this.

@ZStriker19 ZStriker19 force-pushed the main-AhmadMasry branch 2 times, most recently from 36c3e7c to 6921d3e Compare February 3, 2025 20:53
@ZStriker19 ZStriker19 requested review from a team as code owners February 3, 2025 20:53
@ZStriker19 ZStriker19 changed the base branch from main to 3.x-staging February 3, 2025 20:58
tests/contrib/valkey/test_valkey.py Outdated Show resolved Hide resolved
tests/contrib/valkey/test_valkey.py Outdated Show resolved Hide resolved
@ZStriker19 ZStriker19 force-pushed the main-AhmadMasry branch 2 times, most recently from 5612005 to 1455afd Compare February 5, 2025 19:26
Add support for Valkey instrumentation

Add valkeycluster service

Add release notes

Reformat snapshots

Apply suggested changes

remove ddtrace/contrib/valkey

update suitespec to reflect movement of files

fixes for moving internal

Update releasenotes/notes/add-valkey-support-6cc9f41351dc0cd9.yaml

Update docs/integrations.rst

fix builddocs with init file

use mirror image for testing

add valkeycluster to services

see if more open pattern fixes

switch from entrypoint to command for valkey cluster cont

add environment ip value to container

use rediscluster container for db

fix import

remove configure with writer

Update tests/contrib/valkey/test_valkey.py

Update tests/contrib/valkey/test_valkey.py
@ZStriker19 ZStriker19 merged commit 135ae7c into 3.x-staging Feb 5, 2025
741 checks passed
@ZStriker19 ZStriker19 deleted the main-AhmadMasry branch February 5, 2025 20:20
ZStriker19 added a commit that referenced this pull request Feb 6, 2025
**This PR is the work of [AhmadMasry](https://github.com/AhmadMasry)**

Moving from #12003 since we
have issues running certain tests on forked repos.

The Valkey instrumentation is based on the current implementation of the
Redis instrumentation, but keeping into consideration that the two
projects may deviate and lose compatibility, the Valkey instrumentation
is created as a separated module.

## Checklist
- [x] PR author has checked that all the criteria below are met
- The PR description includes an overview of the change
- The PR description articulates the motivation for the change
- The change includes tests OR the PR description describes a testing
strategy
- The PR description notes risks associated with the change, if any
- Newly-added code is easy to change
- The change follows the [library release note
guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html)
- The change includes or references documentation updates if necessary
- Backport labels are set (if
[applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting))

## Reviewer Checklist
- [x] Reviewer has checked that all the criteria below are met 
- Title is accurate
- All changes are related to the pull request's stated goal
- Avoids breaking
[API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces)
changes
- Testing strategy adequately addresses listed risks
- Newly-added code is easy to change
- Release note makes sense to a user of the library
- If necessary, author has acknowledged and discussed the performance
implications of this PR as reported in the benchmarks PR comment
- Backport labels are set in a manner that is consistent with the
[release branch maintenance
policy](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)

---------

Co-authored-by: AhmadMasry <[email protected]>
Co-authored-by: Ahmad Al-Masry <[email protected]>
Co-authored-by: Munir Abdinur <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants