You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2016/04/01 13:56:24 UTC
[6/6] camel git commit: CAMEL-9759: camel-zipkin - Instrument Camel.
Work in progress.
CAMEL-9759: camel-zipkin - Instrument Camel. Work in progress.
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/f0056d6c
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/f0056d6c
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/f0056d6c
Branch: refs/heads/master
Commit: f0056d6cc7f7f1a9cd7762e66baf35a4fdd3030a
Parents: c3d9576
Author: Claus Ibsen <da...@apache.org>
Authored: Fri Apr 1 12:56:05 2016 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Fri Apr 1 13:55:36 2016 +0200
----------------------------------------------------------------------
components/camel-zipkin/pom.xml | 4 ++--
.../apache/camel/zipkin/ZipkinEventNotifier.java | 17 ++++++++++-------
2 files changed, 12 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/f0056d6c/components/camel-zipkin/pom.xml
----------------------------------------------------------------------
diff --git a/components/camel-zipkin/pom.xml b/components/camel-zipkin/pom.xml
index a93f01e..72ea58f 100644
--- a/components/camel-zipkin/pom.xml
+++ b/components/camel-zipkin/pom.xml
@@ -76,8 +76,8 @@
<configuration>
<!-- needed for testing auto configure -->
<environmentVariables>
- <ZIPKIN_SERVICE_HOST>192.168.99.100</ZIPKIN_SERVICE_HOST>
- <ZIPKIN_SERVICE_PORT>9410</ZIPKIN_SERVICE_PORT>
+ <ZIPKIN_COLLECTOR_SERVICE_HOST>192.168.99.100</ZIPKIN_COLLECTOR_SERVICE_HOST>
+ <ZIPKIN_COLLECTOR_SERVICE_PORT>9410</ZIPKIN_COLLECTOR_SERVICE_PORT>
</environmentVariables>
</configuration>
</plugin>
http://git-wip-us.apache.org/repos/asf/camel/blob/f0056d6c/components/camel-zipkin/src/main/java/org/apache/camel/zipkin/ZipkinEventNotifier.java
----------------------------------------------------------------------
diff --git a/components/camel-zipkin/src/main/java/org/apache/camel/zipkin/ZipkinEventNotifier.java b/components/camel-zipkin/src/main/java/org/apache/camel/zipkin/ZipkinEventNotifier.java
index b566495..5135557 100644
--- a/components/camel-zipkin/src/main/java/org/apache/camel/zipkin/ZipkinEventNotifier.java
+++ b/components/camel-zipkin/src/main/java/org/apache/camel/zipkin/ZipkinEventNotifier.java
@@ -73,15 +73,18 @@ import static org.apache.camel.builder.ExpressionBuilder.routeIdExpression;
* endpoint uris in the names.
* <p/>
* Camel will auto-configure a {@link ScribeSpanCollector} if no SpanCollector explicit has been configured, and
- * if the hostname and port has been configured as environment variables
+ * if the hostname and port to the span collector has been configured as environment variables
* <ul>
- * <li>ZIPKIN_SERVICE_HOST - The hostname</li>
- * <li>ZIPKIN_SERVICE_PORT - The port number</li>
+ * <li>ZIPKIN_COLLECTOR_SERVICE_HOST - The hostname</li>
+ * <li>ZIPKIN_COLLECTOR_SERVICE_PORT - The port number</li>
* </ul>
*/
@ManagedResource(description = "Managing ZipkinEventNotifier")
public class ZipkinEventNotifier extends EventNotifierSupport implements StatefulService, CamelContextAware {
+ private final Map<String, Brave> braves = new HashMap<>();
+ private transient boolean useFallbackServiceNames;
+
private CamelContext camelContext;
private String hostName;
private int port;
@@ -90,9 +93,7 @@ public class ZipkinEventNotifier extends EventNotifierSupport implements Statefu
private Map<String, String> clientServiceMappings = new HashMap<>();
private Map<String, String> serverServiceMappings = new HashMap<>();
private Set<String> excludePatterns = new HashSet<>();
- private Map<String, Brave> braves = new HashMap<>();
private boolean includeMessageBody;
- private boolean useFallbackServiceNames;
public ZipkinEventNotifier() {
}
@@ -247,8 +248,8 @@ public class ZipkinEventNotifier extends EventNotifierSupport implements Statefu
spanCollector = new ScribeSpanCollector(hostName, port);
} else {
// is there a zipkin service setup as ENV variable to auto register a scribe span collector
- String host = new ServiceHostPropertiesFunction().apply("zipkin");
- String port = new ServicePortPropertiesFunction().apply("zipkin");
+ String host = new ServiceHostPropertiesFunction().apply("zipkin-collector");
+ String port = new ServicePortPropertiesFunction().apply("zipkin-collector");
if (ObjectHelper.isNotEmpty(host) && ObjectHelper.isNotEmpty(port)) {
log.info("Auto-configuring Zipkin ScribeSpanCollector using host: {} and port: {}", host, port);
int num = camelContext.getTypeConverter().mandatoryConvertTo(Integer.class, port);
@@ -288,6 +289,8 @@ public class ZipkinEventNotifier extends EventNotifierSupport implements Statefu
if (spanCollector instanceof Closeable) {
IOHelper.close((Closeable) spanCollector);
}
+
+ braves.clear();
}
@Override