Skip to content

Conversation

RohanNagar
Copy link
Contributor

@RohanNagar RohanNagar commented Jun 27, 2025

Make sure that:

  • You have read the contribution guidelines.
  • You have created a feature request first to discuss your contribution intent. Please reference the feature request ticket number in the pull request.
  • You applied code formatting rules using the mvn formatter:format target. Don’t submit any formatting related changes.
  • You submit test cases (unit or integration tests) that back your changes.

Addresses #3308 to avoid creating a RedisURI object when setting tracing tags. As explained in the issue, the current behavior results in unnecessary CPU usage.

This change caches the necessary information that is added to span tags each time the channel is registered.

This should work as long as the RedisUri attribute attached to the channel doesn't change (is that a correct assumption?).

The alternative is to just extract the information each time from channel.attr(ConnectionBuilder.REDIS_URI).get(). Something like:

        if (channel.hasAttr(ConnectionBuilder.REDIS_URI)) {
            String redisUriStr = channel.attr(ConnectionBuilder.REDIS_URI).get();
            span.tag("server.address", redisUriStr);
            span.tag("db.namespace", extractedDbValueFromRedisUriStr);
            span.tag("user.name", extractedUsernameValueFromRedisUriStr);
        }

@RohanNagar
Copy link
Contributor Author

Hi @tishun I want to get your thoughts on this change - is it the right direction in order to address issue #3308? Thanks!

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.

2 participants