From ab18462072a9172286e758574ce534ac807d8d7b Mon Sep 17 00:00:00 2001 From: yyyogev Date: Wed, 6 Nov 2019 12:39:14 +0200 Subject: [PATCH 1/2] updated vurnable dependencies --- README.md | 2 +- pom.xml | 4 ++-- storage-logzio/pom.xml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 971b8fd..a7998b2 100644 --- a/README.md +++ b/README.md @@ -85,7 +85,7 @@ Give your traces some time to get from your system to ours, and then open [Kiban If you still don't see your logs, see [log shipping troubleshooting](https://docs.logz.io/user-guide/log-shipping/log-shipping-troubleshooting.html). -###Changelog +### Changelog - v0.0.4 * Provide a docker for the integration * Added some tests diff --git a/pom.xml b/pom.xml index c2a8f38..d4ea4ad 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ pom - 0.0.4 + 0.0.5 2.16.0 2.1.7.RELEASE @@ -63,7 +63,7 @@ com.fasterxml.jackson.core jackson-databind - 2.9.9.2 + 2.9.10.1 diff --git a/storage-logzio/pom.xml b/storage-logzio/pom.xml index 379850e..0240bd7 100644 --- a/storage-logzio/pom.xml +++ b/storage-logzio/pom.xml @@ -21,7 +21,7 @@ io.logz.sender logzio-sender - 1.1.0 + 1.1.1 com.squareup.okhttp3 From ba69ff470e92e5fe56b773e628e3fd8907ee2aa3 Mon Sep 17 00:00:00 2001 From: yyyogev Date: Wed, 6 Nov 2019 12:39:37 +0200 Subject: [PATCH 2/2] logs dir bash on token and type --- .../zipkin2/storage/logzio/ConsumerParams.java | 14 ++++++++++---- .../storage/logzio/client/SearchRequest.java | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/storage-logzio/src/main/java/zipkin2/storage/logzio/ConsumerParams.java b/storage-logzio/src/main/java/zipkin2/storage/logzio/ConsumerParams.java index 8d4dec4..a0e05a2 100644 --- a/storage-logzio/src/main/java/zipkin2/storage/logzio/ConsumerParams.java +++ b/storage-logzio/src/main/java/zipkin2/storage/logzio/ConsumerParams.java @@ -3,11 +3,13 @@ import io.logz.sender.HttpsRequestConfiguration; import io.logz.sender.LogzioSender; import io.logz.sender.SenderStatusReporter; +import io.logz.sender.com.google.common.hash.Hashing; import io.logz.sender.exceptions.LogzioParameterErrorException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.File; +import java.nio.charset.StandardCharsets; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; @@ -16,7 +18,7 @@ public class ConsumerParams { private static final Logger logger = LoggerFactory.getLogger(ConsumerParams.class); private String url; - public static final String type = "zipkinSpan"; + public static final String TYPE = "zipkinSpan"; private String accountToken; private final int threadPoolSize = 3; private final boolean compressRequests = true; @@ -29,10 +31,13 @@ public class ConsumerParams { private int senderDrainInterval; private int cleanSentTracesInterval; - public ConsumerParams() { + public void setQueueDir() { + String tokenTypeSha = Hashing.sha256() + .hashString(TYPE + accountToken, StandardCharsets.UTF_8) + .toString(); String queuePath = System.getProperty("user.dir"); queuePath += queuePath.endsWith("/") ? "" : "/"; - queuePath += "logzio-storage"; + queuePath += "logzio-storage" + tokenTypeSha; this.queueDir = new File(queuePath); } @@ -50,6 +55,7 @@ public String getAccountToken() { public void setAccountToken(String accountToken) { this.accountToken = accountToken; + setQueueDir(); } public ScheduledExecutorService getSenderExecutors() { @@ -62,7 +68,7 @@ public LogzioSender getLogzioSender() { requestConf = HttpsRequestConfiguration .builder() .setLogzioListenerUrl(getUrl()) - .setLogzioType(this.type) + .setLogzioType(this.TYPE) .setLogzioToken(getAccountToken()) .setCompressRequests(this.compressRequests) .build(); diff --git a/storage-logzio/src/main/java/zipkin2/storage/logzio/client/SearchRequest.java b/storage-logzio/src/main/java/zipkin2/storage/logzio/client/SearchRequest.java index 30e274f..669d705 100644 --- a/storage-logzio/src/main/java/zipkin2/storage/logzio/client/SearchRequest.java +++ b/storage-logzio/src/main/java/zipkin2/storage/logzio/client/SearchRequest.java @@ -54,7 +54,7 @@ public Filters addTerms(String field, List values) { } public SearchRequest filters(Filters filters) { - filters.addTerm("type", ConsumerParams.type); + filters.addTerm("type", ConsumerParams.TYPE); return query(new BoolQuery("must", filters)); }