Skip to content

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

Open
@pelageech

Description

@pelageech

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions