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

Update redis instrumentation to follow semantic conventions #184

Merged
merged 11 commits into from
Nov 19, 2020

Conversation

srikanthccv
Copy link
Member

Description

Part of #159

Type of change

  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

How Has This Been Tested?

  • tox -e test-instrumentation-redis

@srikanthccv srikanthccv requested a review from a team as a code owner November 16, 2020 09:30
@srikanthccv srikanthccv requested review from toumorokoshi and ocelotl and removed request for a team November 16, 2020 09:30
@srikanthccv srikanthccv changed the title Update pymemcache instrumentation to follow semantic conventions Update redis instrumentation to follow semantic conventions Nov 16, 2020
@srikanthccv
Copy link
Member Author

cc @lzchen

Copy link
Member

@toumorokoshi toumorokoshi left a comment

Choose a reason for hiding this comment

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

great, thanks!

"db.type": "redis",
"db.instance": conn_kwargs.get("db", 0),
"db.system": "redis",
"db.name": conn_kwargs.get("db", 0),
}
try:
Copy link
Member

Choose a reason for hiding this comment

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

it looks like this is old code, but an if/else statement checking existence of keys is faster than a try/catch (more work like capture the stack when an exception is thrown)

Copy link
Member Author

Choose a reason for hiding this comment

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

https://docs.python.org/3/glossary.html?highlight=eafp#term-eafp, this is the reason I let this be try.. catch. I will change it if needed.

@lzchen lzchen merged commit 3c207e3 into open-telemetry:master Nov 19, 2020
@NathanielRN
Copy link
Contributor

@lonewolf3739 Just curious if there was thought to add db.redis.database_index for redis as seen on OTel DB Specifications? It looks like it is covered in most cases by db.name though.

"db.type": "redis",
"db.instance": conn_kwargs.get("db", 0),
"db.system": "redis",
"db.name": conn_kwargs.get("db", 0),
Copy link
Contributor

Choose a reason for hiding this comment

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

Actually, the footnote on the OTel Database Specificatiosn seems says it is required to use db.redis.database_index if the connection is not 0?

Copy link
Contributor

Choose a reason for hiding this comment

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

Good catch, maybe create a new issue to address this? @lonewolf3739

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure, will do that.

@srikanthccv
Copy link
Member Author

@lonewolf3739 Just curious if there was thought to add db.redis.database_index for redis as seen on OTel DB Specifications? It looks like it is covered in most cases by db.name though.

Good catch. I will add this.

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.

None yet

4 participants