From 3f02afa67385d57a1297c44a36692fd44f9f7de8 Mon Sep 17 00:00:00 2001 From: gnkoshelev Date: Wed, 19 Feb 2020 17:54:41 +0500 Subject: [PATCH 1/6] Tracing API with ClickHouse as storage --- .../clickhouse/sink/ClickHouseSender.java | 3 +- .../vostok/hercules/configuration/Scopes.java | 1 + hercules-tracing-api/README.md | 55 +++++--- hercules-tracing-api/application.properties | 18 +-- hercules-tracing-api/pom.xml | 6 +- .../kontur/hercules/tracing/api/PageInfo.java | 29 ----- .../tracing/api/cassandra/PagedResult.java | 30 ----- .../hercules/tracing/api/GetTraceHandler.java | 10 +- .../vostok/hercules/tracing/api/Page.java | 39 ++++++ .../hercules/tracing/api/QueryParameters.java | 2 +- .../vostok/hercules/tracing/api/Source.java | 9 ++ .../tracing/api/TracingApiApplication.java | 41 ++---- .../hercules/tracing/api/TracingReader.java | 67 ++++++++++ .../cassandra/CassandraTracingReader.java} | 67 ++++++---- .../clickhouse/ClickHouseTracingReader.java | 121 ++++++++++++++++++ .../api/json/EventToJsonConverter.java | 16 +-- 16 files changed, 361 insertions(+), 153 deletions(-) delete mode 100644 hercules-tracing-api/src/main/java/ru/kontur/hercules/tracing/api/PageInfo.java delete mode 100644 hercules-tracing-api/src/main/java/ru/kontur/hercules/tracing/api/cassandra/PagedResult.java rename hercules-tracing-api/src/main/java/ru/kontur/{ => vostok}/hercules/tracing/api/GetTraceHandler.java (88%) create mode 100644 hercules-tracing-api/src/main/java/ru/kontur/vostok/hercules/tracing/api/Page.java rename hercules-tracing-api/src/main/java/ru/kontur/{ => vostok}/hercules/tracing/api/QueryParameters.java (95%) create mode 100644 hercules-tracing-api/src/main/java/ru/kontur/vostok/hercules/tracing/api/Source.java rename hercules-tracing-api/src/main/java/ru/kontur/{ => vostok}/hercules/tracing/api/TracingApiApplication.java (75%) create mode 100644 hercules-tracing-api/src/main/java/ru/kontur/vostok/hercules/tracing/api/TracingReader.java rename hercules-tracing-api/src/main/java/ru/kontur/{hercules/tracing/api/TracingReader.java => vostok/hercules/tracing/api/cassandra/CassandraTracingReader.java} (68%) create mode 100644 hercules-tracing-api/src/main/java/ru/kontur/vostok/hercules/tracing/api/clickhouse/ClickHouseTracingReader.java rename hercules-tracing-api/src/main/java/ru/kontur/{ => vostok}/hercules/tracing/api/json/EventToJsonConverter.java (74%) diff --git a/hercules-clickhouse-sink/src/main/java/ru/kontur/vostok/hercules/clickhouse/sink/ClickHouseSender.java b/hercules-clickhouse-sink/src/main/java/ru/kontur/vostok/hercules/clickhouse/sink/ClickHouseSender.java index 0bf784798..d068bc147 100644 --- a/hercules-clickhouse-sink/src/main/java/ru/kontur/vostok/hercules/clickhouse/sink/ClickHouseSender.java +++ b/hercules-clickhouse-sink/src/main/java/ru/kontur/vostok/hercules/clickhouse/sink/ClickHouseSender.java @@ -3,6 +3,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import ru.kontur.vostok.hercules.clickhouse.util.ClickHouseConnector; +import ru.kontur.vostok.hercules.configuration.Scopes; import ru.kontur.vostok.hercules.health.AutoMetricStopwatch; import ru.kontur.vostok.hercules.health.MetricsCollector; import ru.kontur.vostok.hercules.health.Timer; @@ -42,7 +43,7 @@ public abstract class ClickHouseSender extends Sender { public ClickHouseSender(Properties properties, MetricsCollector metricsCollector) { super(properties, metricsCollector); - Properties clickhouseProperties = PropertiesUtil.ofScope(properties, "clickhouse"); + Properties clickhouseProperties = PropertiesUtil.ofScope(properties, Scopes.CLICKHOUSE); this.connector = new ClickHouseConnector(clickhouseProperties); this.processingTimeMsTimer = metricsCollector.timer("processingTimeMs"); diff --git a/hercules-configuration/src/main/java/ru/kontur/vostok/hercules/configuration/Scopes.java b/hercules-configuration/src/main/java/ru/kontur/vostok/hercules/configuration/Scopes.java index 00f3e4844..1383f4bc9 100644 --- a/hercules-configuration/src/main/java/ru/kontur/vostok/hercules/configuration/Scopes.java +++ b/hercules-configuration/src/main/java/ru/kontur/vostok/hercules/configuration/Scopes.java @@ -7,6 +7,7 @@ public final class Scopes { public static final String ZOOKEEPER = "zk"; public static final String KAFKA = "kafka"; public static final String CASSANDRA = "cassandra"; + public static final String CLICKHOUSE = "clickhouse"; public static final String CURATOR = "curator"; diff --git a/hercules-tracing-api/README.md b/hercules-tracing-api/README.md index e5e4c326c..693e5cf7d 100644 --- a/hercules-tracing-api/README.md +++ b/hercules-tracing-api/README.md @@ -145,25 +145,44 @@ See Curator Config from Apache Curator documentation. Main settings are presente `metrics.period` - the period with which metrics are sent to graphite, default value: `60` -### Apache Cassandra settings +### Tracing Reader settings +`reader.source` - traces source (`CASSANDRA` or `CLICKHOUSE`), default value: `CASSANDRA` + +#### Cassandra Tracing Reader settings +`reader.table` - table name in Cassandra + +##### Apache Cassandra settings See Apache Cassandra Config from Apache Cassandra documentation. Main settings are presented below. -`cassandra.dataCenter` - local Cassandra DC, default value: `datacenter1` +`reader.cassandra.dataCenter` - local Cassandra DC, default value: `datacenter1` -`cassandra.nodes` - nodes of Cassandra in form `[:port][,[:port],...]`, default value: `127.0.0.1`, +`reader.cassandra.nodes` - nodes of Cassandra in form `[:port][,[:port],...]`, default value: `127.0.0.1`, also, default port value is `9042` -`cassandra.keyspace` - keyspace in Cassandra, default value: `hercules` +`reader.cassandra.keyspace` - keyspace in Cassandra, default value: `hercules` + +`reader.cassandra.requestTimeoutMs` - request to Cassandra timeout, default value: `12000` + +`reader.cassandra.connectionsPerHostLocal` - connections per local Cassandra node (see Cassandra docs for details), default value: `4` + +`reader.cassandra.connectionsPerHostRemote` - connections per remote Cassandra node (see Cassandra docs for details), default value: `2` + +`reader.cassandra.maxRequestsPerConnection` - max requests per connection, default value: `1024` + +`reader.cassandra.consistencyLevel` - consistency level (see Cassandra docs for details), default value: `QUORUM` -`cassandra.requestTimeoutMs` - request to Cassandra timeout, default value: `12000` +#### ClickHouse Tracing Reader settings +`reader.table` - table name in ClickHouse -`cassandra.connectionsPerHostLocal` - connections per local Cassandra node (see Cassandra docs for details), default value: `4` +##### ClickHouse settings +`reader.clickhouse.nodes` - ClickHouse `node:port` comma-separated list, +default value: `localhost:8123` -`cassandra.connectionsPerHostRemote` - connections per remote Cassandra node (see Cassandra docs for details), default value: `2` +`reader.clickhouse.db` - database name in ClickHouse, default value: `default` -`cassandra.maxRequestsPerConnection` - max requests per connection, default value: `1024` +`reader.clickhouse.validationIntervalMs` - interval in millis to validate open connections and re-create failed ones, default value: `10000` -`cassandra.consistencyLevel` - consistency level (see Cassandra docs for details), default value: `QUORUM` +`reader.clickhouse.properties` - base scope for ClickHouse connection properties, see JDBC driver docs for details ### Http Server settings `http.server.ioThreads` - the number of IO threads. IO threads are used to read incoming requests and perform non-blocking tasks. One IO thread per CPU core should be enough. Default value is implementation specific. @@ -201,14 +220,16 @@ metrics.graphite.server.port=2003 metrics.graphite.prefix=hercules metrics.period=60 -cassandra.dataCenter=datacenter1 -cassandra.nodes=localhost:9042,localhost:9043,localhost:9044 -cassandra.keyspace=hercules_traces -cassandra.requestTimeoutMs=12000 -cassandra.connectionsPerHostLocal=4 -cassandra.connectionsPerHostRemote=2 -cassandra.maxRequestsPerConnection=1024 -cassandra.consistencyLevel=QUORUM +reader.source=CASSANDRA +reader.table=tracing_spans +reader.cassandra.dataCenter=datacenter1 +reader.cassandra.nodes=localhost:9042,localhost:9043,localhost:9044 +reader.cassandra.keyspace=hercules_traces +reader.cassandra.requestTimeoutMs=12000 +reader.cassandra.connectionsPerHostLocal=4 +reader.cassandra.connectionsPerHostRemote=2 +reader.cassandra.maxRequestsPerConnection=1024 +reader.cassandra.consistencyLevel=QUORUM http.server.ioThreads=8 http.server.workerThreads=32 diff --git a/hercules-tracing-api/application.properties b/hercules-tracing-api/application.properties index 62b52d5c7..58fbdea02 100644 --- a/hercules-tracing-api/application.properties +++ b/hercules-tracing-api/application.properties @@ -17,14 +17,16 @@ metrics.graphite.server.port=2003 metrics.graphite.prefix=hercules metrics.period=60 -cassandra.dataCenter=datacenter1 -cassandra.nodes=localhost:9042,localhost:9043,localhost:9044 -cassandra.keyspace=hercules_traces -cassandra.requestTimeoutMs=12000 -cassandra.connectionsPerHostLocal=4 -cassandra.connectionsPerHostRemote=2 -cassandra.maxRequestsPerConnection=1024 -cassandra.consistencyLevel=QUORUM +reader.source=CASSANDRA +reader.table=tracing_spans +reader.cassandra.dataCenter=datacenter1 +reader.cassandra.nodes=localhost:9042,localhost:9043,localhost:9044 +reader.cassandra.keyspace=hercules_traces +reader.cassandra.requestTimeoutMs=12000 +reader.cassandra.connectionsPerHostLocal=4 +reader.cassandra.connectionsPerHostRemote=2 +reader.cassandra.maxRequestsPerConnection=1024 +reader.cassandra.consistencyLevel=QUORUM http.server.ioThreads=8 http.server.workerThreads=32 diff --git a/hercules-tracing-api/pom.xml b/hercules-tracing-api/pom.xml index e19e006f4..e42f2118d 100644 --- a/hercules-tracing-api/pom.xml +++ b/hercules-tracing-api/pom.xml @@ -35,6 +35,10 @@ ru.kontur.vostok.hercules hercules-cassandra-util + + ru.kontur.vostok.hercules + hercules-clickhouse-util + ru.kontur.vostok.hercules hercules-configuration @@ -69,7 +73,7 @@ - ru.kontur.hercules.tracing.api.TracingApiApplication + ru.kontur.vostok.hercules.tracing.api.TracingApiApplication false diff --git a/hercules-tracing-api/src/main/java/ru/kontur/hercules/tracing/api/PageInfo.java b/hercules-tracing-api/src/main/java/ru/kontur/hercules/tracing/api/PageInfo.java deleted file mode 100644 index 4bc108550..000000000 --- a/hercules-tracing-api/src/main/java/ru/kontur/hercules/tracing/api/PageInfo.java +++ /dev/null @@ -1,29 +0,0 @@ -package ru.kontur.hercules.tracing.api; - -/** - * PageInfo - * - * @author Kirill Sulim - */ -public class PageInfo { - - private final long offset; - private final int count; - - public PageInfo(long offset, int count) { - this.offset = offset; - this.count = count; - } - - public long getOffset() { - return offset; - } - - public int getCount() { - return count; - } - - public static PageInfo of(final long offset, final int count) { - return new PageInfo(offset, count); - } -} diff --git a/hercules-tracing-api/src/main/java/ru/kontur/hercules/tracing/api/cassandra/PagedResult.java b/hercules-tracing-api/src/main/java/ru/kontur/hercules/tracing/api/cassandra/PagedResult.java deleted file mode 100644 index 3aafac8d8..000000000 --- a/hercules-tracing-api/src/main/java/ru/kontur/hercules/tracing/api/cassandra/PagedResult.java +++ /dev/null @@ -1,30 +0,0 @@ -package ru.kontur.hercules.tracing.api.cassandra; - -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -import java.util.List; - -/** - * PagedResult - * - * @author Kirill Sulim - */ -public class PagedResult { - - private final List result; - private final String pagingState; - - public PagedResult(@NotNull List result, @Nullable String pagingState) { - this.result = result; - this.pagingState = pagingState; - } - - public List getResult() { - return result; - } - - public String getPagingState() { - return pagingState; - } -} diff --git a/hercules-tracing-api/src/main/java/ru/kontur/hercules/tracing/api/GetTraceHandler.java b/hercules-tracing-api/src/main/java/ru/kontur/vostok/hercules/tracing/api/GetTraceHandler.java similarity index 88% rename from hercules-tracing-api/src/main/java/ru/kontur/hercules/tracing/api/GetTraceHandler.java rename to hercules-tracing-api/src/main/java/ru/kontur/vostok/hercules/tracing/api/GetTraceHandler.java index d5141098d..437cfc00a 100644 --- a/hercules-tracing-api/src/main/java/ru/kontur/hercules/tracing/api/GetTraceHandler.java +++ b/hercules-tracing-api/src/main/java/ru/kontur/vostok/hercules/tracing/api/GetTraceHandler.java @@ -1,7 +1,7 @@ -package ru.kontur.hercules.tracing.api; +package ru.kontur.vostok.hercules.tracing.api; -import ru.kontur.hercules.tracing.api.cassandra.PagedResult; -import ru.kontur.hercules.tracing.api.json.EventToJsonConverter; +import ru.kontur.vostok.hercules.tracing.api.cassandra.CassandraTracingReader; +import ru.kontur.vostok.hercules.tracing.api.json.EventToJsonConverter; import ru.kontur.vostok.hercules.http.HttpServerRequest; import ru.kontur.vostok.hercules.http.HttpStatusCodes; import ru.kontur.vostok.hercules.http.MimeTypes; @@ -63,7 +63,7 @@ public void handle(HttpServerRequest request) { } if (!parentSpanId.isEmpty()) { - final PagedResult traceSpansByTraceIdAndParentSpanId = tracingReader.getTraceSpansByTraceIdAndParentSpanId( + final Page traceSpansByTraceIdAndParentSpanId = tracingReader.getTraceSpansByTraceIdAndParentSpanId( traceId.get(), parentSpanId.get(), limit.get(), @@ -72,7 +72,7 @@ public void handle(HttpServerRequest request) { request.getResponse().setContentType(MimeTypes.APPLICATION_JSON); request.getResponse().send(EventToJsonConverter.pagedResultAsString(traceSpansByTraceIdAndParentSpanId)); } else { - final PagedResult traceSpansByTraceId = tracingReader.getTraceSpansByTraceId( + final Page traceSpansByTraceId = tracingReader.getTraceSpansByTraceId( traceId.get(), limit.get(), pagingState.orEmpty(null)); diff --git a/hercules-tracing-api/src/main/java/ru/kontur/vostok/hercules/tracing/api/Page.java b/hercules-tracing-api/src/main/java/ru/kontur/vostok/hercules/tracing/api/Page.java new file mode 100644 index 000000000..5f454cb76 --- /dev/null +++ b/hercules-tracing-api/src/main/java/ru/kontur/vostok/hercules/tracing/api/Page.java @@ -0,0 +1,39 @@ +package ru.kontur.vostok.hercules.tracing.api; + +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.List; + +/** + * Page has the list of elements and the state of it. + * + * @author Gregory Koshelev + */ +public class Page { + private final List elements; + private final String state; + + public Page(@NotNull List elements, @Nullable String pagingState) { + this.elements = elements; + this.state = pagingState; + } + + /** + * Elements. If page if empty, then return empty list. + * + * @return the list of elements + */ + public List elements() { + return elements; + } + + /** + * The page state. If the state is undefined, then return {@code null}. + * + * @return state + */ + public String state() { + return state; + } +} diff --git a/hercules-tracing-api/src/main/java/ru/kontur/hercules/tracing/api/QueryParameters.java b/hercules-tracing-api/src/main/java/ru/kontur/vostok/hercules/tracing/api/QueryParameters.java similarity index 95% rename from hercules-tracing-api/src/main/java/ru/kontur/hercules/tracing/api/QueryParameters.java rename to hercules-tracing-api/src/main/java/ru/kontur/vostok/hercules/tracing/api/QueryParameters.java index 75a73872a..a7aa3dd9e 100644 --- a/hercules-tracing-api/src/main/java/ru/kontur/hercules/tracing/api/QueryParameters.java +++ b/hercules-tracing-api/src/main/java/ru/kontur/vostok/hercules/tracing/api/QueryParameters.java @@ -1,4 +1,4 @@ -package ru.kontur.hercules.tracing.api; +package ru.kontur.vostok.hercules.tracing.api; import ru.kontur.vostok.hercules.util.parameter.Parameter; import ru.kontur.vostok.hercules.util.parameter.parsing.Parsers; diff --git a/hercules-tracing-api/src/main/java/ru/kontur/vostok/hercules/tracing/api/Source.java b/hercules-tracing-api/src/main/java/ru/kontur/vostok/hercules/tracing/api/Source.java new file mode 100644 index 000000000..7e82f3737 --- /dev/null +++ b/hercules-tracing-api/src/main/java/ru/kontur/vostok/hercules/tracing/api/Source.java @@ -0,0 +1,9 @@ +package ru.kontur.vostok.hercules.tracing.api; + +/** + * @author Gregory Koshelev + */ +public enum Source { + CASSANDRA, + CLICKHOUSE; +} diff --git a/hercules-tracing-api/src/main/java/ru/kontur/hercules/tracing/api/TracingApiApplication.java b/hercules-tracing-api/src/main/java/ru/kontur/vostok/hercules/tracing/api/TracingApiApplication.java similarity index 75% rename from hercules-tracing-api/src/main/java/ru/kontur/hercules/tracing/api/TracingApiApplication.java rename to hercules-tracing-api/src/main/java/ru/kontur/vostok/hercules/tracing/api/TracingApiApplication.java index 8ce492003..4f6dedf37 100644 --- a/hercules-tracing-api/src/main/java/ru/kontur/hercules/tracing/api/TracingApiApplication.java +++ b/hercules-tracing-api/src/main/java/ru/kontur/vostok/hercules/tracing/api/TracingApiApplication.java @@ -1,36 +1,32 @@ -package ru.kontur.hercules.tracing.api; +package ru.kontur.vostok.hercules.tracing.api; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import ru.kontur.vostok.hercules.application.Application; -import ru.kontur.vostok.hercules.cassandra.util.CassandraConnector; import ru.kontur.vostok.hercules.configuration.PropertiesLoader; import ru.kontur.vostok.hercules.configuration.Scopes; import ru.kontur.vostok.hercules.configuration.util.ArgsParser; +import ru.kontur.vostok.hercules.health.CommonMetrics; +import ru.kontur.vostok.hercules.health.MetricsCollector; import ru.kontur.vostok.hercules.http.HttpServer; import ru.kontur.vostok.hercules.http.handler.RouteHandler; import ru.kontur.vostok.hercules.undertow.util.UndertowHttpServer; import ru.kontur.vostok.hercules.undertow.util.handlers.InstrumentedRouteHandlerBuilder; import ru.kontur.vostok.hercules.util.properties.PropertiesUtil; -import ru.kontur.vostok.hercules.curator.CuratorClient; -import ru.kontur.vostok.hercules.health.CommonMetrics; -import ru.kontur.vostok.hercules.health.MetricsCollector; import java.util.Map; import java.util.Properties; import java.util.concurrent.TimeUnit; /** - * TracingApiApplication + * Tracing API Application * - * @author Kirill Sulim + * @author Gregory Koshelev */ public class TracingApiApplication { private static final Logger LOGGER = LoggerFactory.getLogger(TracingApiApplication.class); - private static CuratorClient curatorClient; private static MetricsCollector metricsCollector; - private static CassandraConnector cassandraConnector; private static TracingReader tracingReader; private static HttpServer server; @@ -44,23 +40,15 @@ public static void main(String[] args) { Properties properties = PropertiesLoader.load(parameters.getOrDefault("application.properties", "file://application.properties")); - Properties curatorProperties = PropertiesUtil.ofScope(properties, Scopes.CURATOR); Properties metricsProperties = PropertiesUtil.ofScope(properties, Scopes.METRICS); - Properties cassandraProperties = PropertiesUtil.ofScope(properties, Scopes.CASSANDRA); Properties httpServerProperties = PropertiesUtil.ofScope(properties, Scopes.HTTP_SERVER); - - curatorClient = new CuratorClient(curatorProperties); - curatorClient.start(); - + Properties readerProperties = PropertiesUtil.ofScope(properties, "reader"); metricsCollector = new MetricsCollector(metricsProperties); metricsCollector.start(); CommonMetrics.registerCommonMetrics(metricsCollector); - cassandraConnector = new CassandraConnector(cassandraProperties); - cassandraConnector.connect(); - - tracingReader = new TracingReader(cassandraConnector); + tracingReader = TracingReader.createTracingReader(readerProperties); server = createHttpServer(httpServerProperties); server.start(); @@ -88,11 +76,11 @@ private static void shutdown() { } try { - if (cassandraConnector != null) { - cassandraConnector.close(); + if (tracingReader != null) { + tracingReader.close(); } } catch (Throwable t) { - LOGGER.error("Error on stopping cassandra connector", t); + LOGGER.error("Error on stopping tracing reader", t); //TODO: Process error } @@ -105,15 +93,6 @@ private static void shutdown() { //TODO: Process error } - try { - if (curatorClient != null) { - curatorClient.stop(); - } - } catch (Throwable t) { - LOGGER.error("Error on stopping curator client", t); - //TODO: Process error - } - LOGGER.info("Finished Tracing API shutdown for {} millis", System.currentTimeMillis() - start); } diff --git a/hercules-tracing-api/src/main/java/ru/kontur/vostok/hercules/tracing/api/TracingReader.java b/hercules-tracing-api/src/main/java/ru/kontur/vostok/hercules/tracing/api/TracingReader.java new file mode 100644 index 000000000..58aae4720 --- /dev/null +++ b/hercules-tracing-api/src/main/java/ru/kontur/vostok/hercules/tracing/api/TracingReader.java @@ -0,0 +1,67 @@ +package ru.kontur.vostok.hercules.tracing.api; + +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import ru.kontur.vostok.hercules.protocol.Event; +import ru.kontur.vostok.hercules.tracing.api.cassandra.CassandraTracingReader; +import ru.kontur.vostok.hercules.tracing.api.clickhouse.ClickHouseTracingReader; +import ru.kontur.vostok.hercules.util.parameter.Parameter; +import ru.kontur.vostok.hercules.util.properties.PropertiesUtil; + +import java.util.Properties; +import java.util.UUID; + +/** + * @author Gregory Koshelev + */ +public interface TracingReader { + /** + * Get trace spans by trace id. + * + * @param traceId trace id + * @param limit max count of fetched spans + * @param pagingState page state returned in previous fetch or {@code null} on first fetch + * @return page of trace spans + */ + Page getTraceSpansByTraceId( + @NotNull UUID traceId, + int limit, + @Nullable String pagingState); + + /** + * Get trace spans by trace id and parent span id. + * + * @param traceId trace id + * @param parentSpanId parent span id + * @param limit max count of fetched spans + * @param pagingState page state returned in previous fetch or {@code null} on first fetch + * @return page of trace spans + */ + Page getTraceSpansByTraceIdAndParentSpanId( + @NotNull UUID traceId, + @NotNull UUID parentSpanId, + int limit, + @Nullable String pagingState); + + void close(); + + static TracingReader createTracingReader(Properties properties) { + Source source = PropertiesUtil.get(Props.SOURCE, properties).get(); + + switch (source) { + case CASSANDRA: + return new CassandraTracingReader(properties); + case CLICKHOUSE: + return new ClickHouseTracingReader(properties); + default: + throw new IllegalArgumentException("Unknown source " + source); + } + } + + class Props { + static final Parameter SOURCE = + Parameter.enumParameter("source", Source.class). + withDefault(Source.CASSANDRA). + build(); + } +} diff --git a/hercules-tracing-api/src/main/java/ru/kontur/hercules/tracing/api/TracingReader.java b/hercules-tracing-api/src/main/java/ru/kontur/vostok/hercules/tracing/api/cassandra/CassandraTracingReader.java similarity index 68% rename from hercules-tracing-api/src/main/java/ru/kontur/hercules/tracing/api/TracingReader.java rename to hercules-tracing-api/src/main/java/ru/kontur/vostok/hercules/tracing/api/cassandra/CassandraTracingReader.java index 331dad45b..36f530592 100644 --- a/hercules-tracing-api/src/main/java/ru/kontur/hercules/tracing/api/TracingReader.java +++ b/hercules-tracing-api/src/main/java/ru/kontur/vostok/hercules/tracing/api/cassandra/CassandraTracingReader.java @@ -1,4 +1,4 @@ -package ru.kontur.hercules.tracing.api; +package ru.kontur.vostok.hercules.tracing.api.cassandra; import com.datastax.oss.driver.api.core.CqlSession; import com.datastax.oss.driver.api.core.cql.BoundStatementBuilder; @@ -7,22 +7,27 @@ import com.datastax.oss.driver.api.core.cql.Row; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import ru.kontur.hercules.tracing.api.cassandra.PagedResult; import ru.kontur.vostok.hercules.cassandra.util.CassandraConnector; +import ru.kontur.vostok.hercules.configuration.Scopes; import ru.kontur.vostok.hercules.protocol.Event; import ru.kontur.vostok.hercules.protocol.decoder.Decoder; import ru.kontur.vostok.hercules.protocol.decoder.EventReader; +import ru.kontur.vostok.hercules.tracing.api.Page; +import ru.kontur.vostok.hercules.tracing.api.TracingReader; import ru.kontur.vostok.hercules.util.bytes.ByteUtil; +import ru.kontur.vostok.hercules.util.parameter.Parameter; +import ru.kontur.vostok.hercules.util.properties.PropertiesUtil; import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.List; +import java.util.Properties; import java.util.UUID; /** * @author Gregory Koshelev */ -public class TracingReader { +public class CassandraTracingReader implements TracingReader { private static final EventReader EVENT_READER = EventReader.readAllTags(); private final CassandraConnector cassandraConnector; @@ -30,36 +35,41 @@ public class TracingReader { private final PreparedStatement selectTraceSpansByTraceIdQuery; private final PreparedStatement selectTraceSpansByTraceIdAndParentSpanIdQuery; - public TracingReader(CassandraConnector cassandraConnector) { - this.cassandraConnector = cassandraConnector; + public CassandraTracingReader(Properties properties) { + Properties cassandraProperties = PropertiesUtil.ofScope(properties, Scopes.CASSANDRA); + + this.cassandraConnector = new CassandraConnector(cassandraProperties); this.session = cassandraConnector.session(); + String table = PropertiesUtil.get(Props.TABLE, properties).get(); + this.selectTraceSpansByTraceIdQuery = session.prepare( "SELECT payload" + - " FROM tracing_spans" + + " FROM " + table + " WHERE trace_id = ?"); this.selectTraceSpansByTraceIdAndParentSpanIdQuery = session.prepare( "SELECT payload" + - " FROM tracing_spans" + + " FROM " + table + " WHERE trace_id = ? AND parent_span_id = ?"); } /** * Get trace spans by trace id * - * @param traceId trace id - * @param limit max count of fetched events - * @param pagingStateString page state returned in previous fetch or null on first fetch + * @param traceId trace id + * @param limit max count of fetched events + * @param pagingState page state returned in previous fetch or null on first fetch * @return list of events */ - public PagedResult getTraceSpansByTraceId( + @Override + public Page getTraceSpansByTraceId( @NotNull final UUID traceId, final int limit, - @Nullable final String pagingStateString) { + @Nullable final String pagingState) { return select( selectTraceSpansByTraceIdQuery, limit, - pagingStateString, + pagingState, traceId ); } @@ -67,26 +77,32 @@ public PagedResult getTraceSpansByTraceId( /** * Get trace spans by span id and parent span id * - * @param traceId trace id - * @param parentSpanId parent span id - * @param limit max count of fetched events - * @param pagingStateString page state returned in previous fetch or null on first fetch + * @param traceId trace id + * @param parentSpanId parent span id + * @param limit max count of fetched events + * @param pagingState page state returned in previous fetch or null on first fetch * @return list of events */ - public PagedResult getTraceSpansByTraceIdAndParentSpanId( + @Override + public Page getTraceSpansByTraceIdAndParentSpanId( @NotNull final UUID traceId, @NotNull final UUID parentSpanId, final int limit, - @Nullable final String pagingStateString) { + @Nullable final String pagingState) { return select( selectTraceSpansByTraceIdAndParentSpanIdQuery, limit, - pagingStateString, + pagingState, traceId, parentSpanId); } - private PagedResult select( + @Override + public void close() { + cassandraConnector.close(); + } + + private Page select( @NotNull final PreparedStatement selectQuery, final int limit, @Nullable final String pagingStateString, @@ -125,7 +141,7 @@ private PagedResult select( final ByteBuffer pagingState = resultSet.getExecutionInfo().getPagingState(); - return new PagedResult<>( + return new Page<>( events, pagingState != null ? ByteUtil.toHexString(pagingState) : null); } @@ -134,4 +150,11 @@ private static Event convert(final Row row) { final ByteBuffer payload = row.getByteBuffer(0); return EVENT_READER.read(new Decoder(payload)); } + + private static class Props { + static Parameter TABLE = + Parameter.stringParameter("table"). + withDefault("tracing_spans"). + build(); + } } diff --git a/hercules-tracing-api/src/main/java/ru/kontur/vostok/hercules/tracing/api/clickhouse/ClickHouseTracingReader.java b/hercules-tracing-api/src/main/java/ru/kontur/vostok/hercules/tracing/api/clickhouse/ClickHouseTracingReader.java new file mode 100644 index 000000000..a00b10968 --- /dev/null +++ b/hercules-tracing-api/src/main/java/ru/kontur/vostok/hercules/tracing/api/clickhouse/ClickHouseTracingReader.java @@ -0,0 +1,121 @@ +package ru.kontur.vostok.hercules.tracing.api.clickhouse; + +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import ru.kontur.vostok.hercules.clickhouse.util.ClickHouseConnector; +import ru.kontur.vostok.hercules.configuration.Scopes; +import ru.kontur.vostok.hercules.protocol.Event; +import ru.kontur.vostok.hercules.protocol.decoder.Decoder; +import ru.kontur.vostok.hercules.protocol.decoder.EventReader; +import ru.kontur.vostok.hercules.tracing.api.Page; +import ru.kontur.vostok.hercules.tracing.api.TracingReader; +import ru.kontur.vostok.hercules.util.parameter.Parameter; +import ru.kontur.vostok.hercules.util.properties.PropertiesUtil; +import ru.kontur.vostok.hercules.util.text.StringUtil; + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; +import java.util.Properties; +import java.util.UUID; + +/** + * @author Gregory Koshelev + */ +public class ClickHouseTracingReader implements TracingReader { + private static final Logger LOGGER = LoggerFactory.getLogger(ClickHouseTracingReader.class); + + private static final EventReader EVENT_READER = EventReader.readAllTags(); + + private final ClickHouseConnector connector; + private final String selectByTraceIdQuery; + private final String selectByTraceIdAndParentSpanIdQuery; + + public ClickHouseTracingReader(Properties properties) { + Properties clickHouseProperties = PropertiesUtil.ofScope(properties, Scopes.CLICKHOUSE); + + this.connector = new ClickHouseConnector(clickHouseProperties); + + String table = PropertiesUtil.get(Props.TABLE, properties).get(); + + this.selectByTraceIdQuery = "SELECT payload" + + " FROM " + table + + " WHERE trace_id = ?" + + " ORDER BY span_id" + + " LIMIT ? OFFSET ?"; + this.selectByTraceIdAndParentSpanIdQuery = "SELECT payload" + + " FROM " + table + + " WHERE trace_id = ? AND parent_span_id = ?" + + " ORDER BY span_id" + + " LIMIT ? OFFSET ?"; + } + + @Override + public Page getTraceSpansByTraceId(@NotNull UUID traceId, int limit, @Nullable String pagingState) { + long offset = pagingStateToOffset(pagingState); + return select(selectByTraceIdQuery, limit, offset, traceId, limit, offset); + } + + @Override + public Page getTraceSpansByTraceIdAndParentSpanId(@NotNull UUID traceId, @NotNull UUID parentSpanId, int limit, @Nullable String pagingState) { + long offset = pagingStateToOffset(pagingState); + return select(selectByTraceIdAndParentSpanIdQuery, limit, offset, traceId, parentSpanId, limit, offset); + } + @Override + public void close() { + connector.close(); + } + + private Page select(String sql, int limit, long offset, Object... params) { + Optional connection = connector.connection(); + try (PreparedStatement select = connection.orElseThrow(IllegalStateException::new).prepareStatement(sql)) { + for (int i = 0; i < params.length; i++) { + select.setObject(i + 1, params[i]); + } + ResultSet resultSet = select.executeQuery(); + int rowCounter = 0; + List events = new ArrayList(limit); + while (resultSet.next()) { + events.add(convert(resultSet.getBytes(1))); + rowCounter++; + } + return new Page<>(events, offsetToPagingState(offset + rowCounter)); + } catch (SQLException ex) { + //TODO: Process SQL Exception + LOGGER.error("Read failed with exception", ex); + throw new RuntimeException(ex); + } + } + + private static long pagingStateToOffset(@Nullable String pagingState) { + if (StringUtil.isNullOrEmpty(pagingState)) { + return 0; + } + try { + return Long.parseLong(pagingState); + } catch (NumberFormatException ex) { + return 0; + } + } + + private static String offsetToPagingState(long offset) { + return String.valueOf(offset); + } + + private static Event convert(byte[] payload) { + return EVENT_READER.read(new Decoder(payload)); + } + + private static class Props { + static Parameter TABLE = + Parameter.stringParameter("table"). + withDefault("tracing_spans"). + build(); + } +} diff --git a/hercules-tracing-api/src/main/java/ru/kontur/hercules/tracing/api/json/EventToJsonConverter.java b/hercules-tracing-api/src/main/java/ru/kontur/vostok/hercules/tracing/api/json/EventToJsonConverter.java similarity index 74% rename from hercules-tracing-api/src/main/java/ru/kontur/hercules/tracing/api/json/EventToJsonConverter.java rename to hercules-tracing-api/src/main/java/ru/kontur/vostok/hercules/tracing/api/json/EventToJsonConverter.java index a177cb306..9a0386fbd 100644 --- a/hercules-tracing-api/src/main/java/ru/kontur/hercules/tracing/api/json/EventToJsonConverter.java +++ b/hercules-tracing-api/src/main/java/ru/kontur/vostok/hercules/tracing/api/json/EventToJsonConverter.java @@ -1,8 +1,8 @@ -package ru.kontur.hercules.tracing.api.json; +package ru.kontur.vostok.hercules.tracing.api.json; import com.fasterxml.jackson.core.JsonFactory; import com.fasterxml.jackson.core.JsonGenerator; -import ru.kontur.hercules.tracing.api.cassandra.PagedResult; +import ru.kontur.vostok.hercules.tracing.api.Page; import ru.kontur.vostok.hercules.json.EventToJsonWriter; import ru.kontur.vostok.hercules.protocol.Event; @@ -20,12 +20,12 @@ public final class EventToJsonConverter { private static final JsonFactory FACTORY = new JsonFactory(); - public static String pagedResultAsString(final PagedResult pagedResult) { + public static String pagedResultAsString(final Page page) { try ( final StringWriter writer = new StringWriter(); final JsonGenerator jsonGenerator = FACTORY.createGenerator(writer) ) { - writePagedResult(jsonGenerator, pagedResult); + writePagedResult(jsonGenerator, page); jsonGenerator.flush(); writer.flush(); return writer.toString(); @@ -34,13 +34,13 @@ public static String pagedResultAsString(final PagedResult pagedResult) { } } - public static void writePagedResult(final JsonGenerator jsonGenerator, final PagedResult pagedResult) throws IOException { + public static void writePagedResult(final JsonGenerator jsonGenerator, final Page page) throws IOException { jsonGenerator.writeStartObject(); - if (Objects.nonNull(pagedResult.getPagingState())) { - jsonGenerator.writeStringField("pagingState", pagedResult.getPagingState()); + if (Objects.nonNull(page.state())) { + jsonGenerator.writeStringField("pagingState", page.state()); } jsonGenerator.writeFieldName("result"); - writeEventCollection(jsonGenerator, pagedResult.getResult()); + writeEventCollection(jsonGenerator, page.elements()); jsonGenerator.writeEndObject(); } From 248b75edc3006ea52920df6203e76273f1095f5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A6=D1=8B=D0=BF=D0=B0=D0=B5=D0=B2=20=D0=92=D0=BB=D0=B0?= =?UTF-8?q?=D0=B4=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9D=D0=B8=D0=BA=D0=BE=D0=BB?= =?UTF-8?q?=D0=B0=D0=B5=D0=B2=D0=B8=D1=87?= Date: Fri, 21 Feb 2020 13:00:47 +0500 Subject: [PATCH 2/6] Resolve "Add max.event.size property for gate" --- hercules-gate/README.md | 6 +++++ hercules-gate/application.properties | 2 ++ .../vostok/hercules/gate/GateApplication.java | 16 +++++++----- .../hercules/gate/SendRequestProcessor.java | 9 ++++--- .../gate/validation/EventValidator.java | 25 +++++++++++++++++++ 5 files changed, 48 insertions(+), 10 deletions(-) diff --git a/hercules-gate/README.md b/hercules-gate/README.md index 7a6f7228d..b27d080b2 100644 --- a/hercules-gate/README.md +++ b/hercules-gate/README.md @@ -141,6 +141,10 @@ HTTP Server binds on host:port are defined in Main Application settings. `http.server.throttling.requestTimeout` - timeout for request, which capacity throttling more then permissible, default value: `5000` +### Validation settings + +`validation.max.event.size` - max size of Hercules event, value must be consistent with broker setting `max.message.bytes`, default value: `500000` + ### Kafka Producer settings See Producer's Config from Apache Kafka documentation. Main settings are presented below. @@ -218,6 +222,8 @@ http.server.connection.threshold=100000 http.server.throttling.capacity=1073741824 http.server.throttling.requestTimeout=10000 +validation.max.event.size=500000 + producer.bootstrap.servers=localhost:9092 producer.acks=all producer.batch.size=65536 diff --git a/hercules-gate/application.properties b/hercules-gate/application.properties index 3b5684f94..96529fa40 100644 --- a/hercules-gate/application.properties +++ b/hercules-gate/application.properties @@ -6,6 +6,8 @@ http.server.connection.threshold=100000 http.server.throttling.capacity=1073741824 http.server.throttling.requestTimeout=10000 +validation.max.event.size=500000 + producer.bootstrap.servers=localhost:9092 producer.acks=all producer.batch.size=65536 diff --git a/hercules-gate/src/main/java/ru/kontur/vostok/hercules/gate/GateApplication.java b/hercules-gate/src/main/java/ru/kontur/vostok/hercules/gate/GateApplication.java index d6c1dbd7c..e70bbf220 100644 --- a/hercules-gate/src/main/java/ru/kontur/vostok/hercules/gate/GateApplication.java +++ b/hercules-gate/src/main/java/ru/kontur/vostok/hercules/gate/GateApplication.java @@ -11,6 +11,7 @@ import ru.kontur.vostok.hercules.configuration.Scopes; import ru.kontur.vostok.hercules.configuration.util.ArgsParser; import ru.kontur.vostok.hercules.curator.CuratorClient; +import ru.kontur.vostok.hercules.gate.validation.EventValidator; import ru.kontur.vostok.hercules.health.CommonMetrics; import ru.kontur.vostok.hercules.health.MetricsCollector; import ru.kontur.vostok.hercules.http.HttpServer; @@ -45,6 +46,7 @@ public class GateApplication { private static MetricsCollector metricsCollector; private static HttpServer server; private static EventSender eventSender; + private static EventValidator eventValidator; private static CuratorClient curatorClient; private static AuthManager authManager; private static AuthValidationManager authValidationManager; @@ -65,12 +67,14 @@ public static void main(String[] args) { Properties curatorProperties = PropertiesUtil.ofScope(properties, Scopes.CURATOR); Properties metricsProperties = PropertiesUtil.ofScope(properties, Scopes.METRICS); Properties sdProperties = PropertiesUtil.ofScope(properties, Scopes.SERVICE_DISCOVERY); + Properties validationProperties = PropertiesUtil.ofScope(properties, "validation"); metricsCollector = new MetricsCollector(metricsProperties); metricsCollector.start(); CommonMetrics.registerCommonMetrics(metricsCollector); eventSender = new EventSender(producerProperties, new HashPartitioner(new NaiveHasher()), metricsCollector); + eventValidator = new EventValidator(validationProperties); curatorClient = new CuratorClient(curatorProperties); curatorClient.start(); @@ -164,13 +168,13 @@ private static void shutdown() { LOGGER.info("Finished Gateway shutdown for {} millis", System.currentTimeMillis() - start); } - private static HttpServer createHttpServer(Properties httpServerProperies) { + private static HttpServer createHttpServer(Properties httpServerProperties) { StreamRepository streamRepository = new StreamRepository(curatorClient); StreamStorage streamStorage = new StreamStorage(streamRepository, 30_000L /* TODO: for test usages; It should be moved to configuration */); - Properties throttlingProperties = PropertiesUtil.ofScope(httpServerProperies, Scopes.THROTTLING); + Properties throttlingProperties = PropertiesUtil.ofScope(httpServerProperties, Scopes.THROTTLING); - SendRequestProcessor sendRequestProcessor = new SendRequestProcessor(eventSender, metricsCollector); + SendRequestProcessor sendRequestProcessor = new SendRequestProcessor(eventSender, eventValidator, metricsCollector); CapacityThrottle throttle = new CapacityThrottle<>( throttlingProperties, new DefaultHttpServerRequestWeigher(), @@ -180,7 +184,7 @@ private static HttpServer createHttpServer(Properties httpServerProperies) { metricsCollector.gauge("throttling.totalCapacity", throttle::totalCapacity); metricsCollector.gauge("throttling.availableCapacity", throttle::availableCapacity); - long maxContentLength = PropertiesUtil.get(HttpServer.Props.MAX_CONTENT_LENGTH, httpServerProperies).get(); + long maxContentLength = PropertiesUtil.get(HttpServer.Props.MAX_CONTENT_LENGTH, httpServerProperties).get(); AuthProvider authProvider = new AuthProvider(new AdminAuthManager(Collections.emptySet()), authManager); HandlerWrapper authHandlerWrapper = new OrdinaryAuthHandlerWrapper(authProvider); @@ -190,7 +194,7 @@ private static HttpServer createHttpServer(Properties httpServerProperies) { HttpHandler sendHandler = authHandlerWrapper.wrap( new GateHandler(authProvider, throttle, authValidationManager, streamStorage, false, maxContentLength, metricsCollector)); - RouteHandler handler = new InstrumentedRouteHandlerBuilder(httpServerProperies, metricsCollector). + RouteHandler handler = new InstrumentedRouteHandlerBuilder(httpServerProperties, metricsCollector). post("/stream/sendAsync", sendAsyncHandler). post("/stream/send", sendHandler). build(); @@ -198,7 +202,7 @@ private static HttpServer createHttpServer(Properties httpServerProperies) { return new UndertowHttpServer( Application.application().getConfig().getHost(), Application.application().getConfig().getPort(), - httpServerProperies, + httpServerProperties, handler); } } diff --git a/hercules-gate/src/main/java/ru/kontur/vostok/hercules/gate/SendRequestProcessor.java b/hercules-gate/src/main/java/ru/kontur/vostok/hercules/gate/SendRequestProcessor.java index a8c257d92..3007701e8 100644 --- a/hercules-gate/src/main/java/ru/kontur/vostok/hercules/gate/SendRequestProcessor.java +++ b/hercules-gate/src/main/java/ru/kontur/vostok/hercules/gate/SendRequestProcessor.java @@ -48,19 +48,20 @@ public class SendRequestProcessor implements RequestProcessor maxEventSize) { + LOGGER.warn("Event size = {} bytes, more then limit = {}", eventSize, maxEventSize); + return false; + } + return true; } + + private static class Props { + static final Parameter MAX_EVENT_SIZE = + Parameter.integerParameter("max.event.size"). + withValidator(IntegerValidators.positive()). + withDefault(500_000). + build(); + } } From 200e524f71dfbac2a73f804a28a91c11ff9f5524 Mon Sep 17 00:00:00 2001 From: gnkoshelev Date: Wed, 26 Feb 2020 15:56:28 +0500 Subject: [PATCH 3/6] Code and docs clean up --- hercules-tracing-api/README.md | 22 ------------------- hercules-tracing-api/application.properties | 7 ------ .../hercules/tracing/api/GetTraceHandler.java | 3 +-- .../api/cassandra/CassandraTracingReader.java | 9 ++++---- .../clickhouse/ClickHouseTracingReader.java | 2 +- 5 files changed, 7 insertions(+), 36 deletions(-) diff --git a/hercules-tracing-api/README.md b/hercules-tracing-api/README.md index 693e5cf7d..bd683bb4f 100644 --- a/hercules-tracing-api/README.md +++ b/hercules-tracing-api/README.md @@ -121,21 +121,6 @@ Application is configured through properties file. `context.instance.id` - id of instance -### Apache Curator settings -See Curator Config from Apache Curator documentation. Main settings are presented below. - -`curator.connectString` - default value: `localhost:2181` - -`curator.connectionTimeout` - default value: `10000` - -`curator.sessionTimeout` - default value: `30000` - -`curator.retryPolicy.baseSleepTime` - default value: `1000` - -`curator.retryPolicy.maxRetries` - default value: `5` - -`curator.retryPolicy.maxSleepTime` - default value: `8000` - ### Graphite metrics reporter settings `metrics.graphite.server.addr` - hostname of graphite instance to which metrics are sent, default value: `localhost` @@ -208,13 +193,6 @@ context.environment=dev context.zone=default context.instance.id=1 -curator.connectString=localhost:2181 -curator.connectionTimeout=10000 -curator.sessionTimeout=30000 -curator.retryPolicy.baseSleepTime=1000 -curator.retryPolicy.maxRetries=5 -curator.retryPolicy.maxSleepTime=8000 - metrics.graphite.server.addr=localhost metrics.graphite.server.port=2003 metrics.graphite.prefix=hercules diff --git a/hercules-tracing-api/application.properties b/hercules-tracing-api/application.properties index 58fbdea02..11ea5216a 100644 --- a/hercules-tracing-api/application.properties +++ b/hercules-tracing-api/application.properties @@ -5,13 +5,6 @@ context.environment=dev context.zone=default context.instance.id=1 -curator.connectString=localhost:2181 -curator.connectionTimeout=10000 -curator.sessionTimeout=30000 -curator.retryPolicy.baseSleepTime=1000 -curator.retryPolicy.maxRetries=5 -curator.retryPolicy.maxSleepTime=8000 - metrics.graphite.server.addr=localhost metrics.graphite.server.port=2003 metrics.graphite.prefix=hercules diff --git a/hercules-tracing-api/src/main/java/ru/kontur/vostok/hercules/tracing/api/GetTraceHandler.java b/hercules-tracing-api/src/main/java/ru/kontur/vostok/hercules/tracing/api/GetTraceHandler.java index 437cfc00a..bfb1ac793 100644 --- a/hercules-tracing-api/src/main/java/ru/kontur/vostok/hercules/tracing/api/GetTraceHandler.java +++ b/hercules-tracing-api/src/main/java/ru/kontur/vostok/hercules/tracing/api/GetTraceHandler.java @@ -1,13 +1,12 @@ package ru.kontur.vostok.hercules.tracing.api; -import ru.kontur.vostok.hercules.tracing.api.cassandra.CassandraTracingReader; -import ru.kontur.vostok.hercules.tracing.api.json.EventToJsonConverter; import ru.kontur.vostok.hercules.http.HttpServerRequest; import ru.kontur.vostok.hercules.http.HttpStatusCodes; import ru.kontur.vostok.hercules.http.MimeTypes; import ru.kontur.vostok.hercules.http.handler.HttpHandler; import ru.kontur.vostok.hercules.http.query.QueryUtil; import ru.kontur.vostok.hercules.protocol.Event; +import ru.kontur.vostok.hercules.tracing.api.json.EventToJsonConverter; import ru.kontur.vostok.hercules.util.parameter.ParameterValue; import java.util.UUID; diff --git a/hercules-tracing-api/src/main/java/ru/kontur/vostok/hercules/tracing/api/cassandra/CassandraTracingReader.java b/hercules-tracing-api/src/main/java/ru/kontur/vostok/hercules/tracing/api/cassandra/CassandraTracingReader.java index 36f530592..694431f98 100644 --- a/hercules-tracing-api/src/main/java/ru/kontur/vostok/hercules/tracing/api/cassandra/CassandraTracingReader.java +++ b/hercules-tracing-api/src/main/java/ru/kontur/vostok/hercules/tracing/api/cassandra/CassandraTracingReader.java @@ -30,16 +30,17 @@ public class CassandraTracingReader implements TracingReader { private static final EventReader EVENT_READER = EventReader.readAllTags(); - private final CassandraConnector cassandraConnector; + private final CassandraConnector connector; private final CqlSession session; + private final PreparedStatement selectTraceSpansByTraceIdQuery; private final PreparedStatement selectTraceSpansByTraceIdAndParentSpanIdQuery; public CassandraTracingReader(Properties properties) { Properties cassandraProperties = PropertiesUtil.ofScope(properties, Scopes.CASSANDRA); - this.cassandraConnector = new CassandraConnector(cassandraProperties); - this.session = cassandraConnector.session(); + this.connector = new CassandraConnector(cassandraProperties); + this.session = connector.session(); String table = PropertiesUtil.get(Props.TABLE, properties).get(); @@ -99,7 +100,7 @@ public Page getTraceSpansByTraceIdAndParentSpanId( @Override public void close() { - cassandraConnector.close(); + connector.close(); } private Page select( diff --git a/hercules-tracing-api/src/main/java/ru/kontur/vostok/hercules/tracing/api/clickhouse/ClickHouseTracingReader.java b/hercules-tracing-api/src/main/java/ru/kontur/vostok/hercules/tracing/api/clickhouse/ClickHouseTracingReader.java index a00b10968..34f702a24 100644 --- a/hercules-tracing-api/src/main/java/ru/kontur/vostok/hercules/tracing/api/clickhouse/ClickHouseTracingReader.java +++ b/hercules-tracing-api/src/main/java/ru/kontur/vostok/hercules/tracing/api/clickhouse/ClickHouseTracingReader.java @@ -80,7 +80,7 @@ private Page select(String sql, int limit, long offset, Object... params) } ResultSet resultSet = select.executeQuery(); int rowCounter = 0; - List events = new ArrayList(limit); + List events = new ArrayList<>(limit); while (resultSet.next()) { events.add(convert(resultSet.getBytes(1))); rowCounter++; From ce4faedab6b03a0c1718a316c849eb053414df39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9A=D0=BE=D1=88=D0=B5=D0=BB=D0=B5=D0=B2=20=D0=93=D1=80?= =?UTF-8?q?=D0=B8=D0=B3=D0=BE=D1=80=D0=B8=D0=B9=20=D0=9D=D0=B8=D0=BA=D0=BE?= =?UTF-8?q?=D0=BB=D0=B0=D0=B5=D0=B2=D0=B8=D1=87?= Date: Wed, 26 Feb 2020 17:31:43 +0500 Subject: [PATCH 4/6] Remove public method CassandraConnector.connect() to simplify CassandraConnector usage; Thus, CassandraConnector should be initialized in constructor (see private method init) --- .../vostok/hercules/cassandra/sink/CassandraSender.java | 2 -- .../vostok/hercules/cassandra/util/CassandraConnector.java | 4 +++- .../vostok/hercules/timeline/api/TimelineApiApplication.java | 1 - .../hercules/timeline/manager/TimelineManagerApplication.java | 1 - 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/hercules-cassandra-sink/src/main/java/ru/kontur/vostok/hercules/cassandra/sink/CassandraSender.java b/hercules-cassandra-sink/src/main/java/ru/kontur/vostok/hercules/cassandra/sink/CassandraSender.java index d8f9b040e..a4bafe3b1 100644 --- a/hercules-cassandra-sink/src/main/java/ru/kontur/vostok/hercules/cassandra/sink/CassandraSender.java +++ b/hercules-cassandra-sink/src/main/java/ru/kontur/vostok/hercules/cassandra/sink/CassandraSender.java @@ -75,8 +75,6 @@ public CassandraSender(Properties properties, MetricsCollector metricsCollector) @Override public void start() { - cassandraConnector.connect(); - CqlSession session = cassandraConnector.session(); preparedStatement = session.prepare(query()); diff --git a/hercules-cassandra-util/src/main/java/ru/kontur/vostok/hercules/cassandra/util/CassandraConnector.java b/hercules-cassandra-util/src/main/java/ru/kontur/vostok/hercules/cassandra/util/CassandraConnector.java index 8a8701cdc..0802b13b0 100644 --- a/hercules-cassandra-util/src/main/java/ru/kontur/vostok/hercules/cassandra/util/CassandraConnector.java +++ b/hercules-cassandra-util/src/main/java/ru/kontur/vostok/hercules/cassandra/util/CassandraConnector.java @@ -67,9 +67,11 @@ public CassandraConnector(Properties properties) { this.consistencyLevel = PropertiesUtil.get(Props.CONSISTENCY_LEVEL, properties).get(); this.batchSizeBytesLimit = PropertiesUtil.get(Props.BATCH_SIZE_BYTES_LIMIT, properties).get(); + + init(); } - public void connect() { + private void init() { DriverConfigLoader configLoader = DriverConfigLoader.programmaticBuilder(). withDuration(DefaultDriverOption.REQUEST_TIMEOUT, Duration.ofMillis(requestTimeoutMs)). withString(DefaultDriverOption.REQUEST_CONSISTENCY, consistencyLevel). diff --git a/hercules-timeline-api/src/main/java/ru/kontur/vostok/hercules/timeline/api/TimelineApiApplication.java b/hercules-timeline-api/src/main/java/ru/kontur/vostok/hercules/timeline/api/TimelineApiApplication.java index b63fcb396..838c40e21 100644 --- a/hercules-timeline-api/src/main/java/ru/kontur/vostok/hercules/timeline/api/TimelineApiApplication.java +++ b/hercules-timeline-api/src/main/java/ru/kontur/vostok/hercules/timeline/api/TimelineApiApplication.java @@ -65,7 +65,6 @@ public static void main(String[] args) { authManager.start(); cassandraConnector = new CassandraConnector(cassandraProperties); - cassandraConnector.connect(); timelineReader = new TimelineReader( PropertiesUtil.ofScope(properties, "timeline.api.reader"), diff --git a/hercules-timeline-manager/src/main/java/ru/kontur/vostok/hercules/timeline/manager/TimelineManagerApplication.java b/hercules-timeline-manager/src/main/java/ru/kontur/vostok/hercules/timeline/manager/TimelineManagerApplication.java index f5cb8b59c..a70599fce 100644 --- a/hercules-timeline-manager/src/main/java/ru/kontur/vostok/hercules/timeline/manager/TimelineManagerApplication.java +++ b/hercules-timeline-manager/src/main/java/ru/kontur/vostok/hercules/timeline/manager/TimelineManagerApplication.java @@ -46,7 +46,6 @@ public static void main(String[] args) { Properties metricsProperties = PropertiesUtil.ofScope(properties, Scopes.METRICS); cassandraConnector = new CassandraConnector(cassandraProperties); - cassandraConnector.connect(); CassandraManager cassandraManager = new CassandraManager(cassandraConnector); From 09dd515f2ddb298ac37ccf070accedce12186716 Mon Sep 17 00:00:00 2001 From: gnkoshelev Date: Wed, 26 Feb 2020 18:42:07 +0500 Subject: [PATCH 5/6] Paging state == null if all data has been read; Also, sort tracing spans by parent_span_id first --- .../tracing/api/clickhouse/ClickHouseTracingReader.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hercules-tracing-api/src/main/java/ru/kontur/vostok/hercules/tracing/api/clickhouse/ClickHouseTracingReader.java b/hercules-tracing-api/src/main/java/ru/kontur/vostok/hercules/tracing/api/clickhouse/ClickHouseTracingReader.java index 34f702a24..78513a0f9 100644 --- a/hercules-tracing-api/src/main/java/ru/kontur/vostok/hercules/tracing/api/clickhouse/ClickHouseTracingReader.java +++ b/hercules-tracing-api/src/main/java/ru/kontur/vostok/hercules/tracing/api/clickhouse/ClickHouseTracingReader.java @@ -47,7 +47,7 @@ public ClickHouseTracingReader(Properties properties) { this.selectByTraceIdQuery = "SELECT payload" + " FROM " + table + " WHERE trace_id = ?" + - " ORDER BY span_id" + + " ORDER BY parent_span_id, span_id" + " LIMIT ? OFFSET ?"; this.selectByTraceIdAndParentSpanIdQuery = "SELECT payload" + " FROM " + table + @@ -85,7 +85,7 @@ private Page select(String sql, int limit, long offset, Object... params) events.add(convert(resultSet.getBytes(1))); rowCounter++; } - return new Page<>(events, offsetToPagingState(offset + rowCounter)); + return new Page<>(events, rowCounter == limit ? offsetToPagingState(offset + limit) : null); } catch (SQLException ex) { //TODO: Process SQL Exception LOGGER.error("Read failed with exception", ex); From caa2ec748d41964916478cf7d2b5bb6495d24195 Mon Sep 17 00:00:00 2001 From: gnkoshelev Date: Thu, 27 Feb 2020 17:50:45 +0500 Subject: [PATCH 6/6] Upgrade version to 0.36.0-SNAPSHOT --- hercules-application/pom.xml | 2 +- hercules-auth/pom.xml | 2 +- hercules-cassandra-sink/pom.xml | 2 +- hercules-cassandra-util/pom.xml | 2 +- hercules-clickhouse-sink/pom.xml | 2 +- hercules-clickhouse-util/pom.xml | 2 +- hercules-client/pom.xml | 2 +- hercules-configuration/pom.xml | 2 +- hercules-curator/pom.xml | 2 +- hercules-elastic-sink/pom.xml | 2 +- hercules-gate-client/pom.xml | 2 +- hercules-gate/pom.xml | 2 +- hercules-graphite-sink/pom.xml | 2 +- hercules-health/pom.xml | 2 +- hercules-http/pom.xml | 2 +- hercules-init/pom.xml | 2 +- hercules-json/pom.xml | 2 +- hercules-kafka-util/pom.xml | 2 +- hercules-management-api/pom.xml | 2 +- hercules-meta/pom.xml | 2 +- hercules-partitioner/pom.xml | 2 +- hercules-protocol/pom.xml | 2 +- hercules-sd/pom.xml | 2 +- hercules-sentry-sink/pom.xml | 2 +- hercules-sink/pom.xml | 2 +- hercules-stream-api/pom.xml | 2 +- hercules-stream-manager/pom.xml | 2 +- hercules-stream-sink/pom.xml | 2 +- hercules-tags/pom.xml | 2 +- hercules-throttling/pom.xml | 2 +- hercules-timeline-api/pom.xml | 2 +- hercules-timeline-manager/pom.xml | 2 +- hercules-timeline-sink/pom.xml | 2 +- hercules-tracing-api/pom.xml | 2 +- hercules-tracing-sink-clickhouse/pom.xml | 2 +- hercules-tracing-sink/pom.xml | 2 +- hercules-undertow-util/pom.xml | 2 +- hercules-util/pom.xml | 2 +- hercules-uuid/pom.xml | 2 +- pom.xml | 4 ++-- 40 files changed, 41 insertions(+), 41 deletions(-) diff --git a/hercules-application/pom.xml b/hercules-application/pom.xml index b07ecf2cc..5bbda33ca 100644 --- a/hercules-application/pom.xml +++ b/hercules-application/pom.xml @@ -5,7 +5,7 @@ hercules ru.kontur.vostok.hercules - 0.35.1-SNAPSHOT + 0.36.0-SNAPSHOT 4.0.0 diff --git a/hercules-auth/pom.xml b/hercules-auth/pom.xml index deeb42383..a6b5ad3f2 100644 --- a/hercules-auth/pom.xml +++ b/hercules-auth/pom.xml @@ -3,7 +3,7 @@ hercules ru.kontur.vostok.hercules - 0.35.1-SNAPSHOT + 0.36.0-SNAPSHOT 4.0.0 diff --git a/hercules-cassandra-sink/pom.xml b/hercules-cassandra-sink/pom.xml index aec2b3253..f55641c73 100644 --- a/hercules-cassandra-sink/pom.xml +++ b/hercules-cassandra-sink/pom.xml @@ -5,7 +5,7 @@ hercules ru.kontur.vostok.hercules - 0.35.1-SNAPSHOT + 0.36.0-SNAPSHOT 4.0.0 diff --git a/hercules-cassandra-util/pom.xml b/hercules-cassandra-util/pom.xml index 6adad3ec0..853269486 100644 --- a/hercules-cassandra-util/pom.xml +++ b/hercules-cassandra-util/pom.xml @@ -3,7 +3,7 @@ hercules ru.kontur.vostok.hercules - 0.35.1-SNAPSHOT + 0.36.0-SNAPSHOT 4.0.0 diff --git a/hercules-clickhouse-sink/pom.xml b/hercules-clickhouse-sink/pom.xml index b41bd868f..5097dc21b 100644 --- a/hercules-clickhouse-sink/pom.xml +++ b/hercules-clickhouse-sink/pom.xml @@ -5,7 +5,7 @@ hercules ru.kontur.vostok.hercules - 0.35.1-SNAPSHOT + 0.36.0-SNAPSHOT 4.0.0 diff --git a/hercules-clickhouse-util/pom.xml b/hercules-clickhouse-util/pom.xml index 34dbf4f3c..d6f1f3c2b 100644 --- a/hercules-clickhouse-util/pom.xml +++ b/hercules-clickhouse-util/pom.xml @@ -5,7 +5,7 @@ hercules ru.kontur.vostok.hercules - 0.35.1-SNAPSHOT + 0.36.0-SNAPSHOT 4.0.0 diff --git a/hercules-client/pom.xml b/hercules-client/pom.xml index 36a8a4929..51f9d985c 100644 --- a/hercules-client/pom.xml +++ b/hercules-client/pom.xml @@ -5,7 +5,7 @@ hercules ru.kontur.vostok.hercules - 0.35.1-SNAPSHOT + 0.36.0-SNAPSHOT 4.0.0 diff --git a/hercules-configuration/pom.xml b/hercules-configuration/pom.xml index 66f8be3dd..b9813fbee 100644 --- a/hercules-configuration/pom.xml +++ b/hercules-configuration/pom.xml @@ -3,7 +3,7 @@ hercules ru.kontur.vostok.hercules - 0.35.1-SNAPSHOT + 0.36.0-SNAPSHOT 4.0.0 diff --git a/hercules-curator/pom.xml b/hercules-curator/pom.xml index 45fd844ea..2cafaf044 100644 --- a/hercules-curator/pom.xml +++ b/hercules-curator/pom.xml @@ -5,7 +5,7 @@ hercules ru.kontur.vostok.hercules - 0.35.1-SNAPSHOT + 0.36.0-SNAPSHOT 4.0.0 diff --git a/hercules-elastic-sink/pom.xml b/hercules-elastic-sink/pom.xml index f468c3aaa..7f6ba9da7 100644 --- a/hercules-elastic-sink/pom.xml +++ b/hercules-elastic-sink/pom.xml @@ -5,7 +5,7 @@ hercules ru.kontur.vostok.hercules - 0.35.1-SNAPSHOT + 0.36.0-SNAPSHOT 4.0.0 diff --git a/hercules-gate-client/pom.xml b/hercules-gate-client/pom.xml index 6693f00ac..546fb6915 100644 --- a/hercules-gate-client/pom.xml +++ b/hercules-gate-client/pom.xml @@ -3,7 +3,7 @@ hercules ru.kontur.vostok.hercules - 0.35.1-SNAPSHOT + 0.36.0-SNAPSHOT 4.0.0 diff --git a/hercules-gate/pom.xml b/hercules-gate/pom.xml index 1e7ebe529..bfa8acec0 100644 --- a/hercules-gate/pom.xml +++ b/hercules-gate/pom.xml @@ -3,7 +3,7 @@ hercules ru.kontur.vostok.hercules - 0.35.1-SNAPSHOT + 0.36.0-SNAPSHOT 4.0.0 diff --git a/hercules-graphite-sink/pom.xml b/hercules-graphite-sink/pom.xml index 658cd6845..a68c86120 100644 --- a/hercules-graphite-sink/pom.xml +++ b/hercules-graphite-sink/pom.xml @@ -3,7 +3,7 @@ hercules ru.kontur.vostok.hercules - 0.35.1-SNAPSHOT + 0.36.0-SNAPSHOT 4.0.0 diff --git a/hercules-health/pom.xml b/hercules-health/pom.xml index 04cc14f35..760e77e06 100644 --- a/hercules-health/pom.xml +++ b/hercules-health/pom.xml @@ -3,7 +3,7 @@ hercules ru.kontur.vostok.hercules - 0.35.1-SNAPSHOT + 0.36.0-SNAPSHOT 4.0.0 diff --git a/hercules-http/pom.xml b/hercules-http/pom.xml index 55591a40c..023a50c4f 100644 --- a/hercules-http/pom.xml +++ b/hercules-http/pom.xml @@ -3,7 +3,7 @@ hercules ru.kontur.vostok.hercules - 0.35.1-SNAPSHOT + 0.36.0-SNAPSHOT 4.0.0 diff --git a/hercules-init/pom.xml b/hercules-init/pom.xml index d6f9a1c46..2f9aed73e 100644 --- a/hercules-init/pom.xml +++ b/hercules-init/pom.xml @@ -3,7 +3,7 @@ hercules ru.kontur.vostok.hercules - 0.35.1-SNAPSHOT + 0.36.0-SNAPSHOT 4.0.0 diff --git a/hercules-json/pom.xml b/hercules-json/pom.xml index db737d052..503647a10 100644 --- a/hercules-json/pom.xml +++ b/hercules-json/pom.xml @@ -5,7 +5,7 @@ hercules ru.kontur.vostok.hercules - 0.35.1-SNAPSHOT + 0.36.0-SNAPSHOT 4.0.0 diff --git a/hercules-kafka-util/pom.xml b/hercules-kafka-util/pom.xml index f95a67e85..352066ee0 100644 --- a/hercules-kafka-util/pom.xml +++ b/hercules-kafka-util/pom.xml @@ -3,7 +3,7 @@ hercules ru.kontur.vostok.hercules - 0.35.1-SNAPSHOT + 0.36.0-SNAPSHOT 4.0.0 diff --git a/hercules-management-api/pom.xml b/hercules-management-api/pom.xml index 498c25d3b..fbb8ae492 100644 --- a/hercules-management-api/pom.xml +++ b/hercules-management-api/pom.xml @@ -3,7 +3,7 @@ hercules ru.kontur.vostok.hercules - 0.35.1-SNAPSHOT + 0.36.0-SNAPSHOT 4.0.0 diff --git a/hercules-meta/pom.xml b/hercules-meta/pom.xml index 30078cde7..15ca0d843 100644 --- a/hercules-meta/pom.xml +++ b/hercules-meta/pom.xml @@ -3,7 +3,7 @@ hercules ru.kontur.vostok.hercules - 0.35.1-SNAPSHOT + 0.36.0-SNAPSHOT 4.0.0 diff --git a/hercules-partitioner/pom.xml b/hercules-partitioner/pom.xml index d432682de..4eacdd159 100644 --- a/hercules-partitioner/pom.xml +++ b/hercules-partitioner/pom.xml @@ -3,7 +3,7 @@ hercules ru.kontur.vostok.hercules - 0.35.1-SNAPSHOT + 0.36.0-SNAPSHOT 4.0.0 diff --git a/hercules-protocol/pom.xml b/hercules-protocol/pom.xml index 1c57138a1..32dd38ed0 100644 --- a/hercules-protocol/pom.xml +++ b/hercules-protocol/pom.xml @@ -3,7 +3,7 @@ hercules ru.kontur.vostok.hercules - 0.35.1-SNAPSHOT + 0.36.0-SNAPSHOT 4.0.0 diff --git a/hercules-sd/pom.xml b/hercules-sd/pom.xml index be438e97f..954758286 100644 --- a/hercules-sd/pom.xml +++ b/hercules-sd/pom.xml @@ -5,7 +5,7 @@ hercules ru.kontur.vostok.hercules - 0.35.1-SNAPSHOT + 0.36.0-SNAPSHOT 4.0.0 diff --git a/hercules-sentry-sink/pom.xml b/hercules-sentry-sink/pom.xml index 6c8bbf8da..d172f36dc 100644 --- a/hercules-sentry-sink/pom.xml +++ b/hercules-sentry-sink/pom.xml @@ -3,7 +3,7 @@ hercules ru.kontur.vostok.hercules - 0.35.1-SNAPSHOT + 0.36.0-SNAPSHOT 4.0.0 diff --git a/hercules-sink/pom.xml b/hercules-sink/pom.xml index 8efe7a490..672512cdd 100644 --- a/hercules-sink/pom.xml +++ b/hercules-sink/pom.xml @@ -5,7 +5,7 @@ hercules ru.kontur.vostok.hercules - 0.35.1-SNAPSHOT + 0.36.0-SNAPSHOT 4.0.0 diff --git a/hercules-stream-api/pom.xml b/hercules-stream-api/pom.xml index 3880cefe6..e4acf9d78 100644 --- a/hercules-stream-api/pom.xml +++ b/hercules-stream-api/pom.xml @@ -3,7 +3,7 @@ hercules ru.kontur.vostok.hercules - 0.35.1-SNAPSHOT + 0.36.0-SNAPSHOT 4.0.0 diff --git a/hercules-stream-manager/pom.xml b/hercules-stream-manager/pom.xml index 790f870f3..4e92d0d7d 100644 --- a/hercules-stream-manager/pom.xml +++ b/hercules-stream-manager/pom.xml @@ -3,7 +3,7 @@ hercules ru.kontur.vostok.hercules - 0.35.1-SNAPSHOT + 0.36.0-SNAPSHOT 4.0.0 diff --git a/hercules-stream-sink/pom.xml b/hercules-stream-sink/pom.xml index a6c5ef719..5f72c64f1 100644 --- a/hercules-stream-sink/pom.xml +++ b/hercules-stream-sink/pom.xml @@ -3,7 +3,7 @@ hercules ru.kontur.vostok.hercules - 0.35.1-SNAPSHOT + 0.36.0-SNAPSHOT 4.0.0 diff --git a/hercules-tags/pom.xml b/hercules-tags/pom.xml index b7dbaaeb6..a50ce8b83 100644 --- a/hercules-tags/pom.xml +++ b/hercules-tags/pom.xml @@ -3,7 +3,7 @@ hercules ru.kontur.vostok.hercules - 0.35.1-SNAPSHOT + 0.36.0-SNAPSHOT 4.0.0 diff --git a/hercules-throttling/pom.xml b/hercules-throttling/pom.xml index b32ffe84b..ee0d81503 100644 --- a/hercules-throttling/pom.xml +++ b/hercules-throttling/pom.xml @@ -3,7 +3,7 @@ hercules ru.kontur.vostok.hercules - 0.35.1-SNAPSHOT + 0.36.0-SNAPSHOT 4.0.0 diff --git a/hercules-timeline-api/pom.xml b/hercules-timeline-api/pom.xml index 1f6a15641..e251d27c8 100644 --- a/hercules-timeline-api/pom.xml +++ b/hercules-timeline-api/pom.xml @@ -3,7 +3,7 @@ hercules ru.kontur.vostok.hercules - 0.35.1-SNAPSHOT + 0.36.0-SNAPSHOT 4.0.0 diff --git a/hercules-timeline-manager/pom.xml b/hercules-timeline-manager/pom.xml index 1855c0fc3..11e03a001 100644 --- a/hercules-timeline-manager/pom.xml +++ b/hercules-timeline-manager/pom.xml @@ -3,7 +3,7 @@ hercules ru.kontur.vostok.hercules - 0.35.1-SNAPSHOT + 0.36.0-SNAPSHOT 4.0.0 diff --git a/hercules-timeline-sink/pom.xml b/hercules-timeline-sink/pom.xml index 453d28fd5..b1f667cc6 100644 --- a/hercules-timeline-sink/pom.xml +++ b/hercules-timeline-sink/pom.xml @@ -3,7 +3,7 @@ hercules ru.kontur.vostok.hercules - 0.35.1-SNAPSHOT + 0.36.0-SNAPSHOT 4.0.0 diff --git a/hercules-tracing-api/pom.xml b/hercules-tracing-api/pom.xml index e42f2118d..19911c686 100644 --- a/hercules-tracing-api/pom.xml +++ b/hercules-tracing-api/pom.xml @@ -5,7 +5,7 @@ hercules ru.kontur.vostok.hercules - 0.35.1-SNAPSHOT + 0.36.0-SNAPSHOT 4.0.0 diff --git a/hercules-tracing-sink-clickhouse/pom.xml b/hercules-tracing-sink-clickhouse/pom.xml index 24d660159..cb7655cc4 100644 --- a/hercules-tracing-sink-clickhouse/pom.xml +++ b/hercules-tracing-sink-clickhouse/pom.xml @@ -5,7 +5,7 @@ hercules ru.kontur.vostok.hercules - 0.35.1-SNAPSHOT + 0.36.0-SNAPSHOT 4.0.0 diff --git a/hercules-tracing-sink/pom.xml b/hercules-tracing-sink/pom.xml index 3164d5eaf..93f8bb722 100644 --- a/hercules-tracing-sink/pom.xml +++ b/hercules-tracing-sink/pom.xml @@ -5,7 +5,7 @@ hercules ru.kontur.vostok.hercules - 0.35.1-SNAPSHOT + 0.36.0-SNAPSHOT 4.0.0 diff --git a/hercules-undertow-util/pom.xml b/hercules-undertow-util/pom.xml index be1df21f2..6f15bbfb3 100644 --- a/hercules-undertow-util/pom.xml +++ b/hercules-undertow-util/pom.xml @@ -3,7 +3,7 @@ hercules ru.kontur.vostok.hercules - 0.35.1-SNAPSHOT + 0.36.0-SNAPSHOT 4.0.0 diff --git a/hercules-util/pom.xml b/hercules-util/pom.xml index 735313f62..5649d6825 100644 --- a/hercules-util/pom.xml +++ b/hercules-util/pom.xml @@ -3,7 +3,7 @@ hercules ru.kontur.vostok.hercules - 0.35.1-SNAPSHOT + 0.36.0-SNAPSHOT 4.0.0 diff --git a/hercules-uuid/pom.xml b/hercules-uuid/pom.xml index 4c59a3ec9..0c18a0bdc 100644 --- a/hercules-uuid/pom.xml +++ b/hercules-uuid/pom.xml @@ -3,7 +3,7 @@ hercules ru.kontur.vostok.hercules - 0.35.1-SNAPSHOT + 0.36.0-SNAPSHOT 4.0.0 diff --git a/pom.xml b/pom.xml index 6b40d12b2..87bf41bd5 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ ru.kontur.vostok.hercules hercules pom - 0.35.1-SNAPSHOT + 0.36.0-SNAPSHOT UTF-8 @@ -14,7 +14,7 @@ 1.8 1.8 - 0.35.1-SNAPSHOT + 0.36.0-SNAPSHOT 2.2.0 3.4.13