Skip to content

Commit

Permalink
chore(rules): Add metrics on Redis operations (#71143)
Browse files Browse the repository at this point in the history
Add Datadog metrics when we perform a Redis operation.
  • Loading branch information
ceorourke committed May 20, 2024
1 parent dfc0962 commit 9f3d24d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/sentry/buffer/redis.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,8 @@ def get_redis_connection(self, key: str, transaction: bool = True) -> Pipeline:
def _execute_redis_operation(
self, key: str, operation: RedisOperation, *args: Any, **kwargs: Any
) -> Any:
metrics_str = f"redis_buffer.{operation.value}"
metrics.incr(metrics_str)
pipe = self.get_redis_connection(self.pending_key)
getattr(pipe, operation.value)(key, *args, **kwargs)
if args:
Expand Down

0 comments on commit 9f3d24d

Please sign in to comment.