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

Add Redis pub/sub instrumentation #1129

Merged
merged 3 commits into from
May 25, 2021
Merged

Conversation

Sparkycz
Copy link
Contributor

@Sparkycz Sparkycz commented May 7, 2021

closes #828

@apmmachine
Copy link
Contributor

apmmachine commented May 7, 2021

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: Started by user Benjamin Wohlwend

  • Start Time: 2021-05-25T08:55:46.469+0000

  • Duration: 29 min 56 sec

  • Commit: 76e2f04

Test stats 🧪

Test Results
Failed 0
Passed 9468
Skipped 8763
Total 18231

Trends 🧪

Image of Build Times

Image of Tests

💚 Flaky test report

Tests succeeded.

Expand to view the summary

Test stats 🧪

Test Results
Failed 0
Passed 9468
Skipped 8763
Total 18231

@beniwohli
Copy link
Contributor

@Sparkycz great work, thanks a lot for all your PRs!

@beniwohli beniwohli merged commit b080438 into elastic:master May 25, 2021
@@ -38,7 +38,8 @@
class RedisConnectionPoolInstrumentation(AbstractInstrumentedModule):
name = "aioredis"

instrument_list = [("aioredis.pool", "ConnectionsPool.execute")]
instrument_list = [("aioredis.pool", "ConnectionsPool.execute"),
("aioredis.pool", "ConnectionsPool.execute_pubsub")]

def call(self, module, method, wrapped, instance, args, kwargs):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this function not marked as async? @beniwohli

@@ -73,7 +74,8 @@ def call(self, module, method, wrapped, instance, args, kwargs):
class RedisConnectionInstrumentation(AbstractInstrumentedModule):
name = "aioredis"

instrument_list = (("aioredis.connection", "RedisConnection.execute"),)
instrument_list = (("aioredis.connection", "RedisConnection.execute"),
("aioredis.pool", "ConnectionsPool.execute_pubsub"))

def call(self, module, method, wrapped, instance, args, kwargs):
span = execution_context.get_span()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is missing async_capture_span call hence it would not create a span in APM. Also, I think this should also be async and return needs to have await with it @beniwohli @Sparkycz

beniwohli added a commit to beniwohli/apm-agent-python that referenced this pull request Sep 14, 2021
* Add instrumentation of redis pub/sub commands

* Add instrumentation of aioredis pub/sub commands

Co-authored-by: Benjamin Wohlwend <beni@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Redis: Support publish and subscribe methods
4 participants