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
e9b87212
Commit
e9b87212
authored
May 03, 2018
by
技术部-高工-张恒
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改servername获取方式
parent
856982e3
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
17 deletions
+27
-17
pom.xml
brave-spring-boot-starter/pom.xml
+0
-1
BraveAutoConfiguration.java
...roup/tech/brave/configuration/BraveAutoConfiguration.java
+6
-3
BraveProperties.java
.../cn/quantgroup/tech/brave/properties/BraveProperties.java
+2
-7
ServiceProperties.java
...n/quantgroup/tech/brave/properties/ServiceProperties.java
+19
-0
pom.xml
commons-spring/pom.xml
+0
-6
No files found.
brave-spring-boot-starter/pom.xml
View file @
e9b87212
...
@@ -27,7 +27,6 @@
...
@@ -27,7 +27,6 @@
<dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-configuration-processor
</artifactId>
<artifactId>
spring-boot-configuration-processor
</artifactId>
<optional>
true
</optional>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<groupId>
org.springframework.boot
</groupId>
...
...
brave-spring-boot-starter/src/main/java/cn/quantgroup/tech/brave/configuration/BraveAutoConfiguration.java
View file @
e9b87212
...
@@ -11,6 +11,7 @@ import brave.spring.web.TracingClientHttpRequestInterceptor;
...
@@ -11,6 +11,7 @@ import brave.spring.web.TracingClientHttpRequestInterceptor;
import
brave.spring.webmvc.DelegatingTracingFilter
;
import
brave.spring.webmvc.DelegatingTracingFilter
;
import
brave.spring.webmvc.SpanCustomizingAsyncHandlerInterceptor
;
import
brave.spring.webmvc.SpanCustomizingAsyncHandlerInterceptor
;
import
cn.quantgroup.tech.brave.properties.BraveProperties
;
import
cn.quantgroup.tech.brave.properties.BraveProperties
;
import
cn.quantgroup.tech.brave.properties.ServiceProperties
;
import
cn.quantgroup.tech.brave.service.ITechRabbitBuilder
;
import
cn.quantgroup.tech.brave.service.ITechRabbitBuilder
;
import
cn.quantgroup.tech.brave.service.TechRabbitBuilderNoTrace
;
import
cn.quantgroup.tech.brave.service.TechRabbitBuilderNoTrace
;
import
cn.quantgroup.tech.brave.service.TechRabbitBuilderTrace
;
import
cn.quantgroup.tech.brave.service.TechRabbitBuilderTrace
;
...
@@ -67,7 +68,6 @@ public class BraveAutoConfiguration {
...
@@ -67,7 +68,6 @@ public class BraveAutoConfiguration {
}
}
@Configuration
@Configuration
@EnableWebMvc
@EnableConfigurationProperties
(
BraveProperties
.
class
)
@EnableConfigurationProperties
(
BraveProperties
.
class
)
@ConditionalOnProperty
(
prefix
=
"tech.brave"
,
name
=
"enabled"
,
havingValue
=
"false"
)
@ConditionalOnProperty
(
prefix
=
"tech.brave"
,
name
=
"enabled"
,
havingValue
=
"false"
)
public
static
class
BraveUntEnabled
{
public
static
class
BraveUntEnabled
{
...
@@ -117,13 +117,16 @@ public class BraveAutoConfiguration {
...
@@ -117,13 +117,16 @@ public class BraveAutoConfiguration {
@Configuration
@Configuration
@EnableWebMvc
@EnableWebMvc
@EnableConfigurationProperties
(
BraveProperties
.
class
)
@EnableConfigurationProperties
(
{
BraveProperties
.
class
,
ServiceProperties
.
class
}
)
@ConditionalOnProperty
(
prefix
=
"tech.brave"
,
name
=
"enabled"
,
havingValue
=
"true"
)
@ConditionalOnProperty
(
prefix
=
"tech.brave"
,
name
=
"enabled"
,
havingValue
=
"true"
)
@Import
(
{
TracingClientHttpRequestInterceptor
.
class
,
SpanCustomizingAsyncHandlerInterceptor
.
class
}
)
@Import
(
{
TracingClientHttpRequestInterceptor
.
class
,
SpanCustomizingAsyncHandlerInterceptor
.
class
}
)
public
static
class
BraveEnabled
extends
WebMvcConfigurerAdapter
{
public
static
class
BraveEnabled
extends
WebMvcConfigurerAdapter
{
@Autowired
@Autowired
private
BraveProperties
braveProperties
;
private
BraveProperties
braveProperties
;
@Autowired
private
ServiceProperties
serviceProperties
;
@Autowired
@Autowired
private
TracingClientHttpRequestInterceptor
clientInterceptor
;
private
TracingClientHttpRequestInterceptor
clientInterceptor
;
...
@@ -145,7 +148,7 @@ public class BraveAutoConfiguration {
...
@@ -145,7 +148,7 @@ public class BraveAutoConfiguration {
Tracing
tracing
()
{
Tracing
tracing
()
{
return
Tracing
.
newBuilder
()
return
Tracing
.
newBuilder
()
.
sampler
(
brave
.
sampler
.
Sampler
.
create
(
braveProperties
.
getSample
()))
.
sampler
(
brave
.
sampler
.
Sampler
.
create
(
braveProperties
.
getSample
()))
.
localServiceName
(
braveProperties
.
getService
Name
())
.
localServiceName
(
serviceProperties
.
get
Name
())
.
propagationFactory
(
ExtraFieldPropagation
.
newFactory
(
B3Propagation
.
FACTORY
,
"user-name"
))
.
propagationFactory
(
ExtraFieldPropagation
.
newFactory
(
B3Propagation
.
FACTORY
,
"user-name"
))
.
currentTraceContext
(
ThreadContextCurrentTraceContext
.
create
())
.
currentTraceContext
(
ThreadContextCurrentTraceContext
.
create
())
.
spanReporter
(
spanReporter
()).
build
();
.
spanReporter
(
spanReporter
()).
build
();
...
...
brave-spring-boot-starter/src/main/java/cn/quantgroup/tech/brave/properties/BraveProperties.java
View file @
e9b87212
...
@@ -12,20 +12,15 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
...
@@ -12,20 +12,15 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
@Data
@Data
@ConfigurationProperties
(
prefix
=
"tech.brave"
)
@ConfigurationProperties
(
prefix
=
"tech.brave"
)
public
class
BraveProperties
{
public
class
BraveProperties
{
/**
* 指定serviceName
*/
private
String
serviceName
=
"brave"
;
/**
/**
* kafka地址
* kafka地址
*/
*/
private
String
kafkaBootstrapServers
=
"172.30.220.11:16091,172.30.220.11:16092,172.30.220.11:16093"
;
private
String
kafkaBootstrapServers
;
/**
/**
* kafka的topic
* kafka的topic
*/
*/
private
String
kafkaTopic
=
"quantGroup.tech.brave.dev"
;
private
String
kafkaTopic
;
/**
/**
* 采集率
* 采集率
...
...
brave-spring-boot-starter/src/main/java/cn/quantgroup/tech/brave/properties/ServiceProperties.java
0 → 100644
View file @
e9b87212
package
cn
.
quantgroup
.
tech
.
brave
.
properties
;
import
lombok.Data
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
/**
* brave配置信息
*
* @author zhangheng
* create on 2018.04.25
*/
@Data
@ConfigurationProperties
(
"spring.application"
)
public
class
ServiceProperties
{
/**
*
*/
String
name
;
}
commons-spring/pom.xml
View file @
e9b87212
...
@@ -96,12 +96,6 @@
...
@@ -96,12 +96,6 @@
<artifactId>
assertj-core
</artifactId>
<artifactId>
assertj-core
</artifactId>
</dependency>
</dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-sleuth-stream
</artifactId>
<scope>
compile
</scope>
</dependency>
<dependency>
<dependency>
<groupId>
org.springframework
</groupId>
<groupId>
org.springframework
</groupId>
<artifactId>
spring-jdbc
</artifactId>
<artifactId>
spring-jdbc
</artifactId>
...
...
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