Fix pymongo event object and string commands#703
Fix pymongo event object and string commands#703whardier wants to merge 2 commits intoopen-telemetry:masterfrom whardier:fix-pymongo-event-object-and-string-commands
Conversation
…formation is present (replica sets.. possibly sharding information). Ensure that command is stringy when attempting to concatenate strings. Suggest use fstrings if older pythons can be depreciated
…formation is present (replica sets.. possibly sharding information). Ensure that command is stringy when attempting to concatenate strings. Suggest use fstrings if older pythons can be depreciated
toumorokoshi
left a comment
There was a problem hiding this comment.
Thanks for the fix! I think I'm not entirely convinced that that this fixes the whole set of issues with the set_status call.
Can you also add unit tests to verify? That would be a good way to programatically verify the issue is resolved.
| span.set_status( | ||
| Status( | ||
| StatusCanonicalCode.UNKNOWN, | ||
| json.loads(bson.json_util.dumps(event.failure)), |
There was a problem hiding this comment.
will this stringify all expected types? One thing I see is that event.failure is a more structured document. the Status description must be a string, or it will be discarded.
Instead of json.loads, should this be a str() cast?
|
Yup. I am a bit concerned about it not linting properly on py38 also
On Wed, May 20, 2020 at 8:06 PM Yusuke Tsutsumi ***@***.***> wrote:
***@***.**** requested changes on this pull request.
Thanks for the fix! I think I'm not entirely convinced that that this
fixes the whole set of issues with the set_status call.
Can you also add unit tests to verify? That would be a good way to
programatically verify the issue is resolved.
------------------------------
In ext/opentelemetry-ext-pymongo/src/opentelemetry/ext/pymongo/__init__.py
<#703 (comment)>
:
> @@ -115,7 +122,12 @@ def failed(self, event: monitoring.CommandFailedEvent):
if span is None:
return
span.set_attribute("db.mongo.duration_micros", event.duration_micros)
- span.set_status(Status(StatusCanonicalCode.UNKNOWN, event.failure))
+ span.set_status(
+ Status(
+ StatusCanonicalCode.UNKNOWN,
+ json.loads(bson.json_util.dumps(event.failure)),
will this stringify all expected types? One thing I see is that
event.failure is a more structured document. the Status description must be
a string, or it will be discarded.
Instead of json.loads, should this be a str() cast?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#703 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACKRFOPY3SDK32Z6ZLMSEDRSSSEBANCNFSM4NDUXESQ>
.
--
[image: --]
Shane R. Spencer
[image: https://]about.me/ShaneSpencer
<https://about.me/ShaneSpencer?promo=email_sig>
|
|
@whardier any chance you could address the request for change from @toumorokoshi? |
|
I am not part of the project
On Thu, Jul 30, 2020 at 8:49 AM alrex ***@***.***> wrote:
@whardier <https://github.com/whardier> any chance you could address the
request for change from @toumorokoshi <https://github.com/toumorokoshi>?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#703 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACKRFNOMJGHQFLG2GZDYCLR6GQBBANCNFSM4NDUXESQ>
.
--
[image: --]
Shane R. Spencer
[image: https://]about.me/ShaneSpencer
<https://about.me/ShaneSpencer?promo=email_sig>
|
@whardier |
|
Sorry. I've been accidentally added to a lot of things lately because I've
commented on things in the past. This is my PR yes. I figured there was
more discussion to be done on this topic. Is there anybody primarily
responsible for this code that I could work with over slack?
[image: --]
Shane R. Spencer
[image: https://]about.me/ShaneSpencer
<https://about.me/ShaneSpencer?promo=email_sig>
…On Thu, Jul 30, 2020 at 1:24 PM Leighton Chen ***@***.***> wrote:
I am not part of the project
@whardier <https://github.com/whardier>
I believe this PR is something that you submitted correct? Are you saying
you are no longer interested in getting these changes merged?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#703 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACKRFPOJYHHECN6KVF6Y4DR6HQIHANCNFSM4NDUXESQ>
.
|
|
@whardier |
|
I think I can get some tests going for this and update the patch
specifically for the newest version of open telemetry extensions. I have
been having overall some issues with the software and haven’t been using it
much
On Mon, Aug 3, 2020 at 4:53 PM Leighton Chen ***@***.***> wrote:
@whardier <https://github.com/whardier>
Thanks for the response. I do not believe there was anymore discussion for
this topic other than what you see in this thread.
As for owners of the code, there isn't really one person that is
responsible for the pymongo instrumentation. If you would like to continue
working on this and discuss possible architectural decisions, I'd advise
you to do start a thread in the gitter channel
<https://gitter.im/open-telemetry/opentelemetry-python>.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#703 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACKRFISB3TRIC3XFJUQVQLR65LXHANCNFSM4NDUXESQ>
.
--
[image: --]
Shane R. Spencer
[image: https://]about.me/ShaneSpencer
<https://about.me/ShaneSpencer?promo=email_sig>
|
|
Closed due to inactivity |
add ts-node package closes open-telemetry#703 Signed-off-by: Olivier Albertini <olivier.albertini@montreal.ca>
No description provided.