-
Notifications
You must be signed in to change notification settings - Fork 337
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
Report telemetry with ActivitySource #1037
Conversation
There was a problem hiding this 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.
@@ -604,6 +606,9 @@ internal async Task DisposeAsync(IOBehavior ioBehavior, CancellationToken cancel | |||
Command.CancellableCommand.SetTimeout(Constants.InfiniteTimeout); | |||
connection.FinishQuerying(m_hasWarnings); | |||
|
|||
m_activity.SetSuccess(); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 whenExecuteReader
returns aDbDataReader
, or when thatDbDataReader
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.
There was a problem hiding this comment.
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 <bgrainger@gmail.com>
997f522
to
7dbfcd9
Compare
Signed-off-by: Bradley Grainger <bgrainger@gmail.com>
Signed-off-by: Bradley Grainger <bgrainger@gmail.com>
7dbfcd9
to
225a0d2
Compare
Signed-off-by: Bradley Grainger <bgrainger@gmail.com>
Fixes #1036.
Sample telemetry produced by connecting this PR to OpenTelemetry.Exporter.Jaeger.