Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dict
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
陈文顺
dict
Commits
74249374
Commit
74249374
authored
Nov 21, 2018
by
yong.huang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add zikpin code
parent
76eed912
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
205 additions
and
2 deletions
+205
-2
feign-client/pom.xml
+5
-0
feign-client/src/main/resources/application.yml
+9
-0
pom.xml
+2
-1
springboot-demo/pom.xml
+5
-0
springboot-demo/src/main/resources/application.yml
+5
-0
zipkin-server/pom.xml
+68
-0
zipkin-server/src/main/java/com/freemud/demo/ZipkinServerApplication.java
+22
-0
zipkin-server/src/main/resources/application.yml
+43
-0
zipkin-server/src/main/resources/logback.xml
+28
-0
zuul-gateway/pom.xml
+10
-0
zuul-gateway/src/main/resources/application.yml
+7
-0
zuul-gateway/src/main/resources/logback.xml
+1
-1
No files found.
feign-client/pom.xml
View file @
74249374
...
@@ -37,6 +37,11 @@
...
@@ -37,6 +37,11 @@
<dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-zipkin
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-eureka
</artifactId>
<artifactId>
spring-cloud-starter-eureka
</artifactId>
</dependency>
</dependency>
</dependencies>
</dependencies>
...
...
feign-client/src/main/resources/application.yml
View file @
74249374
spring
:
spring
:
application
:
application
:
name
:
feign-client
name
:
feign-client
zipkin
:
base-url
:
http://localhost:9083
sleuth
:
sampler
:
percentage
:
1.0
#采样比率,1.0代表全部采样
server
:
server
:
port
:
9082
port
:
9082
...
@@ -30,3 +35,7 @@ hystrix:
...
@@ -30,3 +35,7 @@ hystrix:
coreSize
:
100
#并发执行的最大线程数,默认10
coreSize
:
100
#并发执行的最大线程数,默认10
pom.xml
View file @
74249374
...
@@ -23,6 +23,7 @@
...
@@ -23,6 +23,7 @@
<module>
eureka-server
</module>
<module>
eureka-server
</module>
<module>
zuul-gateway
</module>
<module>
zuul-gateway
</module>
<module>
feign-client
</module>
<module>
feign-client
</module>
<module>
zipkin-server
</module>
</modules>
</modules>
...
@@ -30,7 +31,7 @@
...
@@ -30,7 +31,7 @@
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<project.reporting.outputEncoding>
UTF-8
</project.reporting.outputEncoding>
<project.reporting.outputEncoding>
UTF-8
</project.reporting.outputEncoding>
<java.version>
1.8
</java.version>
<java.version>
1.8
</java.version>
<spring-cloud.version>
Edgware.SR
2
</spring-cloud.version>
<spring-cloud.version>
Edgware.SR
3
</spring-cloud.version>
<mybatis3.version>
1.3.2
</mybatis3.version>
<mybatis3.version>
1.3.2
</mybatis3.version>
<mapper.version>
1.1.1
</mapper.version>
<mapper.version>
1.1.1
</mapper.version>
<spring-cloud.version>
Dalston.SR4
</spring-cloud.version>
<spring-cloud.version>
Dalston.SR4
</spring-cloud.version>
...
...
springboot-demo/pom.xml
View file @
74249374
...
@@ -62,6 +62,11 @@
...
@@ -62,6 +62,11 @@
<dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-zipkin
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-eureka
</artifactId>
<artifactId>
spring-cloud-starter-eureka
</artifactId>
</dependency>
</dependency>
...
...
springboot-demo/src/main/resources/application.yml
View file @
74249374
...
@@ -6,6 +6,11 @@ spring:
...
@@ -6,6 +6,11 @@ spring:
port
:
5289
port
:
5289
password
:
U252fnIDyfF1A1
password
:
U252fnIDyfF1A1
database
:
3
database
:
3
zipkin
:
base-url
:
http://localhost:9083
sleuth
:
sampler
:
percentage
:
1.0
#采样比率,1.0代表全部采样
server
:
server
:
port
:
9005
port
:
9005
...
...
zipkin-server/pom.xml
0 → 100644
View file @
74249374
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<parent>
<artifactId>
spring-demo-parent
</artifactId>
<groupId>
com.freemud.demo
</groupId>
<version>
1.0-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
zipkin-server
</artifactId>
<dependencies>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-sleuth
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-sleuth-zipkin-stream
</artifactId>
</dependency>
<dependency>
<groupId>
io.zipkin.java
</groupId>
<artifactId>
zipkin-autoconfigure-ui
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-eureka
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-stream-binder-kafka
</artifactId>
</dependency>
<dependency>
<groupId>
io.zipkin.java
</groupId>
<artifactId>
zipkin-server
</artifactId>
</dependency>
<dependency>
<groupId>
io.zipkin.java
</groupId>
<artifactId>
zipkin-autoconfigure-storage-elasticsearch-http
</artifactId>
<version>
2.3.1
</version>
</dependency>
</dependencies>
<!-- 引入spring cloud的依赖 -->
<dependencyManagement>
<dependencies>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-dependencies
</artifactId>
<version>
Edgware.RELEASE
</version>
<type>
pom
</type>
<scope>
import
</scope>
</dependency>
</dependencies>
</dependencyManagement>
</project>
\ No newline at end of file
zipkin-server/src/main/java/com/freemud/demo/ZipkinServerApplication.java
0 → 100644
View file @
74249374
package
com
.
freemud
.
demo
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.cloud.netflix.eureka.EnableEurekaClient
;
import
zipkin.server.EnableZipkinServer
;
/**
* @Auther: yong.huang
* @Date: 2018/11/21 10:06
* @Description:
*/
@SpringBootApplication
@EnableEurekaClient
@EnableZipkinServer
public
class
ZipkinServerApplication
{
public
static
void
main
(
String
[]
args
){
SpringApplication
.
run
(
ZipkinServerApplication
.
class
,
args
);
}
}
zipkin-server/src/main/resources/application.yml
0 → 100644
View file @
74249374
spring
:
application
:
name
:
zipkin-server
cloud
:
stream
:
kafka
:
binder
:
brokers
:
localhost:9092
zkNodes
:
localhost:2181
server
:
port
:
9083
#log
logging
:
config
:
classpath:logback.xml
swagger_enable
:
true
eureka
:
instance
:
preferIpAddress
:
true
client
:
serviceUrl
:
defaultZone
:
http://localhost:8761/eureka/
zipkin
:
storage
:
type
:
elasticsearch
elasticsearch
:
cluster
:
elasticsearch
hosts
:
http://localhost:9200
index
:
zipkin
index-shards
:
5
index-replicas
:
1
zipkin-server/src/main/resources/logback.xml
0 → 100644
View file @
74249374
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<!--<springProperty scope="context"-->
<!--name="springAppName"-->
<!--source="spring.application.name"/>-->
<!-- %m输出的信息,%p日志级别,%t线程名,%d日期,%c类的全名,,,, -->
<appender
name=
"STDOUT"
class=
"ch.qos.logback.core.ConsoleAppender"
>
<encoder>
<charset>
UTF-8
</charset>
<pattern>
%d %p (%file:%line\)- %m%n
</pattern>
</encoder>
</appender>
<appender
name =
"STDOUT_tid"
class=
"ch.qos.logback.core.ConsoleAppender"
>
<layout
class =
"ch.qos.logback.classic.PatternLayout"
>
<!--<Pattern >%d{HH:mm} %-5level %logger{36} - [springAppName:${springAppName:-}, TxId : %X{X-B3-TraceId:-} , SpanId : %X{X-B3-SpanId:-}] %msg%n</Pattern >-->
<Pattern
>
%d{HH:mm} %-5level %logger{36} - [zipkin-server,%X{X-B3-TraceId:-},%X{X-B3-SpanId:-}] %msg%n
</Pattern >
</layout >
</appender >
<root
level=
"info"
>
<appender-ref
ref=
"STDOUT_tid"
/>
</root>
</configuration>
\ No newline at end of file
zuul-gateway/pom.xml
View file @
74249374
...
@@ -43,6 +43,16 @@
...
@@ -43,6 +43,16 @@
<scope>
test
</scope>
<scope>
test
</scope>
</dependency>
</dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-sleuth
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-zipkin
</artifactId>
</dependency>
</dependencies>
</dependencies>
...
...
zuul-gateway/src/main/resources/application.yml
View file @
74249374
spring
:
spring
:
application
:
application
:
name
:
api-gateway
name
:
api-gateway
zipkin
:
base-url
:
http://localhost:9083
sleuth
:
sampler
:
percentage
:
1.0
#采样比率,1.0代表全部采样
server
:
server
:
port
:
9080
port
:
9080
...
@@ -54,3 +59,5 @@ ribbon:
...
@@ -54,3 +59,5 @@ ribbon:
OkToRetryOnAllOperations
:
false
OkToRetryOnAllOperations
:
false
zuul-gateway/src/main/resources/logback.xml
View file @
74249374
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
<appender
name =
"STDOUT_tid"
class=
"ch.qos.logback.core.ConsoleAppender"
>
<appender
name =
"STDOUT_tid"
class=
"ch.qos.logback.core.ConsoleAppender"
>
<layout
class =
"ch.qos.logback.classic.PatternLayout"
>
<layout
class =
"ch.qos.logback.classic.PatternLayout"
>
<!--<Pattern >%d{HH:mm} %-5level %logger{36} - [springAppName:${springAppName:-}, TxId : %X{X-B3-TraceId:-} , SpanId : %X{X-B3-SpanId:-}] %msg%n</Pattern >-->
<!--<Pattern >%d{HH:mm} %-5level %logger{36} - [springAppName:${springAppName:-}, TxId : %X{X-B3-TraceId:-} , SpanId : %X{X-B3-SpanId:-}] %msg%n</Pattern >-->
<Pattern
>
%d{HH:mm} %-5level %logger{36} - [
spring-demo
,%X{X-B3-TraceId:-},%X{X-B3-SpanId:-}] %msg%n
</Pattern >
<Pattern
>
%d{HH:mm} %-5level %logger{36} - [
zuul-gateway
,%X{X-B3-TraceId:-},%X{X-B3-SpanId:-}] %msg%n
</Pattern >
</layout >
</layout >
</appender >
</appender >
...
...
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