Skip to content

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.

@linux-foundation-easycla
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
@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