Skip to content

Comments

Update IORedis Plugin, fill dbinstance tag as host if condition.select doesn't exist.#73

Merged
wu-sheng merged 3 commits intoapache:masterfrom
TonyKingdom:master
Feb 28, 2022
Merged

Update IORedis Plugin, fill dbinstance tag as host if condition.select doesn't exist.#73
wu-sheng merged 3 commits intoapache:masterfrom
TonyKingdom:master

Conversation

@TonyKingdom
Copy link
Contributor

@wu-sheng wu-sheng requested a review from kezhenxu94 February 25, 2022 08:15
span.peer = host;
span.tag(Tag.dbType('Redis'));
span.tag(Tag.dbInstance(`${this.condition.select}`));
span.tag(Tag.dbInstance(`${this.condition?.select}`));
Copy link
Member

Choose a reason for hiding this comment

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

Could the condition be null? Could you share in which cases?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As described in apache/skywalking#7275, here is what happened in my app:
image

Copy link
Member

Choose a reason for hiding this comment

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

I got this. I mean is there a solution to make sure dbInstance would be set properly? Because this is an important tag, it is expected by the backend.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As we use redis cluster, dbInstance makes no sense. Also, there's no condition property in redis cluster mode.

Copy link
Member

Choose a reason for hiding this comment

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

For cluster mode, instance should be a cluster name or IP port list.
This is recommended.

Copy link
Member

Choose a reason for hiding this comment

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

There is no cache dashboard to represent metrics for performance yet, but once it is added, this undefined name will show up in the cache server list.
So, only an endpoint name is not enough. I can see peer includes an IP:port. Isn't it for the Redis server?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The Peer here stands for one of Redis cluster nodes. Is this value suitable for dbInstance ?

Copy link
Member

Choose a reason for hiding this comment

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

I am expecting the whole IP1:port1, IP2:port2,...

Copy link
Contributor Author

@TonyKingdom TonyKingdom Feb 25, 2022

Choose a reason for hiding this comment

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

Redis cluster nodes cannot be acquired by the code contexts unless we call some function which I believe is inappropriate.

Copy link
Member

Choose a reason for hiding this comment

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

Then at least use the peer value. It is at least better than null.

@wu-sheng wu-sheng added the bug Something isn't working label Feb 25, 2022
@wu-sheng wu-sheng added this to the 0.4.0 milestone Feb 25, 2022
Use Peer value instand of undefined in cluster mode as @wu-sheng suggested. 

apache#73 (comment)
@wu-sheng
Copy link
Member

Maybe not perfect, but good for now.

@kezhenxu94 WDYT?

@wu-sheng wu-sheng changed the title Update IORedisPlugin.ts Update IORedis Plugin, fill dbinstance tag as host if condition.select doesn't exist. Feb 28, 2022
Copy link
Member

@kezhenxu94 kezhenxu94 left a comment

Choose a reason for hiding this comment

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

Good to me

@wu-sheng wu-sheng merged commit 1b2eecd into apache:master Feb 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants