Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
commons
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
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DevOps
commons
Commits
2aaa0bd9
Commit
2aaa0bd9
authored
Jan 13, 2020
by
杨锐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
done
parent
67f5e068
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
16 deletions
+13
-16
BraveAutoConfiguration.java
...roup/tech/brave/configuration/BraveAutoConfiguration.java
+13
-16
No files found.
brave-spring-boot-starter/src/main/java/cn/quantgroup/tech/brave/configuration/BraveAutoConfiguration.java
View file @
2aaa0bd9
...
...
@@ -428,25 +428,22 @@ public class BraveAutoConfiguration {
@Around
(
"target(com.dangdang.ddframe.job.api.ElasticJob)"
)
public
Object
dynamicTrace
(
ProceedingJoinPoint
pjp
)
throws
Throwable
{
try
{
Tracer
tracer
=
tracing
().
tracer
();
/* 防止应用层非法使用(上下文中存在span),不生成root span。 */
if
(
tracer
.
currentSpan
()
==
null
)
{
if
(
tracer
.
currentSpan
()
!=
null
)
{
return
pjp
.
proceed
();
}
brave
.
Span
span
=
tracer
.
newTrace
();
try
(
Tracer
.
SpanInScope
ws
=
tracer
.
withSpanInScope
(
span
))
{
// note: try-with-resources closes the scope *before* the catch block
return
pjp
.
proceed
();
}
catch
(
RuntimeException
|
Error
e
)
{
log
.
error
(
"dynamicTrace error = 【{}】"
,
e
);
span
.
error
(
e
);
throw
e
;
}
finally
{
span
.
finish
();
}
}
}
finally
{
/* just in case, maybe not. */
return
pjp
.
proceed
();
}
}
}
}
}
...
...
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