Skip to content

Conversation

@TYsewyn
Copy link
Contributor

@TYsewyn TYsewyn commented Jan 13, 2019

Targets issue #1180.

@codecov-io
Copy link

codecov-io commented Jan 13, 2019

Codecov Report

Merging #1181 into master will increase coverage by 0.14%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1181      +/-   ##
============================================
+ Coverage     69.82%   69.97%   +0.14%     
- Complexity      773      775       +2     
============================================
  Files           142      142              
  Lines          3526     3530       +4     
  Branches        387      388       +1     
============================================
+ Hits           2462     2470       +8     
+ Misses          841      836       -5     
- Partials        223      224       +1
Impacted Files Coverage Δ Complexity Δ
...ipkin2/sender/ZipkinRabbitSenderConfiguration.java 100% <ø> (ø) 2 <0> (ø) ⬇️
.../sender/ZipkinRestTemplateSenderConfiguration.java 55.88% <ø> (ø) 3 <0> (ø) ⬇️
...zipkin2/sender/ZipkinKafkaSenderConfiguration.java 78.57% <ø> (ø) 4 <0> (ø) ⬇️
...loud/sleuth/autoconfig/TraceAutoConfiguration.java 96.22% <100%> (+0.3%) 23 <1> (+2) ⬆️
.../cloud/sleuth/zipkin2/ZipkinAutoConfiguration.java 100% <100%> (ø) 5 <1> (ø) ⬇️
...ing/TracingConnectionFactoryBeanPostProcessor.java 73.21% <0%> (+3.57%) 6% <0%> (ø) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 89ca7d7...8327ecb. Read the comment docs.

@codecov-io
Copy link

Codecov Report

Merging #1181 into master will increase coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff             @@
##             master   #1181      +/-   ##
===========================================
+ Coverage     69.78%   69.8%   +0.02%     
- Complexity      772     773       +1     
===========================================
  Files           142     142              
  Lines          3518    3521       +3     
  Branches        384     385       +1     
===========================================
+ Hits           2455    2458       +3     
  Misses          841     841              
  Partials        222     222
Impacted Files Coverage Δ Complexity Δ
...ipkin2/sender/ZipkinRabbitSenderConfiguration.java 100% <ø> (ø) 2 <0> (ø) ⬇️
.../sender/ZipkinRestTemplateSenderConfiguration.java 55.88% <ø> (ø) 3 <0> (ø) ⬇️
.../cloud/sleuth/zipkin2/ZipkinAutoConfiguration.java 100% <ø> (ø) 5 <0> (ø) ⬇️
...zipkin2/sender/ZipkinKafkaSenderConfiguration.java 78.57% <ø> (ø) 4 <0> (ø) ⬇️
...loud/sleuth/autoconfig/TraceAutoConfiguration.java 96.07% <100%> (+0.24%) 21 <0> (+1) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 218dd6c...07d2aa8. Read the comment docs.

* also replace with a standard one.
*/
@Bean
@Bean("zipkinReporter")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe extract to some constant?

private String topic;

@Bean
@Bean("zipkinSender")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe extract to some constant?

private String queue;

@Bean
@Bean("zipkinSender")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe extract to some constant?

}

@Test
public void supportsMultipleReporters() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you report a span and verify that both senders and reporters were actually called?

@devinsba
Copy link
Contributor

devinsba commented Jan 15, 2019

I'm worried that this will result in a hidden mis-configuration. I think this feature should require a flag

IE: Maybe I bring in 2 different starters that have Reporters in them and neither of them with @ConditionalOnMissingBean

@ConditionalOnMissingBean
public Reporter<Span> reporter(ReporterMetrics reporterMetrics,
ZipkinProperties zipkin, Sender sender, BytesEncoder<Span> spanBytesEncoder) {
ZipkinProperties zipkin, @Qualifier(SENDER_BEAN_NAME) Sender sender,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this needs a doc update associated with it since now overriding requires the correct bean name for a Sender

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This whole change needs a doc update because the overall configuration has been updated to support multiple tracers.
I already made the change for spring-cloud-gcp-trace (spring-attic/spring-cloud-gcp#1383).

@marcingrzejszczak
Copy link
Contributor

@devinsba

IE: Maybe I bring in 2 different starters that have Reporters in them and neither of them with @ConditionalOnMissingBean

Maybe I don't get it yet, but if neither is @ConditionalOnMissingBean we will get two reporters that are being used. I guess that's the point?

I'm worried that this will result in a hidden mis-configuration. I think this feature should require a flag

I'm for making this opt in - that makes sense.

@TYsewyn
Copy link
Contributor Author

TYsewyn commented Jan 15, 2019

I'm for making this opt in - that makes sense.

Honestly I do not agree, this shouldn't be configured with a property.
If I put 2 separate tracing systems intentionally on my classpath, both should work out of the box without adding more custom configuration.

@marcingrzejszczak
Copy link
Contributor

Honestly I do not agree, this shouldn't be configured with a property.
If I put 2 separate tracing systems intentionally on my classpath, both should work out of the box without adding more custom configuration.

Fair enough, makes sense. So let's make it opt out :)

@TYsewyn
Copy link
Contributor Author

TYsewyn commented Jan 15, 2019

Fair enough, makes sense. So let's make it opt out :)

opt-out can be done using eg. spring.zipkin.enabled=false or spring.cloud.gcp.trace.enabled=false :)

@TYsewyn
Copy link
Contributor Author

TYsewyn commented Jan 16, 2019

Pinging @adriancole to have a second pair of eyes.
@marcingrzejszczak and I went through it and it looks good to us. :)

@TYsewyn
Copy link
Contributor Author

TYsewyn commented Jan 16, 2019

I found out there is a breaking change, I'll make some adaptations accordingly.

@TYsewyn
Copy link
Contributor Author

TYsewyn commented Jan 16, 2019

That's weird... It's the second time that SleuthSpanCreatorAspectMonoTests is behaving flakey on CircleCI while everything is passing locally.
@marcingrzejszczak @adriancole can any of you verify this?


private Reporter<zipkin2.Span> adjustedReporter(Reporter<zipkin2.Span> delegate) {
private Reporter<zipkin2.Span> compositeReporter() {
return (span) -> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

optional: I would pull this into a static or package private class as it isn't debug friendly. a toString would be nice, and it would also be nice to not have to loop for the common case where there is only one reporter. Another optional would be to catch exceptions in the loop such that one report failure doesn't fail others.

@codefromthecrypt
Copy link
Contributor

I approved not as an overruling thing but based on my understanding of things. Those using sleuth should have a stronger opinion

@marcingrzejszczak marcingrzejszczak merged commit 490a1d8 into spring-cloud:master Jan 21, 2019
@marcingrzejszczak
Copy link
Contributor

Fixed via 490a1d8 and other commits by @TYsewyn

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants