Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#21 Add Zipkin optional module #23

Merged
merged 2 commits into from
Dec 3, 2016
Merged

Conversation

arey
Copy link
Member

@arey arey commented Dec 1, 2016

Sometimes, the export flag in the Sleuth logging has changed from false to true even if I use the AlwaysSampler:

2016-12-01 17:20:22.274  INFO [customers-service,b3c13ce8162f4c28,4c6423b12bee47f1,true] 16810 --- [o-auto-1-exec-6] o.s.s.p.c.application.OwnerService       : Saving owner [Owner@55c824f id = 1, new = false, lastName = 'Franklin', firstName = 'George', address = '110 W. Liberty St.', city = 'Madison', telephone = '6085551023']
2016-12-01 17:20:37.401  INFO [customers-service,27928a1296dfe5dd,18b41529de8b6396,false] 16810 --- [-auto-1-exec-10] o.s.s.p.c.application.OwnerService       : Saving owner [Owner@41e91d81 id = 2, new = false, lastName = 'Davis', firstName = 'Betty', address = '638 Cardinal Ave.', city = 'Sun Prairie', telephone = '6085551749']
2016-12-01 17:20:40.660  INFO [customers-service,a0da1ec02a5d0e54,e69793c518f85ec9,true] 16810 --- [o-auto-1-exec-4] o.s.s.p.c.application.OwnerService       : Saving owner [Owner@29c13699 id = 5, new = false, lastName = 'McTavish', firstName = 'Peter', address = '2387 S. Fair Way', city = 'Madison', telephone = '6085552765']
2016-12-01 17:23:13.616  INFO [customers-service,e6312fbff4020889,89776f2ba1fdfdb9,false] 16810 --- [-auto-1-exec-10] o.s.s.p.c.application.OwnerService       : Saving owner [Owner@7fe6f968 id = 1, new = false, lastName = 'Franklin', firstName = 'George', address = '110 W. Liberty St.', city = 'Madison', telephone = '6085551023']
2016-12-01 17:23:39.336  INFO [customers-service,e59bc823df24d0ba,847b62aba993eeb,false] 16810 --- [o-auto-1-exec-4] o.s.s.p.c.application.OwnerService       : Saving owner [Owner@7d806d4b id = 1, new = false, lastName = 'Franklin', firstName = 'George', address = '110 W. Liberty St.', city = 'Madison', telephone = '6085551023']

@mszarlinski could you please test this change?

@mszarlinski
Copy link
Collaborator

Will check it tomorrow

@mszarlinski
Copy link
Collaborator

mszarlinski commented Dec 2, 2016

I think we are missing a sampler configuration. There are two possibilities:

  • register AlwaysSampler bean,
  • add spring.sleuth.sampler.percentage=1.0 property.

Source: Blog post, Sample on GitHub

@arey
Copy link
Member Author

arey commented Dec 2, 2016

I've done some local test with AlwaysSampler but I don't commit it.
In the Spring Cloud Steuth documentation http://cloud.spring.io/spring-cloud-static/spring-cloud-sleuth/1.1.0.RELEASE, we could read :

the PercentageBasedSampler is the default if you are using spring-cloud-sleuth-zipkin or spring-cloud-sleuth-stream. You can configure the exports using spring.sleuth.sampler.percentage. The passed value needs to be a double from 0.0 to 1.0 so it’s not a percentage. For backwards compatibility reasons we’re not changing the property name.

To avoid adding AlwaysSampler in each web app, in the application.yml of the spring-petclinic-microservices-config we could add

spring:
  application:
  sleuth:
    sampler:
      percentage: 1.0

@mszarlinski
Copy link
Collaborator

According to documentation it must be a double property (1.0). Please add it to config repo as you described, so we don't need any changes in code.

@arey
Copy link
Member Author

arey commented Dec 3, 2016

I've pushed the change and all traces are now sent to Zipkin:

2016-12-02 16:43:36.124  INFO [customers-service,edc5a9146f915a6,51f537b601fc003d,true] 32988 --- [o-auto-1-exec-8] o.s.s.p.c.application.OwnerService       : Saving owner [Owner@b321cda id = 3, new = false, lastName = 'Rodriquez', firstName = 'Eduardo', address = '2693 Commerce St.', city = 'McFarland', telephone = '6085558763']
2016-12-02 16:43:52.270  INFO [customers-service,9682875e7a558dc0,e0b1fa108997b78a,true] 32988 --- [o-auto-1-exec-2] o.s.s.p.c.application.OwnerService       : Saving owner [Owner@635baaf2 id = 4, new = false, lastName = 'Davis', firstName = 'Harold', address = '563 Friendly St.', city = 'Windsor', telephone = '6085553198']
2016-12-02 16:44:00.599  INFO [customers-service,b5c83f278052b157,c7693268f397f0cf,true] 32988 --- [-auto-1-exec-10] o.s.s.p.c.application.PetService         : Saving pet Basil

@mszarlinski mszarlinski merged commit 9b8dd1f into spring-petclinic:master Dec 3, 2016
@arey arey mentioned this pull request Dec 4, 2016
@arey arey deleted the zipkin branch December 21, 2016 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants