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

fix: Trilogy only set db.instance.id attribute if there is a value #792

Merged
merged 2 commits into from
Jan 5, 2024

Conversation

bensheldon
Copy link
Contributor

@bensheldon bensheldon commented Jan 4, 2024

It's possible for the @connected_host value to be unset nil because a query is made within trilogy to initially assign the @connected_host:

https://github.com/trilogy-libraries/trilogy/blob/3c3a3865a3896f3056b1d7c69c5244964b60937c/contrib/ruby/lib/trilogy.rb#L39-L50

This PR adds a presence check before assigning the attribute.

Copy link

linux-foundation-easycla bot commented Jan 4, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

@bensheldon
Copy link
Contributor Author

bensheldon commented Jan 5, 2024

@arielvalentin I made one more tweak which is to only do a nil check. The ivar will always be defined because it's declared in #initialize: https://github.com/trilogy-libraries/trilogy/blob/3c3a3865a3896f3056b1d7c69c5244964b60937c/contrib/ruby/lib/trilogy.rb#L16

@arielvalentin arielvalentin merged commit 9924715 into open-telemetry:main Jan 5, 2024
47 checks passed
@github-actions github-actions bot mentioned this pull request Jan 5, 2024
@arielvalentin arielvalentin changed the title Trilogy: only set db.instance.id attribute if there is a value fix: Trilogy only set db.instance.id attribute if there is a value Jan 5, 2024
This was referenced Jan 5, 2024
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.

3 participants