Skip to content

Conversation

bgrainger
Copy link
Member

Fixes #1036.

Sample telemetry produced by connecting this PR to OpenTelemetry.Exporter.Jaeger.

image

Copy link

@vonzshik vonzshik left a comment

Choose a reason for hiding this comment

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

@roji for some thoughts.

Command.CancellableCommand.SetTimeout(Constants.InfiniteTimeout);
connection.FinishQuerying(m_hasWarnings);

m_activity.SetSuccess();

Choose a reason for hiding this comment

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

Here's another interesting thing: specification for database providers does not mention whether statement is completed whenever the first row is received, or every single row is read. SqlClient does the former.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, I noted that here: #1036:

TODO: Does the Execute activity end when ExecuteReader returns a DbDataReader, or when that DbDataReader has finished consuming the result set (and is closed/disposed)?

My preference is the latter; as an application developer, I usually care about when the entire using (var reader = cmd.ExecuteReader()) { ... } block has finished, not about when it "begins".

I suggested adding an event for when the DbDataReader is created and returned, for those who care about breaking the whole span into two parts.

It would be ideal to standardise this, have a good name for the event, etc.

Copy link

Choose a reason for hiding this comment

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

See ongoing conversation in npgsql/npgsql#3967 (comment)

Signed-off-by: Bradley Grainger <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Add ActivitySource

3 participants