Skip to content

feat(tracing): track Cursor.toArray method for Mongo #4563

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

Conversation

timofei-iatsenko
Copy link

Closes: #4495

Also added tests for mapReduce patching.

@timofei-iatsenko
Copy link
Author

I have a question:

What happend if i span.startChild() and never finish it?

I'm trying to achieve something like this while tracing cursor:

-- find({query})
  -- toArray()
  -- count()
  -- other methods called on this cursor

To achieve this i'm creating a new span and passing it to instrumentCursor method, where creating child spans for every cursor method calls. But this parent 'cursorSpan' would be never finished explicitly because we don't know where it may happen.

I assuming if will not close it explicitly it should calculate time based on child spans. Am i right?

@AbhiPrasad AbhiPrasad changed the title Feature: Mongo Tracing. Track Cursor.toArray method feat(tracing): track Cursor.toArray method for Mongo Feb 14, 2022
@AbhiPrasad
Copy link
Member

I assuming if will not close it explicitly it should calculate time based on child spans. Am i right?

If the span is not explicitly closed, it will not be sent.

Copy link
Member

@AbhiPrasad AbhiPrasad left a comment

Choose a reason for hiding this comment

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

I think this looks good as a initial start, we can come back and iterate as appropriate afterwards!

@timofei-iatsenko
Copy link
Author

@AbhiPrasad do you have any ideas how to achieve what've described?

What would be if the parent span would be closed earlier than child spans?

Again i want to explicitly show in tracing than cursor is created with some params and then these methods are called on the cursor. I want this tracks to be coupled to each other.

Of course i can implement it differently and for each cursor method invocation just create a separate span and merge data spanContenxt from cursor creation and actual async method call.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 8, 2022

This pull request has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@timofei-iatsenko
Copy link
Author

@AbhiPrasad any news about that?

@AbhiPrasad
Copy link
Member

Superceded by #6337

@AbhiPrasad AbhiPrasad closed this Nov 30, 2022
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.

MongoDB Integration: find method not measured correctly.
2 participants