-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deprecates EnableZipkinServer to explain custom servers are unsupported
Especially lately, we have had a large number of people having problems with unnecessarily custom servers. Some are due to not knowing Sleuth's stream server is obviated by our rabbit support. Some are due to blogs which unfortunately recommend starting Zipkin in the IDE via a custom server. Through discussion, we decided the easiest way to let users know custom servers are unsupported is by deprecation. Deprecation shows up in the IDE and will alert those doing blogs or otherwise that they are suggesting discouraged practice. It also sends a clear signal to those who need to make custom servers that while doing so is possible, it is something the customizer needs to accept support reponsibility of.
- Loading branch information
Adrian Cole
committed
Mar 27, 2018
1 parent
c42aa93
commit 8cda3f1
Showing
86 changed files
with
774 additions
and
484 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# zipkin-autoconfigure | ||
|
||
Modules in this directory are considered internal details to Zipkin's | ||
server and are unsupported unless integrated with our [server build](../zipkin-server). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
...oconfigure/collector-kafka/src/test/java/zipkin/autoconfigure/collector/kafka/Access.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/** | ||
* Copyright 2015-2018 The OpenZipkin Authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except | ||
* in compliance with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software distributed under the License | ||
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express | ||
* or implied. See the License for the specific language governing permissions and limitations under | ||
* the License. | ||
*/ | ||
package zipkin.autoconfigure.collector.kafka; | ||
|
||
import org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration; | ||
import org.springframework.boot.context.properties.EnableConfigurationProperties; | ||
import org.springframework.context.annotation.AnnotationConfigApplicationContext; | ||
import org.springframework.context.annotation.Configuration; | ||
import zipkin.collector.kafka.KafkaCollector; | ||
|
||
/** opens package access for testing */ | ||
public final class Access { | ||
|
||
/** Just registering properties to avoid automatically connecting to a Kafka server */ | ||
public static void registerKafkaProperties(AnnotationConfigApplicationContext context) { | ||
context.register( | ||
PropertyPlaceholderAutoConfiguration.class, | ||
EnableKafkaCollectorProperties.class | ||
); | ||
} | ||
|
||
@Configuration | ||
@EnableConfigurationProperties(ZipkinKafkaCollectorProperties.class) | ||
static class EnableKafkaCollectorProperties { | ||
} | ||
|
||
public static KafkaCollector.Builder collectorBuilder( | ||
AnnotationConfigApplicationContext context | ||
) { | ||
return context.getBean(ZipkinKafkaCollectorProperties.class).toBuilder(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
...gure/collector-kafka/src/test/java/zipkin/collector/kafka/NestedPropertyOverrideTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/** | ||
* Copyright 2015-2018 The OpenZipkin Authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except | ||
* in compliance with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software distributed under the License | ||
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express | ||
* or implied. See the License for the specific language governing permissions and limitations under | ||
* the License. | ||
*/ | ||
package zipkin.collector.kafka; | ||
|
||
import org.junit.Test; | ||
import org.springframework.context.annotation.AnnotationConfigApplicationContext; | ||
import zipkin.autoconfigure.collector.kafka.Access; | ||
import zipkin.storage.InMemoryStorage; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
import static org.springframework.boot.test.util.EnvironmentTestUtils.addEnvironment; | ||
|
||
public class NestedPropertyOverrideTest { | ||
@Test public void overrideWithNestedProperties() { | ||
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(); | ||
addEnvironment(context, | ||
"zipkin.collector.kafka.zookeeper:localhost", | ||
"zipkin.collector.kafka.overrides.auto.offset.reset:largest" | ||
); | ||
Access.registerKafkaProperties(context); | ||
context.refresh(); | ||
|
||
assertThat(Access.collectorBuilder(context) | ||
.storage(new InMemoryStorage()) | ||
.build().connector.config.autoOffsetReset()) | ||
.isEqualTo("largest"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
...figure/collector-kafka10/src/test/java/zipkin/autoconfigure/collector/kafka10/Access.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/** | ||
* Copyright 2015-2018 The OpenZipkin Authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except | ||
* in compliance with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software distributed under the License | ||
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express | ||
* or implied. See the License for the specific language governing permissions and limitations under | ||
* the License. | ||
*/ | ||
package zipkin.autoconfigure.collector.kafka10; | ||
|
||
import org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration; | ||
import org.springframework.boot.context.properties.EnableConfigurationProperties; | ||
import org.springframework.context.annotation.AnnotationConfigApplicationContext; | ||
import org.springframework.context.annotation.Configuration; | ||
import zipkin.collector.kafka10.KafkaCollector; | ||
|
||
/** opens package access for testing */ | ||
public final class Access { | ||
|
||
/** Just registering properties to avoid automatically connecting to a Kafka server */ | ||
public static void registerKafkaProperties(AnnotationConfigApplicationContext context) { | ||
context.register( | ||
PropertyPlaceholderAutoConfiguration.class, | ||
EnableKafkaCollectorProperties.class | ||
); | ||
} | ||
|
||
@Configuration | ||
@EnableConfigurationProperties(ZipkinKafkaCollectorProperties.class) | ||
static class EnableKafkaCollectorProperties { | ||
} | ||
|
||
public static KafkaCollector.Builder collectorBuilder( | ||
AnnotationConfigApplicationContext context | ||
) { | ||
return context.getBean(ZipkinKafkaCollectorProperties.class).toBuilder(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.