Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
CAP
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tsai
CAP
Commits
4e31a424
Commit
4e31a424
authored
Jan 14, 2019
by
liuhaoyang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/OpenSkywalking/skywalking-netcore
parents
bbaa2aaa
04f1da23
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
14 deletions
+8
-14
SkyWalking.Diagnostics.SqlClient.csproj
...nostics.SqlClient/SkyWalking.Diagnostics.SqlClient.csproj
+1
-1
SqlClientDiagnosticProcessor.cs
...ing.Diagnostics.SqlClient/SqlClientDiagnosticProcessor.cs
+7
-13
No files found.
src/SkyWalking.Diagnostics.SqlClient/SkyWalking.Diagnostics.SqlClient.csproj
View file @
4e31a424
...
...
@@ -4,7 +4,7 @@
<Description>SkyWalking.Diagnostics.SqlClient notifies outgoing SqlClient requests.</Description>
<AssemblyTitle>SkyWalking.Diagnostics.SqlClient</AssemblyTitle>
<TargetFramework>netstandard2.0</TargetFramework>
<AssemblyName>S
S
kyWalking.Diagnostics.SqlClient</AssemblyName>
<AssemblyName>SkyWalking.Diagnostics.SqlClient</AssemblyName>
<PackageId>SkyWalking.Diagnostics.SqlClient</PackageId>
<PackageTags>SkyWalking;APM;Diagnostics;SqlClient</PackageTags>
<PackageReleaseNotes>
...
...
src/SkyWalking.Diagnostics.SqlClient/SqlClientDiagnosticProcessor.cs
View file @
4e31a424
...
...
@@ -36,14 +36,14 @@ namespace SkyWalking.Diagnostics.SqlClient
var
commandType
=
sqlCommand
.
CommandText
?.
Split
(
' '
);
return
$"
{
SqlClientDiagnosticStrings
.
SqlClientPrefix
}{
commandType
?.
FirstOrDefault
()}
"
;
}
private
bool
IsTraceORM
()
{
return
ContextManager
.
ContextProperties
!=
null
&&
ContextManager
.
ContextProperties
.
ContainsKey
(
TRACE_ORM
);
}
[
DiagnosticName
(
SqlClientDiagnosticStrings
.
SqlBeforeExecuteCommand
)]
public
void
BeforeExecuteCommand
([
Property
(
Name
=
"Command"
)]
SqlCommand
sqlCommand
)
{
if
(
ContextManager
.
ContextProperties
.
ContainsKey
(
TRACE_ORM
))
{
return
;
}
if
(
IsTraceORM
())
{
return
;
}
var
peer
=
sqlCommand
.
Connection
.
DataSource
;
var
span
=
ContextManager
.
CreateExitSpan
(
ResolveOperationName
(
sqlCommand
),
peer
);
span
.
SetLayer
(
SpanLayer
.
DB
);
...
...
@@ -57,20 +57,14 @@ namespace SkyWalking.Diagnostics.SqlClient
[
DiagnosticName
(
SqlClientDiagnosticStrings
.
SqlAfterExecuteCommand
)]
public
void
AfterExecuteCommand
()
{
if
(
ContextManager
.
ContextProperties
.
ContainsKey
(
TRACE_ORM
))
{
return
;
}
if
(
IsTraceORM
())
{
return
;
}
ContextManager
.
StopSpan
();
}
[
DiagnosticName
(
SqlClientDiagnosticStrings
.
SqlErrorExecuteCommand
)]
public
void
ErrorExecuteCommand
([
Property
(
Name
=
"Exception"
)]
Exception
ex
)
{
if
(
ContextManager
.
ContextProperties
.
ContainsKey
(
TRACE_ORM
))
{
return
;
}
if
(
IsTraceORM
())
{
return
;
}
var
span
=
ContextManager
.
ActiveSpan
;
span
?.
ErrorOccurred
();
span
?.
Log
(
ex
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment