zipkin 不显示日志
zipkin not showing logs
在日志中,Zipkin 状态为真,但我在 Zipkin 中看不到它 UI。
personservice,c083b6900ad38c72,5276fea5682c7efa,true
同样的事情适用于 zuul 但不适用于其他微服务。
依赖关系
buildscript {
ext {
springBootVersion = '2.1.7.RELEASE'
}
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
classpath 'se.transmode.gradle:gradle-docker:1.2'
classpath "com.commercehub.gradle.plugin:gradle-avro-plugin:0.9.1"
}
}
plugins {
id 'net.ltgt.apt' version '0.10'
id 'io.spring.dependency-management' version '1.0.7.RELEASE'
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'org.springframework.boot'
apply plugin: 'docker'
apply plugin: "com.commercehub.gradle.plugin.avro"
group = 'com.microservicePlayground'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
ext {
set('springCloudVersion', "Greenwich.SR2")
}
dependencies {
// Eureka
compile('org.springframework.cloud:spring-cloud-starter-netflix-eureka-server')
compile('org.springframework.cloud:spring-cloud-starter-config')
compile('org.springframework.cloud:spring-cloud-starter')
compile('org.springframework.boot:spring-boot-starter-data-jpa')
compile('org.springframework.boot:spring-boot-starter-web')
// config
compile('org.springframework.cloud:spring-cloud-config-client')
//
compile "org.springframework.security:spring-security-rsa"
compile "org.springframework.boot:spring-boot-starter-actuator"
runtime('mysql:mysql-connector-java')
//Mapper
annotationProcessor group: 'org.mapstruct', name: 'mapstruct-processor', version: '1.3.0.Final'
implementation "org.mapstruct:mapstruct:1.3.0.Final"
testCompile('org.springframework.boot:spring-boot-starter-test')
//Sleuth
//compile "org.springframework.cloud:spring-cloud-starter-sleuth"
//zipkin
compile 'org.springframework.cloud:spring-cloud-starter-zipkin'
//Spring cloud Stream JMS
compile 'org.springframework.cloud:spring-cloud-stream'
compile 'org.springframework.cloud:spring-cloud-starter-stream-rabbit'
compile('org.springframework.cloud:spring-cloud-stream-schema')
//spring cloud bus for config refresh
compile "org.springframework.cloud:spring-cloud-starter-bus-amqp"
//OAuth 2
compile('org.springframework.cloud:spring-cloud-starter-oauth2')
compile "org.springframework.security:spring-security-jwt"
compile "org.springframework.cloud:spring-cloud-security"
compile group: 'commons-io', name: 'commons-io', version: '2.6'
//chaos-monkey
compile "de.codecentric:chaos-monkey-spring-boot:2.1.1"
}
dependencyManagement {
imports {
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
}
}
属性:
spring.sleuth.sampler.probability: 1.0
spring.zipkin.baseUrl: http://localhost:9411/
spring:
cloud:
stream:
bindings:
output:
destination: inboundOrgChanges
binder: local_rabbit
content-type: application/json
group: organizationService
binders:
local_rabbit:
type: rabbit
environment:
spring:
rabbitmq:
host: localhost
port: 5672
username: guest
password: guest
virtual-host: /
zuul 和这个微服务之间的唯一区别是,它也使用 spring 云流。这能是理由吗?
我有一个使用 spring 云流和 zipkin 的工作项目,使用以下配置(也许你应该设置 sender.type):
spring:
zipkin:
enabled: true
service.name: my-service
sender.type: web
base-url: http://localhost:9411
sleuth:
enabled: true
sampler:
probability: 1.0
希望对您有所帮助。
在日志中,Zipkin 状态为真,但我在 Zipkin 中看不到它 UI。
personservice,c083b6900ad38c72,5276fea5682c7efa,true
同样的事情适用于 zuul 但不适用于其他微服务。
依赖关系
buildscript {
ext {
springBootVersion = '2.1.7.RELEASE'
}
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
classpath 'se.transmode.gradle:gradle-docker:1.2'
classpath "com.commercehub.gradle.plugin:gradle-avro-plugin:0.9.1"
}
}
plugins {
id 'net.ltgt.apt' version '0.10'
id 'io.spring.dependency-management' version '1.0.7.RELEASE'
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'org.springframework.boot'
apply plugin: 'docker'
apply plugin: "com.commercehub.gradle.plugin.avro"
group = 'com.microservicePlayground'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
ext {
set('springCloudVersion', "Greenwich.SR2")
}
dependencies {
// Eureka
compile('org.springframework.cloud:spring-cloud-starter-netflix-eureka-server')
compile('org.springframework.cloud:spring-cloud-starter-config')
compile('org.springframework.cloud:spring-cloud-starter')
compile('org.springframework.boot:spring-boot-starter-data-jpa')
compile('org.springframework.boot:spring-boot-starter-web')
// config
compile('org.springframework.cloud:spring-cloud-config-client')
//
compile "org.springframework.security:spring-security-rsa"
compile "org.springframework.boot:spring-boot-starter-actuator"
runtime('mysql:mysql-connector-java')
//Mapper
annotationProcessor group: 'org.mapstruct', name: 'mapstruct-processor', version: '1.3.0.Final'
implementation "org.mapstruct:mapstruct:1.3.0.Final"
testCompile('org.springframework.boot:spring-boot-starter-test')
//Sleuth
//compile "org.springframework.cloud:spring-cloud-starter-sleuth"
//zipkin
compile 'org.springframework.cloud:spring-cloud-starter-zipkin'
//Spring cloud Stream JMS
compile 'org.springframework.cloud:spring-cloud-stream'
compile 'org.springframework.cloud:spring-cloud-starter-stream-rabbit'
compile('org.springframework.cloud:spring-cloud-stream-schema')
//spring cloud bus for config refresh
compile "org.springframework.cloud:spring-cloud-starter-bus-amqp"
//OAuth 2
compile('org.springframework.cloud:spring-cloud-starter-oauth2')
compile "org.springframework.security:spring-security-jwt"
compile "org.springframework.cloud:spring-cloud-security"
compile group: 'commons-io', name: 'commons-io', version: '2.6'
//chaos-monkey
compile "de.codecentric:chaos-monkey-spring-boot:2.1.1"
}
dependencyManagement {
imports {
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
}
}
属性:
spring.sleuth.sampler.probability: 1.0
spring.zipkin.baseUrl: http://localhost:9411/
spring:
cloud:
stream:
bindings:
output:
destination: inboundOrgChanges
binder: local_rabbit
content-type: application/json
group: organizationService
binders:
local_rabbit:
type: rabbit
environment:
spring:
rabbitmq:
host: localhost
port: 5672
username: guest
password: guest
virtual-host: /
zuul 和这个微服务之间的唯一区别是,它也使用 spring 云流。这能是理由吗?
我有一个使用 spring 云流和 zipkin 的工作项目,使用以下配置(也许你应该设置 sender.type):
spring:
zipkin:
enabled: true
service.name: my-service
sender.type: web
base-url: http://localhost:9411
sleuth:
enabled: true
sampler:
probability: 1.0
希望对您有所帮助。