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

feat: split query.Result tracing details into Result, ResultSet and Row with scan spans #1392

Open
pelageech opened this issue Aug 5, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@pelageech
Copy link

pelageech commented Aug 5, 2024

Feature Request

Describe the Feature Request
At the moment, we can either show all spans connected with reading *query.Result or nothing at all. The traces are not satisfactory, too. We can't collapse them into one span in JaegerUI either within in a Result or within a ResultSet.

Describe Preferred Solution
I'd like to see my traces in a such span tree:

ReadResult
 ├─ ReadResultSet
 │  ├─ ReadRow
 │  │  └─ ScanRow
 │  ├─ ReadRow
 │  │  └─ ScanRow
 │  ├─ ReadRow
 │  │  └─ ScanRow
 │    ...
 ├─ ReadResultSet
 │
  ...

I think that this is obvious that we should open the span when we get the following ResultSet/Row and an error is nil. But I don't know when to close it (since we don't have any close funcs for ResultSet and Row), so I propose to close the current span when we've called NextResultSet/NextRow before we open the next one. Hope you you'll come up with a better way.

Also, we should close Row, ResultSet and Result spans when we close the Result. We should prevent span leak if result.Close() isn't called as well.

And the second thing is that I would like to remove Result, ResultSet and Row traces individually using trace.Details flags. I think the proper way is to implement the Result flag showing only the Result trace, the ResultSet flag showing Result and ResultSet traces and the Row flag showing the full tree above.

Describe Alternatives

Related Code

Additional Context
A quick look at traces:
Снимок экрана 2024-08-05 в 12 02 31

If the feature request is approved, would you be willing to submit a PR?
No

@pelageech pelageech added the enhancement New feature or request label Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant