Skip to content
This repository has been archived by the owner on Sep 7, 2023. It is now read-only.

Commit

Permalink
Merge pull request #21 from logzio/dependencies
Browse files Browse the repository at this point in the history
Dependencies
  • Loading branch information
yyyogev authored Nov 6, 2019
2 parents 8743335 + ba69ff4 commit bdfb953
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<packaging>pom</packaging>

<properties>
<zipkin-logzio-version>0.0.4</zipkin-logzio-version>
<zipkin-logzio-version>0.0.5</zipkin-logzio-version>
<!-- make sure this matches zipkin's version -->
<zipkin.version>2.16.0</zipkin.version>
<spring-boot.version>2.1.7.RELEASE</spring-boot.version>
Expand Down Expand Up @@ -63,7 +63,7 @@
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.9.9.2</version>
<version>2.9.10.1</version>
</dependency>

<dependency>
Expand Down
2 changes: 1 addition & 1 deletion storage-logzio/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<dependency>
<groupId>io.logz.sender</groupId>
<artifactId>logzio-sender</artifactId>
<version>1.1.0</version>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;
Expand All @@ -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);
}

Expand All @@ -50,6 +55,7 @@ public String getAccountToken() {

public void setAccountToken(String accountToken) {
this.accountToken = accountToken;
setQueueDir();
}

public ScheduledExecutorService getSenderExecutors() {
Expand All @@ -62,7 +68,7 @@ public LogzioSender getLogzioSender() {
requestConf = HttpsRequestConfiguration
.builder()
.setLogzioListenerUrl(getUrl())
.setLogzioType(this.type)
.setLogzioType(this.TYPE)
.setLogzioToken(getAccountToken())
.setCompressRequests(this.compressRequests)
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public Filters addTerms(String field, List<String> values) {
}

public SearchRequest filters(Filters filters) {
filters.addTerm("type", ConsumerParams.type);
filters.addTerm("type", ConsumerParams.TYPE);
return query(new BoolQuery("must", filters));
}

Expand Down

0 comments on commit bdfb953

Please sign in to comment.