mirror of
https://github.com/NationalSecurityAgency/timely.git
synced 2026-11-10 03:41:25 -10:00
Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2a8da60673 | ||
|
|
de8e29a190 | ||
|
|
21e74a50f3 | ||
|
|
9ca070f106 |
No files matched your search
+19
-1
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>timely</groupId>
|
||||
<artifactId>timely</artifactId>
|
||||
<version>2.2.6-SNAPSHOT</version>
|
||||
<version>2.1.6-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>timely-analytics</artifactId>
|
||||
<!--
|
||||
@@ -64,6 +64,24 @@
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<compilerId>jdt</compilerId>
|
||||
</configuration>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.tycho</groupId>
|
||||
<artifactId>tycho-compiler-jdt</artifactId>
|
||||
<version>1.4.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.jacoco</groupId>
|
||||
|
||||
@@ -48,47 +48,40 @@ timely:
|
||||
server:
|
||||
ip: ${HOST_IP}
|
||||
tcp-base-port: ${TCP_BASE_PORT}
|
||||
num-tcp-pools: 1
|
||||
tcp-buffer-size: 100
|
||||
tcp-client-pool:
|
||||
min-idle-per-key: 5
|
||||
max-idle-per-key: 5
|
||||
max-total-per-key: 5
|
||||
min-idle-per-key: 0
|
||||
max-idle-per-key: 40
|
||||
max-total-per-key: 40
|
||||
max-total: -1
|
||||
lifo: false
|
||||
fairness: true
|
||||
max-wait-millis: 60000
|
||||
min-evictable-idle-time-millis: -1
|
||||
lifo: true
|
||||
fairness: false
|
||||
max-wait-millis: -1
|
||||
min-evictable-idle-time-millis: 1800000
|
||||
evictor-shutdown-timeout-millis: 10000
|
||||
soft-min-evictable-idle-time-millis: 300000
|
||||
soft-min-evictable-idle-time-millis: -1
|
||||
num-tests-per-eviction-run: 3
|
||||
time-between-eviction-runs-millis: 30000
|
||||
time-between-eviction-runs-millis: -1
|
||||
block-when-exhausted: true
|
||||
remove-abandoned-on-borrow: false
|
||||
remove-abandoned-on-maintenance: true
|
||||
remove-abandoned-timeout-millis: 600000
|
||||
remove-abandoned-logging: true
|
||||
jmx-enabled: true
|
||||
test-on-borrow: false
|
||||
test-on-return: false
|
||||
udp-base-port: ${UDP_BASE_PORT}
|
||||
udp-client-pool:
|
||||
min-idle-per-key: 5
|
||||
max-idle-per-key: 5
|
||||
max-total-per-key: 5
|
||||
min-idle-per-key: 0
|
||||
max-idle-per-key: 40
|
||||
max-total-per-key: 40
|
||||
max-total: -1
|
||||
lifo: false
|
||||
fairness: true
|
||||
max-wait-millis: 60000
|
||||
min-evictable-idle-time-millis: -1
|
||||
lifo: true
|
||||
fairness: false
|
||||
max-wait-millis: -1
|
||||
min-evictable-idle-time-millis: 1800000
|
||||
evictor-shutdown-timeout-millis: 10000
|
||||
soft-min-evictable-idle-time-millis: 300000
|
||||
soft-min-evictable-idle-time-millis: -1
|
||||
num-tests-per-eviction-run: 3
|
||||
time-between-eviction-runs-millis: 30000
|
||||
time-between-eviction-runs-millis: -1
|
||||
block-when-exhausted: true
|
||||
remove-abandoned-on-borrow: false
|
||||
remove-abandoned-on-maintenance: true
|
||||
remove-abandoned-timeout-millis: 600000
|
||||
remove-abandoned-logging: true
|
||||
jmx-enabled: true
|
||||
test-on-borrow: false
|
||||
test-on-return: false
|
||||
@@ -98,10 +91,6 @@ timely:
|
||||
base-port: ${HTTP_BASE_PORT}
|
||||
redirect-path: /secure-me
|
||||
strict-transport-max-age: 604800
|
||||
connection-request-timeout: 5000
|
||||
connect-timeout: 5000
|
||||
socketTimeout: 300000
|
||||
request-timeout: 300000
|
||||
cors:
|
||||
allow-any-origin: false
|
||||
allow-null-origin: false
|
||||
@@ -110,23 +99,19 @@ timely:
|
||||
allowed-methods: DELETE,GET,HEAD,OPTIONS,PUT,POST
|
||||
allowed-headers: content-type
|
||||
httpClientPool:
|
||||
min-idle-per-key: 10
|
||||
min-idle-per-key: 0
|
||||
max-idle-per-key: 40
|
||||
max-total-per-key: 40
|
||||
max-total: -1
|
||||
lifo: false
|
||||
fairness: true
|
||||
max-wait-millis: 60000
|
||||
min-evictable-idle-time-millis: -1
|
||||
lifo: true
|
||||
fairness: false
|
||||
max-wait-millis: -1
|
||||
min-evictable-idle-time-millis: 1800000
|
||||
evictor-shutdown-timeout-millis: 10000
|
||||
soft-min-evictable-idle-time-millis: 300000
|
||||
soft-min-evictable-idle-time-millis: -1
|
||||
num-tests-per-eviction-run: 3
|
||||
time-between-eviction-runs-millis: 30000
|
||||
time-between-eviction-runs-millis: -1
|
||||
block-when-exhausted: true
|
||||
remove-abandoned-on-borrow: false
|
||||
remove-abandoned-on-maintenance: true
|
||||
remove-abandoned-timeout-millis: 600000
|
||||
remove-abandoned-logging: true
|
||||
jmx-enabled: true
|
||||
test-on-borrow: false
|
||||
test-on-return: false
|
||||
@@ -145,19 +130,15 @@ timely:
|
||||
max-idle-per-key: 40
|
||||
max-total-per-key: 40
|
||||
max-total: -1
|
||||
lifo: false
|
||||
fairness: true
|
||||
max-wait-millis: 60000
|
||||
min-evictable-idle-time-millis: -1
|
||||
lifo: true
|
||||
fairness: false
|
||||
max-wait-millis: -1
|
||||
min-evictable-idle-time-millis: 1800000
|
||||
evictor-shutdown-timeout-millis: 10000
|
||||
soft-min-evictable-idle-time-millis: 300000
|
||||
soft-min-evictable-idle-time-millis: -1
|
||||
num-tests-per-eviction-run: 3
|
||||
time-between-eviction-runs-millis: 30000
|
||||
time-between-eviction-runs-millis: -1
|
||||
block-when-exhausted: true
|
||||
remove-abandoned-on-borrow: false
|
||||
remove-abandoned-on-maintenance: true
|
||||
remove-abandoned-timeout-millis: 600000
|
||||
remove-abandoned-logging: true
|
||||
jmx-enabled: true
|
||||
test-on-borrow: false
|
||||
test-on-return: false
|
||||
|
||||
+1
-5
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>timely</groupId>
|
||||
<artifactId>timely</artifactId>
|
||||
<version>2.2.6-SNAPSHOT</version>
|
||||
<version>2.1.6-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>timely-balancer</artifactId>
|
||||
<description>Timely Balancer</description>
|
||||
@@ -44,10 +44,6 @@
|
||||
<groupId>io.github.classgraph</groupId>
|
||||
<artifactId>classgraph</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.netty</groupId>
|
||||
<artifactId>netty-transport-classes-epoll</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.sourceforge.javacsv</groupId>
|
||||
<artifactId>javacsv</artifactId>
|
||||
|
||||
Vendored
+7
@@ -46,5 +46,12 @@
|
||||
<include>*</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
<fileSet>
|
||||
<directory>${project.basedir}/src/main/resources/webapp</directory>
|
||||
<outputDirectory>bin/webapp</outputDirectory>
|
||||
<includes>
|
||||
<include>*</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
</fileSets>
|
||||
</assembly>
|
||||
@@ -83,10 +83,8 @@ import timely.common.configuration.SecurityProperties;
|
||||
import timely.common.configuration.SslClientProperties;
|
||||
import timely.common.configuration.SslServerProperties;
|
||||
import timely.common.configuration.ZookeeperProperties;
|
||||
import timely.netty.http.HttpStrictTransportSecurityHandler;
|
||||
import timely.netty.http.HttpVersionRequestHandler;
|
||||
import timely.netty.http.NonSslForbiddenHandler;
|
||||
import timely.netty.http.NotFoundHandler;
|
||||
import timely.netty.http.HttpStaticFileServerHandler;
|
||||
import timely.netty.http.NonSslRedirectHandler;
|
||||
import timely.netty.http.TimelyExceptionHandler;
|
||||
import timely.netty.http.auth.X509LoginRequestHandler;
|
||||
import timely.netty.tcp.MetricsBufferDecoder;
|
||||
@@ -219,12 +217,16 @@ public class Balancer {
|
||||
}
|
||||
log.info("Using channel class {}", channelClass.getSimpleName());
|
||||
|
||||
List<TcpClientPool> tcpClientPools = new ArrayList<>();
|
||||
for (int x = 0; x < balancerServerProperties.getNumTcpPools(); x++) {
|
||||
tcpClientPools.add(new TcpClientPool(balancerServerProperties));
|
||||
}
|
||||
|
||||
final ServerBootstrap tcpServer = new ServerBootstrap();
|
||||
tcpServer.group(tcpBossGroup, tcpWorkerGroup);
|
||||
tcpServer.channel(channelClass);
|
||||
tcpServer.handler(new LoggingHandler());
|
||||
TcpClientPool tcpClientPool = new TcpClientPool(balancerServerProperties);
|
||||
tcpServer.childHandler(setupTcpChannel(metricResolver, tcpClientPool));
|
||||
tcpServer.childHandler(setupTcpChannel(metricResolver, tcpClientPools));
|
||||
tcpServer.option(ChannelOption.ALLOCATOR, PooledByteBufAllocator.DEFAULT);
|
||||
tcpServer.option(ChannelOption.SO_BACKLOG, 128);
|
||||
tcpServer.childOption(ChannelOption.SO_KEEPALIVE, true);
|
||||
@@ -419,9 +421,8 @@ public class Balancer {
|
||||
@Override
|
||||
protected void initChannel(SocketChannel ch) {
|
||||
|
||||
ch.pipeline().addLast("nonsslforbidden", new NonSslForbiddenHandler(sslCtx));
|
||||
ch.pipeline().addLast("ssl", new NonSslRedirectHandler(balancerHttpProperties, sslCtx));
|
||||
ch.pipeline().addLast("encoder", new HttpResponseEncoder());
|
||||
ch.pipeline().addLast("strict", new HttpStrictTransportSecurityHandler(balancerHttpProperties));
|
||||
ch.pipeline().addLast("decoder", new HttpRequestDecoder(4096, 32768, 8192, true, 128));
|
||||
ch.pipeline().addLast("compressor", new HttpContentCompressor());
|
||||
ch.pipeline().addLast("decompressor", new HttpContentDecompressor());
|
||||
@@ -429,10 +430,10 @@ public class Balancer {
|
||||
ch.pipeline().addLast("chunker", new ChunkedWriteHandler());
|
||||
ch.pipeline().addLast("queryDecoder",
|
||||
new timely.netty.http.HttpRequestDecoder(authenticationService, securityProperties, balancerHttpProperties));
|
||||
ch.pipeline().addLast("notfound", new NotFoundHandler());
|
||||
ch.pipeline().addLast("fileServer",
|
||||
new HttpStaticFileServerHandler().setIgnoreSslHandshakeErrors(sslServerProperties.isIgnoreSslHandshakeErrors()));
|
||||
ch.pipeline().addLast("login", new X509LoginRequestHandler(authenticationService, securityProperties, balancerHttpProperties));
|
||||
ch.pipeline().addLast("version", new HttpVersionRequestHandler());
|
||||
ch.pipeline().addLast("httpRelay", new HttpRelayHandler(balancerHttpProperties, metricResolver, httpClientPool));
|
||||
ch.pipeline().addLast("httpRelay", new HttpRelayHandler(metricResolver, httpClientPool));
|
||||
ch.pipeline().addLast("error", new TimelyExceptionHandler().setIgnoreSslHandshakeErrors(sslServerProperties.isIgnoreSslHandshakeErrors()));
|
||||
}
|
||||
};
|
||||
@@ -453,7 +454,7 @@ public class Balancer {
|
||||
};
|
||||
}
|
||||
|
||||
protected ChannelHandler setupTcpChannel(MetricResolver metricResolver, TcpClientPool tcpClientPool) {
|
||||
protected ChannelHandler setupTcpChannel(MetricResolver metricResolver, List<TcpClientPool> tcpClientPools) {
|
||||
return new ChannelInitializer<SocketChannel>() {
|
||||
|
||||
@Override
|
||||
@@ -461,7 +462,7 @@ public class Balancer {
|
||||
ch.pipeline().addLast("buffer", new MetricsBufferDecoder());
|
||||
ch.pipeline().addLast("frame", new DelimiterBasedFrameDecoder(65536, true, Delimiters.lineDelimiter()));
|
||||
ch.pipeline().addLast("putDecoder", new TcpDecoder());
|
||||
ch.pipeline().addLast("tcpRelayHandler", new TcpRelayHandler(metricResolver, tcpClientPool));
|
||||
ch.pipeline().addLast("tcpRelayHandler", new TcpRelayHandler(metricResolver, tcpClientPools));
|
||||
ch.pipeline().addLast("versionHandler", new TcpVersionHandler());
|
||||
}
|
||||
};
|
||||
|
||||
@@ -2,6 +2,7 @@ package timely.balancer.configuration;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
import org.apache.commons.pool2.impl.GenericKeyedObjectPoolConfig;
|
||||
import org.apache.http.impl.client.CloseableHttpClient;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.boot.context.properties.NestedConfigurationProperty;
|
||||
@@ -13,48 +14,11 @@ import timely.common.configuration.HttpProperties;
|
||||
@ConfigurationProperties(prefix = "timely.balancer.http")
|
||||
public class BalancerHttpProperties extends HttpProperties {
|
||||
|
||||
private int connectionRequestTimeout = 5000;
|
||||
private int connectTimeout = 5000;
|
||||
private int socketTimeout = 300000;
|
||||
private int requestTimeout = 300000;
|
||||
|
||||
@Valid
|
||||
@NestedConfigurationProperty
|
||||
private GenericKeyedObjectPoolConfiguration<CloseableHttpClient> httpClientPool = new GenericKeyedObjectPoolConfiguration<>();
|
||||
private GenericKeyedObjectPoolConfig<CloseableHttpClient> httpClientPool = new GenericKeyedObjectPoolConfig<>();
|
||||
|
||||
public GenericKeyedObjectPoolConfiguration<CloseableHttpClient> getHttpClientPool() {
|
||||
public GenericKeyedObjectPoolConfig<CloseableHttpClient> getHttpClientPool() {
|
||||
return httpClientPool;
|
||||
}
|
||||
|
||||
public void setConnectionRequestTimeout(final int connectionRequestTimeout) {
|
||||
this.connectionRequestTimeout = connectionRequestTimeout;
|
||||
}
|
||||
|
||||
public int getConnectionRequestTimeout() {
|
||||
return connectionRequestTimeout;
|
||||
}
|
||||
|
||||
public void setConnectTimeout(final int connectTimeout) {
|
||||
this.connectTimeout = connectTimeout;
|
||||
}
|
||||
|
||||
public int getConnectTimeout() {
|
||||
return connectTimeout;
|
||||
}
|
||||
|
||||
public void setSocketTimeout(final int socketTimeout) {
|
||||
this.socketTimeout = socketTimeout;
|
||||
}
|
||||
|
||||
public int getSocketTimeout() {
|
||||
return socketTimeout;
|
||||
}
|
||||
|
||||
public void setRequestTimeout(int requestTimeout) {
|
||||
this.requestTimeout = requestTimeout;
|
||||
}
|
||||
|
||||
public int getRequestTimeout() {
|
||||
return requestTimeout;
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package timely.balancer.configuration;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
import org.apache.commons.pool2.impl.GenericKeyedObjectPoolConfig;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.boot.context.properties.NestedConfigurationProperty;
|
||||
import org.springframework.cloud.context.config.annotation.RefreshScope;
|
||||
@@ -16,22 +17,32 @@ public class BalancerServerProperties extends ServerProperties {
|
||||
|
||||
@Valid
|
||||
@NestedConfigurationProperty
|
||||
private GenericKeyedObjectPoolConfiguration<UdpClient> udpClientPool = new GenericKeyedObjectPoolConfiguration<>();
|
||||
private GenericKeyedObjectPoolConfig<UdpClient> udpClientPool = new GenericKeyedObjectPoolConfig<>();
|
||||
|
||||
@Valid
|
||||
@NestedConfigurationProperty
|
||||
private GenericKeyedObjectPoolConfiguration<TcpClient> tcpClientPool = new GenericKeyedObjectPoolConfiguration<>();
|
||||
private GenericKeyedObjectPoolConfig<TcpClient> tcpClientPool = new GenericKeyedObjectPoolConfig<>();
|
||||
|
||||
private int numTcpPools = 1;
|
||||
|
||||
private int tcpBufferSize = -1;
|
||||
|
||||
public GenericKeyedObjectPoolConfiguration<UdpClient> getUdpClientPool() {
|
||||
public GenericKeyedObjectPoolConfig<UdpClient> getUdpClientPool() {
|
||||
return udpClientPool;
|
||||
}
|
||||
|
||||
public GenericKeyedObjectPoolConfiguration<TcpClient> getTcpClientPool() {
|
||||
public GenericKeyedObjectPoolConfig<TcpClient> getTcpClientPool() {
|
||||
return tcpClientPool;
|
||||
}
|
||||
|
||||
public int getNumTcpPools() {
|
||||
return numTcpPools;
|
||||
}
|
||||
|
||||
public void setNumTcpPools(int numTcpPools) {
|
||||
this.numTcpPools = numTcpPools;
|
||||
}
|
||||
|
||||
public int getTcpBufferSize() {
|
||||
return tcpBufferSize;
|
||||
}
|
||||
|
||||
+3
-2
@@ -2,6 +2,7 @@ package timely.balancer.configuration;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
import org.apache.commons.pool2.impl.GenericKeyedObjectPoolConfig;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.boot.context.properties.NestedConfigurationProperty;
|
||||
import org.springframework.cloud.context.config.annotation.RefreshScope;
|
||||
@@ -15,9 +16,9 @@ public class BalancerWebsocketProperties extends WebsocketProperties {
|
||||
|
||||
@Valid
|
||||
@NestedConfigurationProperty
|
||||
private GenericKeyedObjectPoolConfiguration<WebSocketSubscriptionClient> wsClientPool = new GenericKeyedObjectPoolConfiguration<>();
|
||||
private GenericKeyedObjectPoolConfig<WebSocketSubscriptionClient> wsClientPool = new GenericKeyedObjectPoolConfig<>();
|
||||
|
||||
public GenericKeyedObjectPoolConfiguration<WebSocketSubscriptionClient> getWsClientPool() {
|
||||
public GenericKeyedObjectPoolConfig<WebSocketSubscriptionClient> getWsClientPool() {
|
||||
return wsClientPool;
|
||||
}
|
||||
|
||||
|
||||
-83
@@ -1,83 +0,0 @@
|
||||
package timely.balancer.configuration;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.time.Duration;
|
||||
|
||||
import org.apache.commons.pool2.impl.AbandonedConfig;
|
||||
import org.apache.commons.pool2.impl.GenericKeyedObjectPoolConfig;
|
||||
|
||||
public class GenericKeyedObjectPoolConfiguration<T> extends GenericKeyedObjectPoolConfig<T> {
|
||||
|
||||
private Duration removeAbandonedTimeout = null;
|
||||
private boolean removeAbandonedLogging = false;
|
||||
private boolean removeAbandonedOnBorrow = false;
|
||||
private boolean removeAbandonedOnMaintenance = false;
|
||||
|
||||
public void setMaxWaitMillis(long maxWaitMillis) {
|
||||
super.setMaxWait(Duration.ofMillis(maxWaitMillis));
|
||||
}
|
||||
|
||||
public void setMinEvictableIdleTimeMillis(long minEvictableIdleTimeMillis) {
|
||||
super.setMinEvictableIdleTime(Duration.ofMillis(minEvictableIdleTimeMillis));
|
||||
}
|
||||
|
||||
public void setEvictorShutdownTimeoutMillis(long evictorShutdownTimeoutMillis) {
|
||||
super.setEvictorShutdownTimeout(Duration.ofMillis(evictorShutdownTimeoutMillis));
|
||||
}
|
||||
|
||||
public void setSoftMinEvictableIdleTimeMillis(long softMinEvictableIdleTimeMillis) {
|
||||
super.setSoftMinEvictableIdleTime(Duration.ofMillis(softMinEvictableIdleTimeMillis));
|
||||
}
|
||||
|
||||
public void setTimeBetweenEvictionRunsMillis(long timeBetweenEvictionRunsMillis) {
|
||||
super.setTimeBetweenEvictionRuns(Duration.ofMillis(timeBetweenEvictionRunsMillis));
|
||||
}
|
||||
|
||||
public void setRemoveAbandonedTimeoutMillis(long removeAbandonedTimeoutMillis) {
|
||||
this.removeAbandonedTimeout = Duration.ofMillis(removeAbandonedTimeoutMillis);
|
||||
}
|
||||
|
||||
public Duration getRemoveAbandonedTimeout() {
|
||||
return removeAbandonedTimeout;
|
||||
}
|
||||
|
||||
public void setRemoveAbandonedOnBorrow(boolean removeAbandonedOnBorrow) {
|
||||
this.removeAbandonedOnBorrow = removeAbandonedOnBorrow;
|
||||
}
|
||||
|
||||
public boolean getRemoveAbandonedOnBorrow() {
|
||||
return removeAbandonedOnBorrow;
|
||||
}
|
||||
|
||||
public void setRemoveAbandonedOnMaintenance(boolean removeAbandonedOnMaintenance) {
|
||||
this.removeAbandonedOnMaintenance = removeAbandonedOnMaintenance;
|
||||
}
|
||||
|
||||
public boolean getRemoveAbandonedOnMaintenance() {
|
||||
return removeAbandonedOnMaintenance;
|
||||
}
|
||||
|
||||
public void setRemoveAbandonedLogging(boolean removeAbandonedLogging) {
|
||||
this.removeAbandonedLogging = removeAbandonedLogging;
|
||||
}
|
||||
|
||||
public boolean getRemoveAbandonedLogging() {
|
||||
return removeAbandonedLogging;
|
||||
}
|
||||
|
||||
public AbandonedConfig getAbandonedConfig() {
|
||||
AbandonedConfig abandonedConfig = null;
|
||||
if (removeAbandonedTimeout != null) {
|
||||
abandonedConfig = new AbandonedConfig();
|
||||
abandonedConfig.setRemoveAbandonedTimeout(removeAbandonedTimeout);
|
||||
if (removeAbandonedLogging) {
|
||||
abandonedConfig.setLogAbandoned(removeAbandonedLogging);
|
||||
abandonedConfig.setLogWriter(new PrintWriter(System.out, true, StandardCharsets.UTF_8));
|
||||
}
|
||||
abandonedConfig.setRemoveAbandonedOnBorrow(removeAbandonedOnBorrow);
|
||||
abandonedConfig.setRemoveAbandonedOnMaintenance(removeAbandonedOnMaintenance);
|
||||
}
|
||||
return abandonedConfig;
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,7 @@ import timely.common.configuration.SslClientProperties;
|
||||
|
||||
public class HttpClientPool extends GenericKeyedObjectPool<TimelyBalancedHost,CloseableHttpClient> {
|
||||
|
||||
public HttpClientPool(BalancerHttpProperties config, SSLContext sslContext, SslClientProperties sslClientProperties) {
|
||||
super(new HttpClientFactory(sslContext, sslClientProperties), config.getHttpClientPool(), config.getHttpClientPool().getAbandonedConfig());
|
||||
public HttpClientPool(BalancerHttpProperties http, SSLContext sslContext, SslClientProperties sslClientProperties) {
|
||||
super(new HttpClientFactory(sslContext, sslClientProperties), http.getHttpClientPool());
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,7 @@ import timely.client.tcp.TcpClient;
|
||||
|
||||
public class TcpClientPool extends GenericKeyedObjectPool<TimelyBalancedHost,TcpClient> {
|
||||
|
||||
public TcpClientPool(BalancerServerProperties config) {
|
||||
super(new TcpClientFactory(config.getTcpBufferSize()), config.getTcpClientPool(), config.getTcpClientPool().getAbandonedConfig());
|
||||
public TcpClientPool(BalancerServerProperties balancerServerProperties) {
|
||||
super(new TcpClientFactory(balancerServerProperties.getTcpBufferSize()), balancerServerProperties.getTcpClientPool());
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,7 @@ import timely.client.udp.UdpClient;
|
||||
|
||||
public class UdpClientPool extends GenericKeyedObjectPool<TimelyBalancedHost,UdpClient> {
|
||||
|
||||
public UdpClientPool(BalancerServerProperties config) {
|
||||
super(new UdpClientFactory(), config.getUdpClientPool(), config.getUdpClientPool().getAbandonedConfig());
|
||||
public UdpClientPool(BalancerServerProperties serverProperties) {
|
||||
super(new UdpClientFactory(), serverProperties.getUdpClientPool());
|
||||
}
|
||||
}
|
||||
@@ -12,9 +12,9 @@ import timely.common.configuration.SslClientProperties;
|
||||
|
||||
public class WsClientPool extends GenericKeyedObjectPool<TimelyBalancedHost,WebSocketSubscriptionClient> {
|
||||
|
||||
public WsClientPool(BalancerProperties balancerProperties, BalancerWebsocketProperties config, SslClientProperties sslClientProperties,
|
||||
public WsClientPool(BalancerProperties balancerProperties, BalancerWebsocketProperties balancerWebsocketProperties, SslClientProperties sslClientProperties,
|
||||
SSLContext sslContext) {
|
||||
super(new WsClientFactory(balancerProperties, config, sslClientProperties, sslContext), config.getWsClientPool(),
|
||||
config.getWsClientPool().getAbandonedConfig());
|
||||
super(new WsClientFactory(balancerProperties, balancerWebsocketProperties, sslClientProperties, sslContext),
|
||||
balancerWebsocketProperties.getWsClientPool());
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,6 @@ package timely.balancer.netty.http;
|
||||
import static io.netty.handler.codec.http.HttpHeaderNames.CONTENT_LENGTH;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
@@ -11,19 +10,12 @@ import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.Future;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.TimeoutException;
|
||||
|
||||
import org.apache.http.Header;
|
||||
import org.apache.http.client.config.RequestConfig;
|
||||
import org.apache.http.client.methods.CloseableHttpResponse;
|
||||
import org.apache.http.client.methods.HttpGet;
|
||||
import org.apache.http.client.methods.HttpPost;
|
||||
import org.apache.http.client.methods.HttpRequestBase;
|
||||
import org.apache.http.client.methods.HttpUriRequest;
|
||||
import org.apache.http.entity.StringEntity;
|
||||
import org.apache.http.impl.client.CloseableHttpClient;
|
||||
import org.apache.http.message.BasicHeader;
|
||||
@@ -31,7 +23,6 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.util.StreamUtils;
|
||||
|
||||
import com.google.common.base.Throwables;
|
||||
import com.google.common.collect.Multimap;
|
||||
|
||||
import io.netty.buffer.Unpooled;
|
||||
@@ -43,6 +34,7 @@ import io.netty.handler.codec.http.FullHttpResponse;
|
||||
import io.netty.handler.codec.http.HttpMethod;
|
||||
import io.netty.handler.codec.http.HttpResponseStatus;
|
||||
import io.netty.handler.codec.http.HttpVersion;
|
||||
import io.netty.util.ReferenceCountUtil;
|
||||
import timely.api.request.AuthenticatedRequest;
|
||||
import timely.api.request.HttpRequest;
|
||||
import timely.api.request.MetricRequest;
|
||||
@@ -52,7 +44,6 @@ import timely.auth.TimelyAuthenticationToken;
|
||||
import timely.auth.util.HttpHeaderUtils;
|
||||
import timely.auth.util.ProxiedEntityUtils;
|
||||
import timely.balancer.MetricResolver;
|
||||
import timely.balancer.configuration.BalancerHttpProperties;
|
||||
import timely.balancer.connection.TimelyBalancedHost;
|
||||
import timely.balancer.connection.http.HttpClientPool;
|
||||
import timely.netty.http.TimelyHttpHandler;
|
||||
@@ -60,13 +51,10 @@ import timely.netty.http.TimelyHttpHandler;
|
||||
public class HttpRelayHandler extends SimpleChannelInboundHandler<HttpRequest> implements TimelyHttpHandler {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(HttpRelayHandler.class);
|
||||
private BalancerHttpProperties balancerHttpProperties;
|
||||
private final HttpClientPool httpClientPool;
|
||||
private MetricResolver metricResolver;
|
||||
private ExecutorService requestExecutor = Executors.newCachedThreadPool();
|
||||
|
||||
public HttpRelayHandler(BalancerHttpProperties balancerHttpProperties, MetricResolver metricResolver, HttpClientPool httpClientPool) {
|
||||
this.balancerHttpProperties = balancerHttpProperties;
|
||||
public HttpRelayHandler(MetricResolver metricResolver, HttpClientPool httpClientPool) {
|
||||
this.metricResolver = metricResolver;
|
||||
this.httpClientPool = httpClientPool;
|
||||
}
|
||||
@@ -79,7 +67,6 @@ public class HttpRelayHandler extends SimpleChannelInboundHandler<HttpRequest> i
|
||||
CloseableHttpResponse relayedResponse = null;
|
||||
FullHttpRequest request = null;
|
||||
try {
|
||||
String relayURI = "";
|
||||
try {
|
||||
request = msg.getHttpRequest();
|
||||
String originalURI = request.uri();
|
||||
@@ -122,39 +109,45 @@ public class HttpRelayHandler extends SimpleChannelInboundHandler<HttpRequest> i
|
||||
}
|
||||
Header[] headerArray = new Header[relayedHeaderList.size()];
|
||||
relayedHeaderList.toArray(headerArray);
|
||||
relayURI = "https://" + k.getHost() + ":" + k.getHttpPort() + originalURI;
|
||||
HttpRequestBase relayedRequest = null;
|
||||
|
||||
String relayURI = "https://" + k.getHost() + ":" + k.getHttpPort() + originalURI;
|
||||
if (request.method().equals(HttpMethod.GET)) {
|
||||
relayedRequest = new HttpGet(relayURI);
|
||||
HttpUriRequest relayedRequest = new HttpGet(relayURI);
|
||||
if (headerArray.length > 0) {
|
||||
relayedRequest.setHeaders(headerArray);
|
||||
}
|
||||
relayedResponse = client.execute(relayedRequest);
|
||||
|
||||
} else if (request.method().equals(HttpMethod.POST)) {
|
||||
relayedRequest = new HttpPost(relayURI);
|
||||
HttpPost relayedRequest = new HttpPost(relayURI);
|
||||
|
||||
String content = request.content().toString(StandardCharsets.UTF_8);
|
||||
StringEntity entity = new StringEntity(content);
|
||||
((HttpPost) relayedRequest).setEntity(entity);
|
||||
} else {
|
||||
throw new IllegalArgumentException("Unsupported HTTP method: " + request.method());
|
||||
relayedRequest.setEntity(entity);
|
||||
if (headerArray.length > 0) {
|
||||
relayedRequest.setHeaders(headerArray);
|
||||
}
|
||||
relayedResponse = client.execute(relayedRequest);
|
||||
}
|
||||
if (headerArray.length > 0) {
|
||||
relayedRequest.setHeaders(headerArray);
|
||||
}
|
||||
relayedResponse = executeHttpRequest(client, relayedRequest, balancerHttpProperties.getRequestTimeout());
|
||||
} catch (IOException e) {
|
||||
String message = String.format("%s calling %s", e.getMessage() == null ? "" : e.getMessage(), relayURI);
|
||||
log.error(message, e);
|
||||
this.sendHttpError(ctx, new TimelyException(HttpResponseStatus.GATEWAY_TIMEOUT.code(), e.getMessage(), e.getLocalizedMessage(), e));
|
||||
return;
|
||||
} catch (Exception e) {
|
||||
String message = e.getMessage();
|
||||
if (message != null && message.contains("No matching tags")) {
|
||||
log.trace(message);
|
||||
if (message == null) {
|
||||
log.error("", e);
|
||||
} else {
|
||||
message = String.format("%s calling %s", e.getMessage() == null ? "" : e.getMessage(), relayURI);
|
||||
log.error(message, e);
|
||||
if (message.contains("No matching tags")) {
|
||||
log.trace(message);
|
||||
} else {
|
||||
log.error(message, e);
|
||||
}
|
||||
}
|
||||
this.sendHttpError(ctx, new TimelyException(HttpResponseStatus.INTERNAL_SERVER_ERROR.code(), e.getMessage(), e.getLocalizedMessage(), e));
|
||||
return;
|
||||
} finally {
|
||||
if (request != null) {
|
||||
ReferenceCountUtil.release(request);
|
||||
}
|
||||
}
|
||||
FullHttpResponse response;
|
||||
FullHttpResponse response = null;
|
||||
if (relayedResponse == null) {
|
||||
this.sendHttpError(ctx, new TimelyException(HttpResponseStatus.METHOD_NOT_ALLOWED.code(), "Method not allowed", "Method not allowed"));
|
||||
} else {
|
||||
@@ -169,8 +162,6 @@ public class HttpRelayHandler extends SimpleChannelInboundHandler<HttpRequest> i
|
||||
response.headers().set(CONTENT_LENGTH, response.content().readableBytes());
|
||||
sendResponse(ctx, response);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
} finally {
|
||||
if (relayedResponse != null) {
|
||||
relayedResponse.close();
|
||||
@@ -209,22 +200,4 @@ public class HttpRelayHandler extends SimpleChannelInboundHandler<HttpRequest> i
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
private CloseableHttpResponse executeHttpRequest(CloseableHttpClient httpClient, HttpRequestBase relayedRequest, long timeout) throws Exception {
|
||||
try {
|
||||
RequestConfig.Builder requestConfigBuilder = RequestConfig.custom();
|
||||
requestConfigBuilder.setConnectionRequestTimeout(this.balancerHttpProperties.getConnectionRequestTimeout());
|
||||
requestConfigBuilder.setConnectTimeout(this.balancerHttpProperties.getConnectTimeout());
|
||||
requestConfigBuilder.setSocketTimeout(this.balancerHttpProperties.getSocketTimeout());
|
||||
RequestConfig requestConfig = requestConfigBuilder.build();
|
||||
relayedRequest.setConfig(requestConfig);
|
||||
Future<CloseableHttpResponse> f = requestExecutor.submit(() -> httpClient.execute(relayedRequest));
|
||||
return f.get(timeout, TimeUnit.MILLISECONDS);
|
||||
} catch (InterruptedException | ExecutionException | TimeoutException e) {
|
||||
Throwable cause = Throwables.getRootCause(e);
|
||||
throw new IOException(cause.getMessage(), cause);
|
||||
} catch (Exception e) {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
package timely.balancer.netty.tcp;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import org.slf4j.Logger;
|
||||
@@ -25,11 +27,16 @@ public class TcpRelayHandler extends SimpleChannelInboundHandler<TcpRequest> {
|
||||
private static final String ERR_MSG = "Error storing put metric: ";
|
||||
|
||||
private MetricResolver metricResolver;
|
||||
private TcpClientPool tcpClientPool;
|
||||
private List<TcpClientPool> tcpClientPools;
|
||||
|
||||
public TcpRelayHandler(MetricResolver metricResolver, TcpClientPool tcpClientPool) {
|
||||
public TcpRelayHandler(MetricResolver metricResolver, List<TcpClientPool> tcpClientPools) {
|
||||
this.metricResolver = metricResolver;
|
||||
this.tcpClientPool = tcpClientPool;
|
||||
this.tcpClientPools = tcpClientPools;
|
||||
}
|
||||
|
||||
private TcpClientPool tcpClientPool() {
|
||||
int x = Math.toIntExact(Thread.currentThread().getId() % tcpClientPools.size());
|
||||
return tcpClientPools.get(x);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -51,17 +58,15 @@ public class TcpRelayHandler extends SimpleChannelInboundHandler<TcpRequest> {
|
||||
keyClientPair.getRight().write(line + "\n");
|
||||
} finally {
|
||||
if (keyClientPair != null && keyClientPair.getLeft() != null && keyClientPair.getRight() != null) {
|
||||
tcpClientPool.returnObject(keyClientPair.getLeft(), keyClientPair.getRight());
|
||||
tcpClientPool().returnObject(keyClientPair.getLeft(), keyClientPair.getRight());
|
||||
}
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
} catch (IOException e) {
|
||||
log.error(LOG_ERR_MSG, msg, e);
|
||||
ChannelFuture cf = ctx.writeAndFlush(Unpooled.copiedBuffer((ERR_MSG + e.getMessage() + "\n").getBytes(StandardCharsets.UTF_8)));
|
||||
if (!cf.isSuccess()) {
|
||||
Throwable t = cf.cause();
|
||||
String message = (t == null) ? "" : t.getMessage();
|
||||
log.error(String.format(Constants.ERR_WRITING_RESPONSE, message), cf.cause());
|
||||
log.error(Constants.ERR_WRITING_RESPONSE, cf.cause());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -73,7 +78,7 @@ public class TcpRelayHandler extends SimpleChannelInboundHandler<TcpRequest> {
|
||||
while (client == null) {
|
||||
try {
|
||||
k = (metricRequest == true) ? metricResolver.getHostPortKeyIngest(metric) : metricResolver.getHostPortKey(metric);
|
||||
client = tcpClientPool.borrowObject(k);
|
||||
client = tcpClientPool().borrowObject(k);
|
||||
} catch (Exception e1) {
|
||||
failures++;
|
||||
client = null;
|
||||
|
||||
@@ -53,9 +53,7 @@ public class UdpRelayHandler extends SimpleChannelInboundHandler<UdpRequest> {
|
||||
log.error(LOG_ERR_MSG, msg, e);
|
||||
ChannelFuture cf = ctx.writeAndFlush(Unpooled.copiedBuffer((ERR_MSG + e.getMessage() + "\n").getBytes(StandardCharsets.UTF_8)));
|
||||
if (!cf.isSuccess()) {
|
||||
Throwable t = cf.cause();
|
||||
String message = (t == null) ? "" : t.getMessage();
|
||||
log.error(String.format(Constants.ERR_WRITING_RESPONSE, message), cf.cause());
|
||||
log.error(Constants.ERR_WRITING_RESPONSE, cf.cause());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,95 +0,0 @@
|
||||
package timely.balancer.integration;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNull;
|
||||
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
|
||||
import javax.net.ssl.HttpsURLConnection;
|
||||
import javax.net.ssl.SSLContext;
|
||||
import javax.net.ssl.SSLSocketFactory;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.experimental.categories.Category;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
import timely.balancer.configuration.BalancerHttpProperties;
|
||||
import timely.netty.http.HttpStrictTransportSecurityHandler;
|
||||
import timely.test.IntegrationTest;
|
||||
import timely.test.TimelyTestRule;
|
||||
|
||||
@Category(IntegrationTest.class)
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE)
|
||||
public class HTTPStrictTransportSecurityIT {
|
||||
|
||||
@Autowired
|
||||
@Rule
|
||||
public TimelyTestRule testRule;
|
||||
|
||||
@Autowired
|
||||
private BalancerHttpProperties httpProperties;
|
||||
|
||||
@Autowired
|
||||
protected SSLContext clientSslContext;
|
||||
|
||||
private String baseHttpUrl;
|
||||
private String baseHttpsUrl;
|
||||
private String HSTS_HEADER_VALUE;
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
baseHttpUrl = "http://" + httpProperties.getHost() + ":" + httpProperties.getPort();
|
||||
baseHttpsUrl = "https://" + httpProperties.getHost() + ":" + httpProperties.getPort();
|
||||
HSTS_HEADER_VALUE = String.format("max-age=%d; includeSubDomains; preload", httpProperties.getStrictTransportMaxAge());
|
||||
}
|
||||
|
||||
protected SSLSocketFactory getSSLSocketFactory() throws Exception {
|
||||
return clientSslContext.getSocketFactory();
|
||||
}
|
||||
|
||||
protected HttpsURLConnection getUrlConnection(URL url) throws Exception {
|
||||
HttpsURLConnection.setDefaultSSLSocketFactory(getSSLSocketFactory());
|
||||
HttpsURLConnection con = (HttpsURLConnection) url.openConnection();
|
||||
con.setHostnameVerifier((host, session) -> true);
|
||||
return con;
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testHttpRequest() throws Exception {
|
||||
URL url = new URL(baseHttpUrl + "/api/metrics");
|
||||
HttpURLConnection con = (HttpURLConnection) url.openConnection();
|
||||
con.setRequestMethod("GET");
|
||||
int responseCode = con.getResponseCode();
|
||||
assertEquals(403, responseCode);
|
||||
// should not have HSTS header on HTTP response
|
||||
assertNull(con.getHeaderField(HttpStrictTransportSecurityHandler.HSTS_HEADER_NAME));
|
||||
con.disconnect();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testHttpsRequestHSTS() throws Exception {
|
||||
URL url = new URL(baseHttpsUrl + "/version");
|
||||
HttpsURLConnection con = getUrlConnection(url);
|
||||
int responseCode = con.getResponseCode();
|
||||
assertEquals(200, responseCode);
|
||||
assertEquals(HSTS_HEADER_VALUE, con.getHeaderField(HttpStrictTransportSecurityHandler.HSTS_HEADER_NAME));
|
||||
con.disconnect();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testHttpsRequestNotFound() throws Exception {
|
||||
URL url = new URL(baseHttpsUrl);
|
||||
HttpsURLConnection con = getUrlConnection(url);
|
||||
int responseCode = con.getResponseCode();
|
||||
assertEquals(404, responseCode);
|
||||
assertEquals(HSTS_HEADER_VALUE, con.getHeaderField(HttpStrictTransportSecurityHandler.HSTS_HEADER_NAME));
|
||||
con.disconnect();
|
||||
}
|
||||
}
|
||||
@@ -62,61 +62,50 @@ timely:
|
||||
assignment-file: file://${java.io.tmpdir}/timely/balancer/assignments.csv
|
||||
server:
|
||||
ip: 127.0.0.1
|
||||
tcp-base-port: 9242
|
||||
tcp-base-port: 4242
|
||||
num-tcp-pools: 1
|
||||
tcp-buffer-size: 100
|
||||
tcp-client-pool:
|
||||
min-idle-per-key: 5
|
||||
max-idle-per-key: 5
|
||||
max-total-per-key: 5
|
||||
min-idle-per-key: 0
|
||||
max-idle-per-key: 40
|
||||
max-total-per-key: 40
|
||||
max-total: -1
|
||||
lifo: false
|
||||
fairness: true
|
||||
max-wait-millis: 60000
|
||||
min-evictable-idle-time-millis: -1
|
||||
lifo: true
|
||||
fairness: false
|
||||
max-wait-millis: -1
|
||||
min-evictable-idle-time-millis: 1800000
|
||||
evictor-shutdown-timeout-millis: 10000
|
||||
soft-min-evictable-idle-time-millis: 300000
|
||||
soft-min-evictable-idle-time-millis: -1
|
||||
num-tests-per-eviction-run: 3
|
||||
time-between-eviction-runs-millis: 30000
|
||||
time-between-eviction-runs-millis: -1
|
||||
block-when-exhausted: true
|
||||
remove-abandoned-on-borrow: false
|
||||
remove-abandoned-on-maintenance: true
|
||||
remove-abandoned-timeout-millis: 600000
|
||||
remove-abandoned-logging: true
|
||||
jmx-enabled: true
|
||||
test-on-borrow: false
|
||||
test-on-return: false
|
||||
udp-base-port: 9245
|
||||
udp-base-port: 4245
|
||||
udp-client-pool:
|
||||
min-idle-per-key: 5
|
||||
max-idle-per-key: 5
|
||||
max-total-per-key: 5
|
||||
min-idle-per-key: 0
|
||||
max-idle-per-key: 40
|
||||
max-total-per-key: 40
|
||||
max-total: -1
|
||||
lifo: false
|
||||
fairness: true
|
||||
max-wait-millis: 60000
|
||||
min-evictable-idle-time-millis: -1
|
||||
lifo: true
|
||||
fairness: false
|
||||
max-wait-millis: -1
|
||||
min-evictable-idle-time-millis: 1800000
|
||||
evictor-shutdown-timeout-millis: 10000
|
||||
soft-min-evictable-idle-time-millis: 300000
|
||||
soft-min-evictable-idle-time-millis: -1
|
||||
num-tests-per-eviction-run: 3
|
||||
time-between-eviction-runs-millis: 30000
|
||||
time-between-eviction-runs-millis: -1
|
||||
block-when-exhausted: true
|
||||
remove-abandoned-on-borrow: false
|
||||
remove-abandoned-on-maintenance: true
|
||||
remove-abandoned-timeout-millis: 600000
|
||||
remove-abandoned-logging: true
|
||||
jmx-enabled: true
|
||||
test-on-borrow: false
|
||||
test-on-return: false
|
||||
http:
|
||||
host: localhost
|
||||
ip: 127.0.0.1
|
||||
base-port: 9243
|
||||
base-port: 4243
|
||||
redirect-path: /secure-me
|
||||
strict-transport-max-age: 604800
|
||||
connection-request-timeout: 5000
|
||||
connect-timeout: 5000
|
||||
socket-timeout: 300000
|
||||
request-timeout: 300000
|
||||
cors:
|
||||
allow-any-origin: false
|
||||
allow-null-origin: false
|
||||
@@ -125,29 +114,25 @@ timely:
|
||||
allowed-methods: DELETE,GET,HEAD,OPTIONS,PUT,POST
|
||||
allowed-headers: content-type
|
||||
http-client-pool:
|
||||
min-idle-per-key: 10
|
||||
min-idle-per-key: 0
|
||||
max-idle-per-key: 40
|
||||
max-total-per-key: 40
|
||||
max-total: -1
|
||||
lifo: false
|
||||
fairness: true
|
||||
max-wait-millis: 60000
|
||||
min-evictable-idle-time-millis: -1
|
||||
lifo: true
|
||||
fairness: false
|
||||
max-wait-millis: -1
|
||||
min-evictable-idle-time-millis: 1800000
|
||||
evictor-shutdown-timeout-millis: 10000
|
||||
soft-min-evictable-idle-time-millis: 300000
|
||||
soft-min-evictable-idle-time-millis: -1
|
||||
num-tests-per-eviction-run: 3
|
||||
time-between-eviction-runs-millis: 30000
|
||||
time-between-eviction-runs-millis: -1
|
||||
block-when-exhausted: true
|
||||
remove-abandoned-on-borrow: false
|
||||
remove-abandoned-on-maintenance: true
|
||||
remove-abandoned-timeout-millis: 600000
|
||||
remove-abandoned-logging: true
|
||||
jmx-enabled: true
|
||||
test-on-borrow: false
|
||||
test-on-return: false
|
||||
websocket:
|
||||
ip: 127.0.0.1
|
||||
base-port: 9244
|
||||
base-port: 5244
|
||||
timeout: 60
|
||||
subscription-lag: 120
|
||||
scanner-batch-size: 10000
|
||||
@@ -160,19 +145,15 @@ timely:
|
||||
max-idle-per-key: 40
|
||||
max-total-per-key: 40
|
||||
max-total: -1
|
||||
lifo: false
|
||||
fairness: true
|
||||
max-wait-millis: 60000
|
||||
min-evictable-idle-time-millis: -1
|
||||
lifo: true
|
||||
fairness: false
|
||||
max-wait-millis: -1
|
||||
min-evictable-idle-time-millis: 1800000
|
||||
evictor-shutdown-timeout-millis: 10000
|
||||
soft-min-evictable-idle-time-millis: 300000
|
||||
soft-min-evictable-idle-time-millis: -1
|
||||
num-tests-per-eviction-run: 3
|
||||
time-between-eviction-runs-millis: 30000
|
||||
time-between-eviction-runs-millis: -1
|
||||
block-when-exhausted: true
|
||||
remove-abandoned-on-borrow: false
|
||||
remove-abandoned-on-maintenance: true
|
||||
remove-abandoned-timeout-millis: 600000
|
||||
remove-abandoned-logging: true
|
||||
jmx-enabled: true
|
||||
test-on-borrow: false
|
||||
test-on-return: false
|
||||
+2
-2
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<groupId>timely</groupId>
|
||||
<artifactId>timely</artifactId>
|
||||
<version>2.2.6-SNAPSHOT</version>
|
||||
<version>2.1.6-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>timely-client</artifactId>
|
||||
<properties>
|
||||
<!-- PEP 440 compliant version gets substituted into src/main/python/template/setup.py -->
|
||||
<!-- use .dev0 instead of -SNAPSHOT -->
|
||||
<python.client.version>2.2.6.dev0</python.client.version>
|
||||
<python.client.version>2.1.6.dev0</python.client.version>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
|
||||
@@ -18,27 +18,18 @@ public class TcpClient implements AutoCloseable {
|
||||
private Socket sock = null;
|
||||
private BufferedWriter out = null;
|
||||
private long connectTime = 0L;
|
||||
private long INIT_BACKOFF = 1000;
|
||||
private long MAX_BACKOFF = 60000;
|
||||
private long backoff = INIT_BACKOFF;
|
||||
private int bufferSize;
|
||||
private long latency;
|
||||
private long backoff = 2000;
|
||||
private int bufferSize = -1;
|
||||
private int writesSinceFlush = 0;
|
||||
private long lastFlushTime = System.currentTimeMillis();
|
||||
|
||||
public TcpClient(String hostname, int port) {
|
||||
this(hostname, port, -1);
|
||||
}
|
||||
|
||||
public TcpClient(String hostname, int port, int bufferSize) {
|
||||
this(hostname, port, bufferSize, -1);
|
||||
}
|
||||
|
||||
public TcpClient(String hostname, int port, int bufferSize, long latency) {
|
||||
this.host = hostname;
|
||||
this.port = port;
|
||||
this.bufferSize = bufferSize;
|
||||
this.latency = latency;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -63,54 +54,20 @@ public class TcpClient implements AutoCloseable {
|
||||
if (connect() != 0) {
|
||||
throw new IOException();
|
||||
}
|
||||
try {
|
||||
out.write(metric);
|
||||
writesSinceFlush++;
|
||||
if (bufferSize > 0 && writesSinceFlush >= bufferSize) {
|
||||
if (log.isTraceEnabled()) {
|
||||
log.trace(String.format("Flushing buffer writesSinceFlush >= %d", writesSinceFlush));
|
||||
}
|
||||
flush();
|
||||
}
|
||||
if (latency > 0 && (System.currentTimeMillis() - lastFlushTime) >= latency) {
|
||||
if (log.isTraceEnabled()) {
|
||||
log.trace(String.format("Flushing buffer timeSinceFlush >= %d", latency));
|
||||
}
|
||||
flush();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
log.error(e.getMessage(), e);
|
||||
reset();
|
||||
throw e;
|
||||
out.write(metric);
|
||||
writesSinceFlush++;
|
||||
if (bufferSize > 0 && writesSinceFlush >= bufferSize) {
|
||||
flush();
|
||||
}
|
||||
}
|
||||
|
||||
public synchronized void flush() throws IOException {
|
||||
if (null != out) {
|
||||
try {
|
||||
long start = System.currentTimeMillis();
|
||||
out.flush();
|
||||
lastFlushTime = System.currentTimeMillis();
|
||||
if (log.isTraceEnabled()) {
|
||||
log.trace(String.format("Flushed %d metrics to socket in %d ms", writesSinceFlush, (lastFlushTime - start)));
|
||||
}
|
||||
writesSinceFlush = 0;
|
||||
} catch (IOException e) {
|
||||
log.error(String.format("Failed to flush %d metrics to socket", writesSinceFlush), e);
|
||||
reset();
|
||||
throw e;
|
||||
}
|
||||
out.flush();
|
||||
writesSinceFlush = 0;
|
||||
}
|
||||
}
|
||||
|
||||
private synchronized void reset() {
|
||||
out = null;
|
||||
sock = null;
|
||||
backoff = INIT_BACKOFF;
|
||||
writesSinceFlush = 0;
|
||||
lastFlushTime = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
/**
|
||||
* Closes the tcp connection to Timely
|
||||
*
|
||||
@@ -118,8 +75,8 @@ public class TcpClient implements AutoCloseable {
|
||||
* if an error occurs
|
||||
*/
|
||||
@Override
|
||||
public synchronized void close() throws IOException {
|
||||
log.info(String.format("Shutting down connection to Timely at %s:%d", host, port));
|
||||
public void close() throws IOException {
|
||||
log.trace("Shutting down connection to Timely at {}:{}", host, port);
|
||||
if (null != sock) {
|
||||
try {
|
||||
if (null != out) {
|
||||
@@ -130,7 +87,7 @@ public class TcpClient implements AutoCloseable {
|
||||
}
|
||||
sock.close();
|
||||
} catch (IOException e) {
|
||||
log.error(String.format("Error closing connection to Timely at %s:%d", host, port), e);
|
||||
log.error("Error closing connection to Timely at " + host + ":" + port + ". Error: " + e.getMessage());
|
||||
} finally {
|
||||
sock = null;
|
||||
}
|
||||
@@ -146,10 +103,10 @@ public class TcpClient implements AutoCloseable {
|
||||
sock = new Socket(host, port);
|
||||
osw = new OutputStreamWriter(sock.getOutputStream(), StandardCharsets.UTF_8);
|
||||
out = new BufferedWriter(osw);
|
||||
backoff = INIT_BACKOFF;
|
||||
log.info(String.format("Connected to Timely at %s:%d", host, port));
|
||||
backoff = 2000;
|
||||
log.trace("Connected to Timely at {}:{}", host, port);
|
||||
} catch (Exception e) {
|
||||
log.error(String.format("Error connecting to Timely at %s:%d", host, port), e);
|
||||
log.error("Error connecting to Timely at {}:{} - {}", host, port, e.getMessage());
|
||||
if (sock != null) {
|
||||
try {
|
||||
sock.close();
|
||||
@@ -175,13 +132,12 @@ public class TcpClient implements AutoCloseable {
|
||||
out = null;
|
||||
}
|
||||
}
|
||||
backoff = Math.min(MAX_BACKOFF, backoff * 2);
|
||||
if (log.isTraceEnabled()) {
|
||||
log.trace(String.format("Will retry connection in %d ms", backoff));
|
||||
}
|
||||
backoff = backoff * 2;
|
||||
log.info("Will retry connection in {} ms.", backoff);
|
||||
return -1;
|
||||
}
|
||||
} else {
|
||||
log.warn("Not writing to Timely, waiting to reconnect");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@@ -191,22 +147,4 @@ public class TcpClient implements AutoCloseable {
|
||||
public long getConnectTime() {
|
||||
return connectTime;
|
||||
}
|
||||
|
||||
public int getWritesSinceFlush() {
|
||||
return writesSinceFlush;
|
||||
}
|
||||
|
||||
public long getTimeSinceFlush() {
|
||||
return System.currentTimeMillis() - lastFlushTime;
|
||||
}
|
||||
|
||||
public synchronized boolean isConnected() {
|
||||
boolean isConnected = (null != sock && sock.isConnected());
|
||||
if (isConnected) {
|
||||
return true;
|
||||
} else {
|
||||
int status = connect();
|
||||
return status == 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>timely</groupId>
|
||||
<artifactId>timely</artifactId>
|
||||
<version>2.1.6-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>collectd-nsq-plugin</artifactId>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>collectd</groupId>
|
||||
<artifactId>collectd-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-pool2</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpclient</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>jcl-over-slf4j</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>timely</groupId>
|
||||
<artifactId>collectd-plugin-parent</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<configuration>
|
||||
<artifactSet>
|
||||
<includes />
|
||||
</artifactSet>
|
||||
<filters>
|
||||
<filter>
|
||||
<artifact>*:*</artifact>
|
||||
<excludes>
|
||||
<exclude>**/module-info.class</exclude>
|
||||
</excludes>
|
||||
</filter>
|
||||
</filters>
|
||||
<createDependencyReducedPom>false</createDependencyReducedPom>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>shade</id>
|
||||
<goals>
|
||||
<goal>shade</goal>
|
||||
</goals>
|
||||
<phase>package</phase>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
+8
-9
@@ -1,6 +1,5 @@
|
||||
package timely.collectd.plugin;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.apache.commons.pool2.PooledObject;
|
||||
@@ -9,6 +8,7 @@ import org.apache.commons.pool2.impl.DefaultPooledObject;
|
||||
import org.apache.http.client.config.RequestConfig;
|
||||
import org.apache.http.impl.client.CloseableHttpClient;
|
||||
import org.apache.http.impl.client.HttpClientBuilder;
|
||||
import org.collectd.api.OConfigItem;
|
||||
|
||||
public class PooledCloseableHttpClientFactory implements PooledObjectFactory<CloseableHttpClient> {
|
||||
|
||||
@@ -17,25 +17,24 @@ public class PooledCloseableHttpClientFactory implements PooledObjectFactory<Clo
|
||||
private int socketTimeout = 60000; // 60 seconds in milliseconds
|
||||
private long connectionTimeToLive = 300000; // 300 seconds in milliseconds
|
||||
|
||||
public int config(Map<String,Object> configMap) {
|
||||
for (Map.Entry<String,Object> entry : configMap.entrySet()) {
|
||||
Object value = entry.getValue();
|
||||
switch (entry.getKey()) {
|
||||
public int config(OConfigItem config) {
|
||||
for (OConfigItem child : config.getChildren()) {
|
||||
switch (child.getKey()) {
|
||||
case "connectionRequestTimeout":
|
||||
case "ConnectionRequestTimeout":
|
||||
connectionRequestTimeout = Integer.parseInt((String) value);
|
||||
connectionRequestTimeout = Integer.parseInt(child.getValues().get(0).getString());
|
||||
break;
|
||||
case "connectTimeout":
|
||||
case "ConnectTimeout":
|
||||
connectTimeout = Integer.parseInt((String) value);
|
||||
connectTimeout = Integer.parseInt(child.getValues().get(0).getString());
|
||||
break;
|
||||
case "socketTimeout":
|
||||
case "SocketTimeout":
|
||||
socketTimeout = Integer.parseInt((String) value);
|
||||
socketTimeout = Integer.parseInt(child.getValues().get(0).getString());
|
||||
break;
|
||||
case "connectionTimeToLive":
|
||||
case "ConnectionTimeToLive":
|
||||
connectionTimeToLive = Long.parseLong((String) value);
|
||||
connectionTimeToLive = Long.parseLong(child.getValues().get(0).getString());
|
||||
break;
|
||||
default:
|
||||
}
|
||||
+34
-73
@@ -4,8 +4,6 @@ import java.io.ByteArrayOutputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
|
||||
import org.apache.commons.pool2.impl.GenericObjectPool;
|
||||
@@ -21,9 +19,7 @@ import org.collectd.api.CollectdConfigInterface;
|
||||
import org.collectd.api.CollectdShutdownInterface;
|
||||
import org.collectd.api.CollectdWriteInterface;
|
||||
import org.collectd.api.OConfigItem;
|
||||
import org.collectd.api.OConfigValue;
|
||||
import org.collectd.api.ValueList;
|
||||
import org.slf4j.event.Level;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -50,28 +46,14 @@ public class WriteNSQPlugin extends CollectDPluginParent implements CollectdConf
|
||||
Collectd.registerWrite(WriteNSQPlugin.class.getName(), this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(MetricData metricData) {
|
||||
try (ByteArrayOutputStream baos = new ByteArrayOutputStream(); DataOutputStream out = new DataOutputStream(baos)) {
|
||||
super.process(metricData, out);
|
||||
out.flush();
|
||||
send(baos);
|
||||
} catch (Exception e) {
|
||||
Collectd.logError("Error sending metrics to NSQ: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int write(ValueList vl) {
|
||||
MetricData metricData = new MetricData(vl);
|
||||
write(metricData);
|
||||
return 0;
|
||||
}
|
||||
|
||||
private int send(ByteArrayOutputStream baos) {
|
||||
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
DataOutputStream out = new DataOutputStream(baos);
|
||||
super.process(vl, out);
|
||||
CloseableHttpClient client = null;
|
||||
try {
|
||||
out.flush();
|
||||
HttpPost post = new HttpPost(endpoint);
|
||||
EntityBuilder request = EntityBuilder.create();
|
||||
request.setBinary(baos.toByteArray());
|
||||
@@ -104,6 +86,9 @@ public class WriteNSQPlugin extends CollectDPluginParent implements CollectdConf
|
||||
if (client != null) {
|
||||
clientPool.returnObject(client);
|
||||
}
|
||||
try {
|
||||
out.close();
|
||||
} catch (IOException e) {}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -129,39 +114,7 @@ public class WriteNSQPlugin extends CollectDPluginParent implements CollectdConf
|
||||
|
||||
@Override
|
||||
public int config(OConfigItem config) {
|
||||
Map<String,Object> configMap = new HashMap<>();
|
||||
for (OConfigItem c : config.getChildren()) {
|
||||
String key = c.getKey();
|
||||
OConfigValue value = c.getValues().get(0);
|
||||
int type = value.getType();
|
||||
if (type == 0) {
|
||||
configMap.put(key, value.getString());
|
||||
} else if (type == 1) {
|
||||
configMap.put(key, value.getNumber());
|
||||
} else if (type == 2) {
|
||||
configMap.put(key, value.getBoolean());
|
||||
}
|
||||
switch (key.toLowerCase()) {
|
||||
case "host":
|
||||
case "hostname":
|
||||
String hostString = value.getString();
|
||||
String[] hosts = hostString.split(",");
|
||||
if (hosts.length == 1) {
|
||||
host = hosts[0];
|
||||
} else {
|
||||
host = hosts[random.nextInt(hosts.length)];
|
||||
}
|
||||
break;
|
||||
case "port":
|
||||
port = Integer.parseInt(value.getString());
|
||||
break;
|
||||
case "topic":
|
||||
topic = value.getString();
|
||||
break;
|
||||
default:
|
||||
}
|
||||
}
|
||||
|
||||
super.config(config);
|
||||
GenericObjectPoolConfig<CloseableHttpClient> poolConfig = new GenericObjectPoolConfig<>();
|
||||
// use max size for maxTotal and maxIdle
|
||||
// no need to activate or passivate
|
||||
@@ -169,32 +122,40 @@ public class WriteNSQPlugin extends CollectDPluginParent implements CollectdConf
|
||||
poolConfig.setMaxIdle(POOL_MAX_SIZE);
|
||||
poolConfig.setTestOnReturn(true);
|
||||
PooledCloseableHttpClientFactory pooledCloseableHttpClientFactory = new PooledCloseableHttpClientFactory();
|
||||
pooledCloseableHttpClientFactory.config(configMap);
|
||||
pooledCloseableHttpClientFactory.config(config);
|
||||
|
||||
for (OConfigItem child : config.getChildren()) {
|
||||
switch (child.getKey()) {
|
||||
case "host":
|
||||
case "hostname":
|
||||
case "Host":
|
||||
case "HostName":
|
||||
String hostString = child.getValues().get(0).getString();
|
||||
String[] hosts = hostString.split(",");
|
||||
if (hosts.length == 1) {
|
||||
host = hosts[0];
|
||||
} else {
|
||||
host = hosts[random.nextInt(hosts.length)];
|
||||
}
|
||||
break;
|
||||
case "Port":
|
||||
case "port":
|
||||
port = Integer.parseInt(child.getValues().get(0).getString());
|
||||
break;
|
||||
case "topic":
|
||||
case "Topic":
|
||||
topic = child.getValues().get(0).getString();
|
||||
break;
|
||||
default:
|
||||
}
|
||||
}
|
||||
if (host == null || port == 0 || topic == null) {
|
||||
Collectd.logError("NSQ host, port, and topic must be configured");
|
||||
return -1;
|
||||
}
|
||||
this.clientPool = new GenericObjectPool<>(pooledCloseableHttpClientFactory, poolConfig);
|
||||
this.endpoint = "http://" + host + ":" + port + "/mpub?topic=" + topic;
|
||||
super.config(configMap);
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void log(Level level, String s) {
|
||||
// collectd must be compiled with debug enabled in order for log level debug to work
|
||||
if (isDebug()) {
|
||||
Collectd.logInfo(s);
|
||||
} else {
|
||||
if (level.equals(Level.DEBUG)) {
|
||||
Collectd.logDebug(s);
|
||||
} else if (level.equals(Level.INFO)) {
|
||||
Collectd.logInfo(s);
|
||||
} else if (level.equals(Level.WARN)) {
|
||||
Collectd.logWarning(s);
|
||||
} else if (level.equals(Level.ERROR)) {
|
||||
Collectd.logError(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>timely</groupId>
|
||||
<artifactId>timely</artifactId>
|
||||
<version>2.1.6-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>collectd-plugin-parent</artifactId>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>collectd</groupId>
|
||||
<artifactId>collectd-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.jcip</groupId>
|
||||
<artifactId>jcip-annotations</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.powermock</groupId>
|
||||
<artifactId>powermock-easymock-release-full</artifactId>
|
||||
<classifier>full</classifier>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
+112
-148
@@ -1,25 +1,20 @@
|
||||
package timely.collectd.plugin;
|
||||
|
||||
import static org.slf4j.event.Level.DEBUG;
|
||||
import static org.slf4j.event.Level.WARN;
|
||||
|
||||
import java.io.OutputStream;
|
||||
import java.text.MessageFormat;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.TreeMap;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import org.collectd.api.Collectd;
|
||||
import org.collectd.api.OConfigItem;
|
||||
import org.collectd.api.ValueList;
|
||||
|
||||
import timely.util.Exclusions;
|
||||
|
||||
public abstract class CollectDPluginParent implements WritesMetrics, PluginLogger {
|
||||
public abstract class CollectDPluginParent {
|
||||
|
||||
private static final String PUT = "put {0} {1} {2} {3}";
|
||||
private static final String INSTANCE = "instance";
|
||||
@@ -27,44 +22,41 @@ public abstract class CollectDPluginParent implements WritesMetrics, PluginLogge
|
||||
private static final String SAMPLE_TYPE = "sampleType";
|
||||
private static final String CODE = "code";
|
||||
private static final String PERIOD = ".";
|
||||
private static final String COUNTER = "COUNTER";
|
||||
private static final String GAUGE = "GAUGE";
|
||||
private static final String DERIVE = "DERIVE";
|
||||
private static final String ABSOLUTE = "ABSOLUTE";
|
||||
private static final Collection<String> HADOOP_CONTEXTS = Arrays.asList("NameNode", "DataNode", "JobManager", "NodeManager", "JobHistoryServer",
|
||||
"ResourceManager", "MRAppMaster", "JvmMetrics", "MapTask", "ReduceTask");
|
||||
"ResourceManager", "MRAppMaster");
|
||||
private static final Pattern HADOOP_PATTERN_4_GROUPS = Pattern.compile("([\\w-_]+)\\.([\\w-_]+)\\.([\\w-_]+)\\.([\\w-_]+)");
|
||||
private static final Pattern STATSD_PATTERN_3_GROUPS = Pattern.compile("([\\w-_]+)\\.([\\w-_]+)\\.([\\w-_]+)");
|
||||
private static final Pattern STATSD_PATTERN_4_GROUPS = Pattern.compile("([\\w-_]+)\\.([\\w-_]+)\\.([\\w-_]+)\\.([\\w-_]+)");
|
||||
private static final Pattern STATSD_PATTERN_6_GROUPS = Pattern.compile("([\\w-_]+)\\.([\\w-_]+)\\.([\\w-_]+)\\.([\\w-_]+)\\.([\\w-_#]+)\\.([\\w-_]+)");
|
||||
private static final Pattern ETHSTAT_QUEUE_PATTERN1 = Pattern.compile("([\\w-_]*)queue_([0-9]+)_([\\w-_]+)");
|
||||
private static final Pattern ETHSTAT_QUEUE_PATTERN2 = Pattern.compile("([\\w-_\\.]*)(tx|rx)([-_]?)([0-9]+)([._])([\\w-_]+)");
|
||||
private static final Pattern ETHSTAT_TRAFFIC_CLASS_PATTERN = Pattern.compile("([\\w-_\\.]*)(tc)([-_]?)([0-9]+)([._])([\\w-_]+)");
|
||||
private static final Pattern ETHSTAT_CHANNEL_PATTERN = Pattern.compile("(ch)([0-9]+)([._])([\\w-_]+)");
|
||||
private static final Pattern ETHSTAT_PATTERN = Pattern.compile("([\\w-_]+)_queue_([\\w-_]+)_([\\w-_]+)");
|
||||
private static final String STATSD_PREFIX = "statsd";
|
||||
private static final String NSQ_PREFIX = STATSD_PREFIX + ".nsq.";
|
||||
private static final Pattern HAPROXY_PATTERN = Pattern.compile("\\[([\\w-_=]+),([\\w-_=]+)\\]");
|
||||
|
||||
private final SMARTCodeMapping smart = new SMARTCodeMapping();
|
||||
protected Map<String,String> additionalTags = new TreeMap<>();
|
||||
protected Map<String,String> addlTags = new TreeMap<>();
|
||||
private boolean debug = false;
|
||||
private Exclusions exclusions = new Exclusions();
|
||||
|
||||
public int config(Map<String,Object> configMap) {
|
||||
for (Map.Entry<String,Object> entry : configMap.entrySet()) {
|
||||
switch (entry.getKey().toLowerCase()) {
|
||||
public int config(OConfigItem config) {
|
||||
for (OConfigItem child : config.getChildren()) {
|
||||
switch (child.getKey()) {
|
||||
case "Tags":
|
||||
case "tags":
|
||||
String tagValue = (String) entry.getValue();
|
||||
String tagValue = child.getValues().get(0).getString();
|
||||
Arrays.stream(tagValue.split(",")).map(String::trim).forEach(p -> {
|
||||
String[] pair = p.split("=");
|
||||
if (pair.length == 2) {
|
||||
addTag(additionalTags, pair[0], pair[1]);
|
||||
addTag(addlTags, pair[0], pair[1]);
|
||||
}
|
||||
});
|
||||
break;
|
||||
case "filteredmetricsfile":
|
||||
setFilteredMetricsFile((String) entry.getValue());
|
||||
break;
|
||||
case "filteredtagsfile":
|
||||
setFilteredTagsFile((String) entry.getValue());
|
||||
break;
|
||||
case "Debug":
|
||||
case "debug":
|
||||
debug = (Boolean) entry.getValue();
|
||||
debug = child.getValues().get(0).getBoolean();
|
||||
break;
|
||||
default:
|
||||
}
|
||||
@@ -72,22 +64,6 @@ public abstract class CollectDPluginParent implements WritesMetrics, PluginLogge
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void setAdditionalTags(Map<String,String> additionalTags) {
|
||||
this.additionalTags = additionalTags;
|
||||
}
|
||||
|
||||
public void setFilteredMetricsFile(String filteredMetricsFile) {
|
||||
if (StringUtils.isNotBlank(filteredMetricsFile)) {
|
||||
exclusions.setFilteredMetricsFile(filteredMetricsFile);
|
||||
}
|
||||
}
|
||||
|
||||
public void setFilteredTagsFile(String filteredTagsFile) {
|
||||
if (StringUtils.isNotBlank(filteredTagsFile)) {
|
||||
exclusions.setFilteredTagsFile(filteredTagsFile);
|
||||
}
|
||||
}
|
||||
|
||||
public abstract void write(String metric, OutputStream out);
|
||||
|
||||
protected void addTag(Map<String,String> m, String k, String v) {
|
||||
@@ -107,12 +83,22 @@ public abstract class CollectDPluginParent implements WritesMetrics, PluginLogge
|
||||
}
|
||||
}
|
||||
|
||||
public void process(MetricData metricData, OutputStream out) {
|
||||
debugMetricData(metricData);
|
||||
StringBuilder metric = new StringBuilder();
|
||||
Map<String,String> tagMap = new TreeMap<>();
|
||||
public void process(ValueList vl, OutputStream out) {
|
||||
try {
|
||||
processInternal(vl, out);
|
||||
} catch (Exception e) {
|
||||
Collectd.logError(e.getMessage());
|
||||
e.printStackTrace(System.err);
|
||||
}
|
||||
}
|
||||
|
||||
String host = metricData.getHost();
|
||||
private void processInternal(ValueList vl, OutputStream out) {
|
||||
debugValueList(vl);
|
||||
|
||||
StringBuilder metric = new StringBuilder();
|
||||
Long timestamp = vl.getTime();
|
||||
Map<String,String> tagMap = new TreeMap<>();
|
||||
String host = vl.getHost();
|
||||
int idx = host.indexOf(PERIOD);
|
||||
if (-1 != idx) {
|
||||
addTag(tagMap, "host", host.substring(0, idx));
|
||||
@@ -124,24 +110,23 @@ public abstract class CollectDPluginParent implements WritesMetrics, PluginLogge
|
||||
if (-1 != nIdx) {
|
||||
addTag(tagMap, "rack", hostSplit[0].substring(0, nIdx));
|
||||
}
|
||||
tagMap.putAll(additionalTags);
|
||||
tagMap.putAll(addlTags);
|
||||
|
||||
String plugin = metricData.getPlugin();
|
||||
String pluginInstance = metricData.getPluginInstance();
|
||||
String type = metricData.getType();
|
||||
String typeInstance = metricData.getTypeInstance();
|
||||
List<Pair<Double,String>> values = metricData.getValuePairs();
|
||||
String plugin = vl.getPlugin();
|
||||
String pluginInstance = vl.getPluginInstance();
|
||||
String type = vl.getType();
|
||||
String typeInstance = vl.getTypeInstance();
|
||||
|
||||
switch (plugin) {
|
||||
case STATSD_PREFIX:
|
||||
Matcher hadoop_4_groups = HADOOP_PATTERN_4_GROUPS.matcher(typeInstance);
|
||||
Matcher statsd_3_groups = STATSD_PATTERN_3_GROUPS.matcher(typeInstance);
|
||||
Matcher statsd_4_groups = STATSD_PATTERN_4_GROUPS.matcher(typeInstance);
|
||||
Matcher statsd_6_groups = STATSD_PATTERN_6_GROUPS.matcher(typeInstance);
|
||||
String instance = null;
|
||||
boolean defaultCase = false;
|
||||
if (!typeInstance.startsWith("nsq")) {
|
||||
String[] parts = typeInstance.split("\\.");
|
||||
if (parts.length >= 4 && HADOOP_CONTEXTS.contains(parts[0])) {
|
||||
if (parts.length >= 4 && (HADOOP_CONTEXTS.contains(parts[0]) || hadoop_4_groups.matches())) {
|
||||
// Here we are processing the statsd metrics coming from the Hadoop Metrics2 StatsDSink without the host name.
|
||||
// The format of metric is: serviceName.contextName.recordName.metricName
|
||||
// The serviceName is used as the instance.
|
||||
@@ -175,39 +160,28 @@ public abstract class CollectDPluginParent implements WritesMetrics, PluginLogge
|
||||
int x = typeInstance.indexOf(".");
|
||||
metric.append(STATSD_PREFIX).append(PERIOD).append(typeInstance.substring(x + 1));
|
||||
addTag(tagMap, "queryId", parts[0]);
|
||||
} else if (parts.length % 2 == 1) {
|
||||
// EtsyStatsD format -- metric.(tagName.tagValue)*
|
||||
metric.append(STATSD_PREFIX).append(PERIOD).append(parts[0]);
|
||||
for (int x = 1; x < parts.length; x += 2) {
|
||||
addTag(tagMap, parts[x], parts[x + 1]);
|
||||
}
|
||||
} else if (statsd_4_groups.matches()) {
|
||||
// Here we are processing the statsd metrics coming from the Hadoop Metrics2 StatsDSink without the host name.
|
||||
// The format of metric is: serviceName.contextName.recordName.metricName. The recordName is typically duplicative
|
||||
// and is dropped here. The serviceName is used as the instance.
|
||||
metric.append(STATSD_PREFIX).append(PERIOD).append(statsd_4_groups.group(2)).append(PERIOD).append(statsd_4_groups.group(4));
|
||||
instance = statsd_4_groups.group(1);
|
||||
} else if (parts.length >= 1) {
|
||||
// EtsyStatsD format -- metric.(tagName.tagValue)*
|
||||
// Will handle all key.value pairs and truncate at the end if line was malformed or truncated
|
||||
metric.append(STATSD_PREFIX).append(PERIOD).append(parts[0]);
|
||||
for (int x = 1; x + 1 < parts.length; x += 2) {
|
||||
addTag(tagMap, parts[x], parts[x + 1]);
|
||||
}
|
||||
if (parts.length % 2 == 0) {
|
||||
log(DEBUG, String.format("Using available tags from malformed/truncated line %s", typeInstance));
|
||||
}
|
||||
} else {
|
||||
defaultCase = true;
|
||||
}
|
||||
} else if (statsd_3_groups.matches()) {
|
||||
metric.append(NSQ_PREFIX).append(statsd_3_groups.group(2)).append(PERIOD).append(statsd_3_groups.group(3));
|
||||
} else if (statsd_4_groups.matches()) {
|
||||
metric.append(NSQ_PREFIX).append(statsd_4_groups.group(2)).append(PERIOD).append(statsd_4_groups.group(4));
|
||||
instance = statsd_4_groups.group(3);
|
||||
} else if (statsd_6_groups.matches()) {
|
||||
metric.append(NSQ_PREFIX).append(statsd_6_groups.group(4)).append(PERIOD).append(statsd_6_groups.group(6));
|
||||
instance = statsd_6_groups.group(5);
|
||||
} else {
|
||||
if (statsd_3_groups.matches()) {
|
||||
metric.append(NSQ_PREFIX).append(statsd_3_groups.group(2)).append(PERIOD).append(statsd_3_groups.group(3));
|
||||
} else if (statsd_4_groups.matches()) {
|
||||
metric.append(NSQ_PREFIX).append(statsd_4_groups.group(2)).append(PERIOD).append(statsd_4_groups.group(4));
|
||||
instance = statsd_4_groups.group(3);
|
||||
} else if (statsd_6_groups.matches()) {
|
||||
metric.append(NSQ_PREFIX).append(statsd_6_groups.group(4)).append(PERIOD).append(statsd_6_groups.group(6));
|
||||
instance = statsd_6_groups.group(5);
|
||||
} else {
|
||||
defaultCase = true;
|
||||
}
|
||||
}
|
||||
if (defaultCase) {
|
||||
// Handle StatsD metrics of unknown formats. If there is a
|
||||
// period in the metric name, use everything up to that as
|
||||
// the instance.
|
||||
@@ -225,39 +199,13 @@ public abstract class CollectDPluginParent implements WritesMetrics, PluginLogge
|
||||
break;
|
||||
case "ethstat":
|
||||
metric.append("sys.ethstat.");
|
||||
if (typeInstance.matches(ETHSTAT_QUEUE_PATTERN1.pattern())) {
|
||||
Matcher ethstat_m = ETHSTAT_QUEUE_PATTERN1.matcher(typeInstance);
|
||||
if (typeInstance.contains("queue")) {
|
||||
Matcher ethstat_m = ETHSTAT_PATTERN.matcher(typeInstance);
|
||||
if (ethstat_m.matches()) {
|
||||
metric.append(ethstat_m.group(1));
|
||||
metric.append("queue_");
|
||||
metric.append(ethstat_m.group(3));
|
||||
metric.append(ethstat_m.group(1)).append("_").append(ethstat_m.group(3));
|
||||
addTag(tagMap, "queue", ethstat_m.group(2));
|
||||
}
|
||||
} else if (typeInstance.matches(ETHSTAT_QUEUE_PATTERN2.pattern())) {
|
||||
Matcher ethstat_m = ETHSTAT_QUEUE_PATTERN2.matcher(typeInstance);
|
||||
if (ethstat_m.matches()) {
|
||||
metric.append(ethstat_m.group(1));
|
||||
metric.append(ethstat_m.group(2));
|
||||
metric.append("_queue_");
|
||||
metric.append(ethstat_m.group(6));
|
||||
addTag(tagMap, "queue", ethstat_m.group(4));
|
||||
}
|
||||
} else if (typeInstance.matches(ETHSTAT_TRAFFIC_CLASS_PATTERN.pattern())) {
|
||||
Matcher ethstat_m = ETHSTAT_TRAFFIC_CLASS_PATTERN.matcher(typeInstance);
|
||||
if (ethstat_m.matches()) {
|
||||
metric.append(ethstat_m.group(1));
|
||||
metric.append(ethstat_m.group(2));
|
||||
metric.append(ethstat_m.group(5));
|
||||
metric.append(ethstat_m.group(6));
|
||||
addTag(tagMap, "trafficClass", ethstat_m.group(4));
|
||||
}
|
||||
} else if (typeInstance.matches(ETHSTAT_CHANNEL_PATTERN.pattern())) {
|
||||
Matcher ethstat_m = ETHSTAT_CHANNEL_PATTERN.matcher(typeInstance);
|
||||
if (ethstat_m.matches()) {
|
||||
metric.append(ethstat_m.group(1));
|
||||
metric.append("_");
|
||||
metric.append(ethstat_m.group(4));
|
||||
addTag(tagMap, "channel", ethstat_m.group(2));
|
||||
} else {
|
||||
metric.append(typeInstance);
|
||||
}
|
||||
} else {
|
||||
metric.append(typeInstance);
|
||||
@@ -296,10 +244,10 @@ public abstract class CollectDPluginParent implements WritesMetrics, PluginLogge
|
||||
break;
|
||||
case "haproxy":
|
||||
metric.append("sys.haproxy.").append(typeInstance);
|
||||
Matcher haproxy_m = HAPROXY_PATTERN.matcher(pluginInstance);
|
||||
if (haproxy_m.matches()) {
|
||||
addTag(tagMap, haproxy_m.group(1));
|
||||
addTag(tagMap, haproxy_m.group(2));
|
||||
Matcher hadoop_m2 = HAPROXY_PATTERN.matcher(pluginInstance);
|
||||
if (hadoop_m2.matches()) {
|
||||
addTag(tagMap, hadoop_m2.group(1));
|
||||
addTag(tagMap, hadoop_m2.group(2));
|
||||
}
|
||||
break;
|
||||
case "ipmi":
|
||||
@@ -311,9 +259,7 @@ public abstract class CollectDPluginParent implements WritesMetrics, PluginLogge
|
||||
metric.append("sys.load.").append(plugin).append(PERIOD).append(type);
|
||||
// plugin returns 1 min, 5 min, 15 min averages, but Timely can
|
||||
// downsample on its own so we only use the first (1 min) value
|
||||
Pair<Double,String> first = values.get(0);
|
||||
values.clear();
|
||||
values.add(first);
|
||||
vl.setValues(Arrays.asList(vl.getValues().get(0)));
|
||||
break;
|
||||
case "GenericJMX":
|
||||
metric.append("sys.").append(plugin).append(PERIOD).append(type).append(PERIOD).append(typeInstance);
|
||||
@@ -337,59 +283,77 @@ public abstract class CollectDPluginParent implements WritesMetrics, PluginLogge
|
||||
} else if (notEmpty(type) && notEmpty(plugin)) {
|
||||
metric.append("sys.").append(plugin).append(PERIOD).append(type);
|
||||
} else {
|
||||
log(WARN, "Unhandled metric: " + metricData);
|
||||
Collectd.logWarning("Unhandled metric: " + vl);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
}
|
||||
final String metricName = metric.toString().replaceAll(" ", "_");
|
||||
for (Pair<Double,String> pair : values) {
|
||||
addTag(tagMap, SAMPLE_TYPE, pair.getRight());
|
||||
Double value = pair.getLeft();
|
||||
Long timestamp = metricData.getTimestamp();
|
||||
for (int i = 0; i < vl.getValues().size(); i++) {
|
||||
int dataSourceSampleType = vl.getDataSet().getDataSources().get(i).getType();
|
||||
String sampleType = convertType(dataSourceSampleType);
|
||||
if (null != sampleType) {
|
||||
addTag(tagMap, SAMPLE_TYPE, sampleType);
|
||||
}
|
||||
Double value = vl.getValues().get(i).doubleValue();
|
||||
String tagString = tagMap.entrySet().stream().map(e -> e.getKey() + "=" + e.getValue()).collect(Collectors.joining(" "));
|
||||
|
||||
if (metricName.isBlank() || timestamp == null || value == null) {
|
||||
log(DEBUG, String.format("Not writing unhandled metric: plugin:%s pluginInstance:%s type:%s typeInstance:%s", plugin, pluginInstance, type,
|
||||
logDebug(String.format("Not writing unhandled metric: plugin:%s pluginInstance:%s type:%s typeInstance:%s", plugin, pluginInstance, type,
|
||||
typeInstance));
|
||||
} else {
|
||||
String datapoint = MessageFormat.format(PUT, metricName, timestamp.toString(), value.toString(), tagString);
|
||||
if (exclusions.filterMetric(datapoint)) {
|
||||
log(DEBUG, String.format("Not writing excluded metric: %s", datapoint));
|
||||
} else {
|
||||
datapoint = exclusions.filterExcludedTags(datapoint);
|
||||
log(DEBUG, String.format("Writing: %s", datapoint));
|
||||
write(datapoint + "\n", out);
|
||||
}
|
||||
logDebug(String.format("Writing: %s", datapoint));
|
||||
write(datapoint + "\n", out);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void debugMetricData(MetricData metricData) {
|
||||
private void logDebug(String s) {
|
||||
// collectd must be compiled with debug enabled in order for log level debug to work
|
||||
if (debug) {
|
||||
Collectd.logInfo(s);
|
||||
} else {
|
||||
Collectd.logDebug(s);
|
||||
}
|
||||
}
|
||||
|
||||
private void debugValueList(ValueList vl) {
|
||||
try {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(String.format("Plugin:%s", metricData.getPlugin()));
|
||||
if (metricData.getPluginInstance() != null && !metricData.getPluginInstance().isBlank()) {
|
||||
sb.append(String.format(" PluginInstance:%s", metricData.getPluginInstance()));
|
||||
sb.append(String.format("Plugin:%s", vl.getPlugin()));
|
||||
if (vl.getPluginInstance() != null && !vl.getPluginInstance().isBlank()) {
|
||||
sb.append(String.format(" PluginInstance:%s", vl.getPluginInstance()));
|
||||
}
|
||||
sb.append(String.format(" Type:%s", metricData.getType()));
|
||||
sb.append(String.format(" TypeInstance:%s", metricData.getTypeInstance()));
|
||||
for (int i = 0; i < metricData.getValuePairs().size(); i++) {
|
||||
Pair<Double,String> value = metricData.getValuePairs().get(i);
|
||||
sb.append(String.format(" Value:%s", value.getLeft().toString()));
|
||||
sb.append(String.format(" Type:%s", vl.getType()));
|
||||
sb.append(String.format(" TypeInstance:%s", vl.getTypeInstance()));
|
||||
for (int i = 0; i < vl.getValues().size(); i++) {
|
||||
Number value = vl.getValues().get(i);
|
||||
sb.append(String.format(" Value:%s", value.toString()));
|
||||
}
|
||||
log(DEBUG, sb.toString());
|
||||
logDebug(sb.toString());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log(DEBUG, e.getMessage());
|
||||
logDebug(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
private String convertType(int type) {
|
||||
switch (type) {
|
||||
case 0:
|
||||
return COUNTER;
|
||||
case 1:
|
||||
return GAUGE;
|
||||
case 2:
|
||||
return DERIVE;
|
||||
case 3:
|
||||
return ABSOLUTE;
|
||||
default:
|
||||
return GAUGE;
|
||||
}
|
||||
}
|
||||
|
||||
private boolean notEmpty(String arg) {
|
||||
return (null != arg) && !(arg.equals(""));
|
||||
}
|
||||
|
||||
public boolean isDebug() {
|
||||
return debug;
|
||||
}
|
||||
}
|
||||
File renamed without changes.
+46
-164
@@ -3,7 +3,6 @@ package timely.collectd.plugin;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import java.io.OutputStream;
|
||||
import java.net.URL;
|
||||
import java.util.Collections;
|
||||
|
||||
import org.collectd.api.Collectd;
|
||||
@@ -14,23 +13,20 @@ import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.powermock.api.easymock.PowerMock;
|
||||
import org.powermock.core.classloader.annotations.PowerMockIgnore;
|
||||
import org.powermock.core.classloader.annotations.PrepareForTest;
|
||||
import org.powermock.modules.junit4.PowerMockRunner;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.slf4j.event.Level;
|
||||
|
||||
import net.jcip.annotations.NotThreadSafe;
|
||||
|
||||
@RunWith(PowerMockRunner.class)
|
||||
@PowerMockIgnore("jdk.internal.reflect.*")
|
||||
@PrepareForTest({Collectd.class})
|
||||
@NotThreadSafe
|
||||
public class PluginParentTest {
|
||||
|
||||
public class TestPlugin extends CollectDPluginParent {
|
||||
private Logger log = LoggerFactory.getLogger(this.getClass().getName());
|
||||
|
||||
public TestPlugin() {
|
||||
super.additionalTags.put("addl1", "foo");
|
||||
super.addlTags.put("addl1", "foo");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -38,19 +34,6 @@ public class PluginParentTest {
|
||||
result = metric;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void log(Level level, String s) {
|
||||
log.debug(s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(MetricData metricData) {
|
||||
try {
|
||||
process(metricData, null);
|
||||
} catch (Exception e) {
|
||||
log(Level.ERROR, e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static final String HOST = "r01n01.test";
|
||||
@@ -58,13 +41,12 @@ public class PluginParentTest {
|
||||
public String result = null;
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
result = null;
|
||||
public void setup() throws Exception {
|
||||
PowerMock.suppress(PowerMock.everythingDeclaredIn(Collectd.class));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testStatsDHadoopFormat() {
|
||||
public void testStatsDHadoopFormat() throws Exception {
|
||||
ValueList vl = new ValueList();
|
||||
vl.setHost(HOST);
|
||||
vl.setPlugin("statsd");
|
||||
@@ -77,12 +59,12 @@ public class PluginParentTest {
|
||||
vl.setDataSet(ds);
|
||||
|
||||
TestPlugin test = new TestPlugin();
|
||||
test.write(new MetricData(vl));
|
||||
assertEquals("put statsd.dfs.BlocksRead 1456156976840 1.0 addl1=foo host=r01n01 instance=DataNode rack=r01 sampleType=GAUGE\n", result);
|
||||
test.process(vl, null);
|
||||
assertEquals("put statsd.dfs.BlocksRead 1456156976840 1.0 host=r01n01 rack=r01 addl1=foo instance=DataNode sample=value sampleType=GAUGE\n", result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testStatsDUnknownFormat() {
|
||||
public void testStatsDUnknownFormat() throws Exception {
|
||||
ValueList vl = new ValueList();
|
||||
vl.setHost(HOST);
|
||||
vl.setPlugin("statsd");
|
||||
@@ -95,12 +77,12 @@ public class PluginParentTest {
|
||||
vl.setDataSet(ds);
|
||||
|
||||
TestPlugin test = new TestPlugin();
|
||||
test.write(new MetricData(vl));
|
||||
assertEquals("put statsd.baz 1456156976840 1.0 addl1=foo host=r01n01 rack=r01 sampleType=GAUGE\n", result);
|
||||
test.process(vl, null);
|
||||
assertEquals("put statsd.baz 1456156976840 1.0 host=r01n01 rack=r01 addl1=foo sample=value sampleType=GAUGE\n", result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testStatsDUnknownFormat2() {
|
||||
public void testStatsDUnknownFormat2() throws Exception {
|
||||
ValueList vl = new ValueList();
|
||||
vl.setHost(HOST);
|
||||
vl.setPlugin("statsd");
|
||||
@@ -113,12 +95,12 @@ public class PluginParentTest {
|
||||
vl.setDataSet(ds);
|
||||
|
||||
TestPlugin test = new TestPlugin();
|
||||
test.write(new MetricData(vl));
|
||||
assertEquals("put statsd.bar 1456156976840 1.0 addl1=foo host=r01n01 rack=r01 sampleType=GAUGE\n", result);
|
||||
test.process(vl, null);
|
||||
assertEquals("put statsd.baz 1456156976840 1.0 host=r01n01 rack=r01 addl1=foo instance=bar sample=value sampleType=GAUGE\n", result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testHddTemp() {
|
||||
public void testHddTemp() throws Exception {
|
||||
ValueList vl = new ValueList();
|
||||
vl.setHost(HOST);
|
||||
vl.setPlugin("hddtemp");
|
||||
@@ -131,12 +113,12 @@ public class PluginParentTest {
|
||||
vl.setDataSet(ds);
|
||||
|
||||
TestPlugin test = new TestPlugin();
|
||||
test.write(new MetricData(vl));
|
||||
assertEquals("put sys.hddtemp.temperature 1456156976840 35.0 addl1=foo host=r01n01 instance=sda rack=r01 sampleType=GAUGE\n", result);
|
||||
test.process(vl, null);
|
||||
assertEquals("put sys.hddtemp.temperature 1456156976840 35.0 host=r01n01 rack=r01 addl1=foo instance=sda sample=value sampleType=GAUGE\n", result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSmart1() {
|
||||
public void testSmart1() throws Exception {
|
||||
ValueList vl = new ValueList();
|
||||
vl.setHost(HOST);
|
||||
vl.setPlugin("smart");
|
||||
@@ -149,12 +131,12 @@ public class PluginParentTest {
|
||||
vl.setDataSet(ds);
|
||||
|
||||
TestPlugin test = new TestPlugin();
|
||||
test.write(new MetricData(vl));
|
||||
assertEquals("put sys.smart.smart_badsectors 1456156976840 0.0 addl1=foo host=r01n01 instance=sda rack=r01 sampleType=GAUGE\n", result);
|
||||
test.process(vl, null);
|
||||
assertEquals("put sys.smart.smart_badsectors 1456156976840 0.0 host=r01n01 rack=r01 addl1=foo instance=sda sample=value sampleType=GAUGE\n", result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSmart2() {
|
||||
public void testSmart2() throws Exception {
|
||||
ValueList vl = new ValueList();
|
||||
vl.setHost(HOST);
|
||||
vl.setPlugin("smart");
|
||||
@@ -168,12 +150,12 @@ public class PluginParentTest {
|
||||
vl.setDataSet(ds);
|
||||
|
||||
TestPlugin test = new TestPlugin();
|
||||
test.write(new MetricData(vl));
|
||||
assertEquals("put sys.smart.raw-read-error-rate 1456156976840 0.0 addl1=foo host=r01n01 instance=sda rack=r01 sampleType=GAUGE\n", result);
|
||||
test.process(vl, null);
|
||||
assertEquals("put sys.smart.raw-read-error-rate 1456156976840 0.0 host=r01n01 rack=r01 addl1=foo instance=sda sample=value sampleType=GAUGE\n", result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSmartCode() {
|
||||
public void testSmartCode() throws Exception {
|
||||
ValueList vl = new ValueList();
|
||||
vl.setHost(HOST);
|
||||
vl.setPlugin("smart");
|
||||
@@ -187,12 +169,13 @@ public class PluginParentTest {
|
||||
vl.setDataSet(ds);
|
||||
|
||||
TestPlugin test = new TestPlugin();
|
||||
test.write(new MetricData(vl));
|
||||
assertEquals("put sys.smart.Total_LBAs_Read 1456156976840 0.0 addl1=foo code=242 host=r01n01 instance=sda rack=r01 sampleType=GAUGE\n", result);
|
||||
test.process(vl, null);
|
||||
assertEquals("put sys.smart.Total_LBAs_Read 1456156976840 0.0 host=r01n01 rack=r01 addl1=foo code=242 instance=sda sample=value sampleType=GAUGE\n",
|
||||
result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSnmp() {
|
||||
public void testSnmp() throws Exception {
|
||||
ValueList vl = new ValueList();
|
||||
vl.setHost(HOST);
|
||||
vl.setPlugin("snmp");
|
||||
@@ -206,8 +189,8 @@ public class PluginParentTest {
|
||||
vl.setDataSet(ds);
|
||||
|
||||
TestPlugin test = new TestPlugin();
|
||||
test.write(new MetricData(vl));
|
||||
assertEquals("put sys.snmp.if_octets 1456156976840 0.0 addl1=foo host=r01n01 instance=Ethernet1 rack=r01 sampleType=GAUGE\n", result);
|
||||
test.process(vl, null);
|
||||
assertEquals("put sys.snmp.if_octets 1456156976840 0.0 host=r01n01 rack=r01 addl1=foo instance=Ethernet1 sample=value sampleType=GAUGE\n", result);
|
||||
|
||||
}
|
||||
|
||||
@@ -226,8 +209,9 @@ public class PluginParentTest {
|
||||
vl.setDataSet(ds);
|
||||
|
||||
TestPlugin test = new TestPlugin();
|
||||
test.write(new MetricData(vl));
|
||||
assertEquals("put sys.sensors.temperature.coretemp-isa-0000 1456156976840 35.0 addl1=foo host=r01n01 instance=1 rack=r01 sampleType=GAUGE\n", result);
|
||||
test.process(vl, null);
|
||||
assertEquals("put sys.sensors.temperature.coretemp-isa-0000 1456156976840 35.0 host=r01n01 rack=r01 addl1=foo instance=1 sample=value sampleType=GAUGE\n",
|
||||
result);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -244,8 +228,8 @@ public class PluginParentTest {
|
||||
vl.setDataSet(ds);
|
||||
|
||||
TestPlugin test = new TestPlugin();
|
||||
test.write(new MetricData(vl));
|
||||
assertEquals("put sys.haproxy.run_queue 1456156976840 0.0 addl1=foo host=r01n01 rack=r01 sampleType=GAUGE\n", result);
|
||||
test.process(vl, null);
|
||||
assertEquals("put sys.haproxy.run_queue 1456156976840 0.0 host=r01n01 rack=r01 addl1=foo sample=value sampleType=GAUGE\n", result);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -263,8 +247,8 @@ public class PluginParentTest {
|
||||
vl.setDataSet(ds);
|
||||
|
||||
TestPlugin test = new TestPlugin();
|
||||
test.write(new MetricData(vl));
|
||||
assertEquals("put sys.haproxy.queue_current 1456156976840 0.0 addl1=foo host=r01n01 proxy_name=proxy1 rack=r01 sampleType=GAUGE service_name=server1\n",
|
||||
test.process(vl, null);
|
||||
assertEquals("put sys.haproxy.queue_current 1456156976840 0.0 host=r01n01 rack=r01 addl1=foo proxy_name=proxy1 service_name=server1 sample=value sampleType=GAUGE\n",
|
||||
result);
|
||||
}
|
||||
|
||||
@@ -283,104 +267,30 @@ public class PluginParentTest {
|
||||
vl.setDataSet(ds);
|
||||
|
||||
TestPlugin test = new TestPlugin();
|
||||
test.write(new MetricData(vl));
|
||||
assertEquals("put sys.ethstat.tx_comp_queue_full 1456156976840 6.0 addl1=foo host=r01n01 instance=eth0 rack=r01 sampleType=GAUGE\n", result);
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testEthstatWithQueueStyle1() {
|
||||
ValueList vl = new ValueList();
|
||||
vl.setHost(HOST);
|
||||
vl.setPlugin("ethstat");
|
||||
vl.setPluginInstance("eth0");
|
||||
vl.setTime(TIME);
|
||||
vl.setType("derive");
|
||||
vl.setTypeInstance("rx_queue_15_bytes");
|
||||
vl.setValues(Collections.singletonList((Number) 6.0D));
|
||||
DataSet ds = new DataSet("DERIVE");
|
||||
ds.addDataSource(new DataSource("value", 1, 6.0D, 100.0D));
|
||||
vl.setDataSet(ds);
|
||||
|
||||
TestPlugin test = new TestPlugin();
|
||||
test.write(new MetricData(vl));
|
||||
assertEquals("put sys.ethstat.rx_queue_bytes 1456156976840 6.0 addl1=foo host=r01n01 instance=eth0 queue=15 rack=r01 sampleType=GAUGE\n", result);
|
||||
|
||||
result = null;
|
||||
vl.setTypeInstance("queue_7_tx_bytes");
|
||||
test.write(new MetricData(vl));
|
||||
assertEquals("put sys.ethstat.queue_tx_bytes 1456156976840 6.0 addl1=foo host=r01n01 instance=eth0 queue=7 rack=r01 sampleType=GAUGE\n", result);
|
||||
|
||||
result = null;
|
||||
vl.setTypeInstance("queue_7_rx_xdp_drop");
|
||||
test.write(new MetricData(vl));
|
||||
assertEquals("put sys.ethstat.queue_rx_xdp_drop 1456156976840 6.0 addl1=foo host=r01n01 instance=eth0 queue=7 rack=r01 sampleType=GAUGE\n", result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testEthstatWithQueueStyle2() {
|
||||
ValueList vl = new ValueList();
|
||||
vl.setHost(HOST);
|
||||
vl.setPlugin("ethstat");
|
||||
vl.setPluginInstance("eth0");
|
||||
vl.setTime(TIME);
|
||||
vl.setType("derive");
|
||||
vl.setTypeInstance("rx-15.bytes");
|
||||
vl.setValues(Collections.singletonList((Number) 6.0D));
|
||||
DataSet ds = new DataSet("DERIVE");
|
||||
ds.addDataSource(new DataSource("value", 1, 6.0D, 100.0D));
|
||||
vl.setDataSet(ds);
|
||||
|
||||
TestPlugin test = new TestPlugin();
|
||||
|
||||
test.write(new MetricData(vl));
|
||||
assertEquals("put sys.ethstat.rx_queue_bytes 1456156976840 6.0 addl1=foo host=r01n01 instance=eth0 queue=15 rack=r01 sampleType=GAUGE\n", result);
|
||||
|
||||
result = null;
|
||||
vl.setTypeInstance("tx15_xdp_err");
|
||||
test.write(new MetricData(vl));
|
||||
assertEquals("put sys.ethstat.tx_queue_xdp_err 1456156976840 6.0 addl1=foo host=r01n01 instance=eth0 queue=15 rack=r01 sampleType=GAUGE\n", result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testEthstatWithTrafficClass() {
|
||||
ValueList vl = new ValueList();
|
||||
vl.setHost(HOST);
|
||||
vl.setPlugin("ethstat");
|
||||
vl.setPluginInstance("eth0");
|
||||
vl.setTime(TIME);
|
||||
vl.setType("derive");
|
||||
vl.setTypeInstance("veb.tc_15_tx_bytes");
|
||||
vl.setValues(Collections.singletonList((Number) 6.0D));
|
||||
DataSet ds = new DataSet("DERIVE");
|
||||
ds.addDataSource(new DataSource("value", 1, 6.0D, 100.0D));
|
||||
vl.setDataSet(ds);
|
||||
|
||||
TestPlugin test = new TestPlugin();
|
||||
|
||||
test.write(new MetricData(vl));
|
||||
assertEquals("put sys.ethstat.veb.tc_tx_bytes 1456156976840 6.0 addl1=foo host=r01n01 instance=eth0 rack=r01 sampleType=GAUGE trafficClass=15\n",
|
||||
test.process(vl, null);
|
||||
assertEquals("put sys.ethstat.tx_comp_queue_full 1456156976840 6.0 host=r01n01 rack=r01 addl1=foo instance=eth0 sample=value sampleType=GAUGE\n",
|
||||
result);
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testEthstatWithChannel() {
|
||||
public void testEthStatWithQueue() {
|
||||
ValueList vl = new ValueList();
|
||||
vl.setHost(HOST);
|
||||
vl.setPlugin("ethstat");
|
||||
vl.setPluginInstance("eth0");
|
||||
vl.setTime(TIME);
|
||||
vl.setType("derive");
|
||||
vl.setTypeInstance("ch44_events");
|
||||
vl.setTypeInstance("rx_queue_1_bytes");
|
||||
vl.setValues(Collections.singletonList((Number) 6.0D));
|
||||
DataSet ds = new DataSet("DERIVE");
|
||||
ds.addDataSource(new DataSource("value", 1, 6.0D, 100.0D));
|
||||
vl.setDataSet(ds);
|
||||
|
||||
TestPlugin test = new TestPlugin();
|
||||
test.process(vl, null);
|
||||
assertEquals("put sys.ethstat.rx_bytes 1456156976840 6.0 host=r01n01 rack=r01 addl1=foo queue=1 instance=eth0 sample=value sampleType=GAUGE\n", result);
|
||||
|
||||
test.write(new MetricData(vl));
|
||||
assertEquals("put sys.ethstat.ch_events 1456156976840 6.0 addl1=foo channel=44 host=r01n01 instance=eth0 rack=r01 sampleType=GAUGE\n", result);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -397,38 +307,10 @@ public class PluginParentTest {
|
||||
vl.setDataSet(ds);
|
||||
|
||||
TestPlugin test = new TestPlugin();
|
||||
test.write(new MetricData(vl));
|
||||
assertEquals("put sys.ipmi.temperature 1456156976840 6.0 addl1=foo host=r01n01 instance=LAN_NIC_Temp_system_board_(3.2) rack=r01 sampleType=GAUGE\n",
|
||||
test.process(vl, null);
|
||||
assertEquals("put sys.ipmi.temperature 1456156976840 6.0 host=r01n01 rack=r01 addl1=foo instance=LAN_NIC_Temp_system_board_(3.2) sample=value sampleType=GAUGE\n",
|
||||
result);
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testExclusions() {
|
||||
ValueList vl = new ValueList();
|
||||
vl.setHost(HOST);
|
||||
vl.setPlugin("ethstat");
|
||||
vl.setPluginInstance("eth0");
|
||||
vl.setTime(TIME);
|
||||
vl.setType("derive");
|
||||
vl.setTypeInstance("rx_queue_1_bytes");
|
||||
vl.setValues(Collections.singletonList((Number) 6.0D));
|
||||
DataSet ds = new DataSet("DERIVE");
|
||||
ds.addDataSource(new DataSource("value", 1, 6.0D, 100.0D));
|
||||
vl.setDataSet(ds);
|
||||
|
||||
TestPlugin test = new TestPlugin();
|
||||
URL filteredMetricsFile = getClass().getClassLoader().getResource("filteredMetrics.txt");
|
||||
test.setFilteredMetricsFile(filteredMetricsFile.getPath());
|
||||
URL filteredTagsFile = getClass().getClassLoader().getResource("filteredTags.txt");
|
||||
test.setFilteredTagsFile(filteredTagsFile.getPath());
|
||||
|
||||
test.write(new MetricData(vl));
|
||||
assertEquals("put sys.ethstat.rx_queue_bytes 1456156976840 6.0 addl1=foo host=r01n01 queue=1 rack=r01\n", result);
|
||||
|
||||
result = null;
|
||||
vl.setPlugin("interface");
|
||||
vl.setTypeInstance("if_octets");
|
||||
assertNull(result);
|
||||
}
|
||||
}
|
||||
@@ -4,43 +4,37 @@
|
||||
<parent>
|
||||
<groupId>timely</groupId>
|
||||
<artifactId>timely</artifactId>
|
||||
<version>2.2.6-SNAPSHOT</version>
|
||||
<version>2.1.6-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>timely-collectd</artifactId>
|
||||
<artifactId>collectd-timely-plugin</artifactId>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>collectd</groupId>
|
||||
<artifactId>collectd-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-pool2</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpclient</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>jcl-over-slf4j</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>timely</groupId>
|
||||
<artifactId>timely-common</artifactId>
|
||||
<artifactId>collectd-plugin-parent</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.jcip</groupId>
|
||||
<artifactId>jcip-annotations</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.javassist</groupId>
|
||||
<artifactId>javassist</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.powermock</groupId>
|
||||
<artifactId>powermock-easymock-release-full</artifactId>
|
||||
@@ -55,17 +49,7 @@
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<configuration>
|
||||
<artifactSet>
|
||||
<includes>
|
||||
<include>com.google.guava:guava</include>
|
||||
<include>commons-codec:commons-codec</include>
|
||||
<include>org.apache.commons:commons-lang3</include>
|
||||
<include>org.apache.commons:commons-pool2</include>
|
||||
<include>org.apache.httpcomponents:httpclient</include>
|
||||
<include>org.apache.httpcomponents:httpcore</include>
|
||||
<include>org.slf4j:jcl-over-slf4j</include>
|
||||
<include>org.slf4j:slf4j-api</include>
|
||||
<include>timely:timely-common</include>
|
||||
</includes>
|
||||
<includes />
|
||||
</artifactSet>
|
||||
<filters>
|
||||
<filter>
|
||||
+15
-15
@@ -1,12 +1,12 @@
|
||||
package timely.collectd.plugin;
|
||||
|
||||
import java.net.Socket;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.commons.pool2.PooledObject;
|
||||
import org.apache.commons.pool2.PooledObjectFactory;
|
||||
import org.apache.commons.pool2.impl.DefaultPooledObject;
|
||||
import org.collectd.api.Collectd;
|
||||
import org.collectd.api.OConfigItem;
|
||||
|
||||
public class PooledSocketFactory implements PooledObjectFactory<Socket> {
|
||||
|
||||
@@ -16,27 +16,26 @@ public class PooledSocketFactory implements PooledObjectFactory<Socket> {
|
||||
private int socketTimeout = 60000; // 60 seconds in milliseconds
|
||||
private long connectionTimeToLive = 300000; // 300 seconds in milliseconds
|
||||
|
||||
public int config(Map<String,Object> configMap) {
|
||||
for (Map.Entry<String,Object> entry : configMap.entrySet()) {
|
||||
Object value = entry.getValue();
|
||||
switch (entry.getKey()) {
|
||||
public int config(OConfigItem config) {
|
||||
for (OConfigItem child : config.getChildren()) {
|
||||
switch (child.getKey()) {
|
||||
case "host":
|
||||
case "hostname":
|
||||
case "Host":
|
||||
case "HostName":
|
||||
host = (String) value;
|
||||
host = child.getValues().get(0).getString();
|
||||
break;
|
||||
case "Port":
|
||||
case "port":
|
||||
port = Integer.parseInt((String) value);
|
||||
port = Integer.parseInt(child.getValues().get(0).getString());
|
||||
break;
|
||||
case "socketTimeout":
|
||||
case "SocketTimeout":
|
||||
socketTimeout = Integer.parseInt((String) value);
|
||||
socketTimeout = Integer.parseInt(child.getValues().get(0).getString());
|
||||
break;
|
||||
case "connectionTimeToLive":
|
||||
case "ConnectionTimeToLive":
|
||||
connectionTimeToLive = Long.parseLong((String) value);
|
||||
connectionTimeToLive = Long.parseLong(child.getValues().get(0).getString());
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -81,15 +80,15 @@ public class PooledSocketFactory implements PooledObjectFactory<Socket> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public PooledObject<Socket> makeObject() {
|
||||
public PooledObject<Socket> makeObject() throws Exception {
|
||||
return new DefaultPooledObject<>(connect());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroyObject(PooledObject<Socket> pooledObject) {
|
||||
public void destroyObject(PooledObject<Socket> pooledObject) throws Exception {
|
||||
try {
|
||||
Collectd.logDebug("Shutting down connection to Timely at " + host + ":" + port);
|
||||
Socket socket = pooledObject.getObject();
|
||||
Socket socket = (Socket) pooledObject.getObject();
|
||||
if (socket != null) {
|
||||
socket.close();
|
||||
}
|
||||
@@ -97,6 +96,7 @@ public class PooledSocketFactory implements PooledObjectFactory<Socket> {
|
||||
Collectd.logError("Error closing connection to Timely at " + host + ":" + port + ". Error: " + e.getMessage());
|
||||
} finally {
|
||||
pooledObject.invalidate();
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,17 +107,17 @@ public class PooledSocketFactory implements PooledObjectFactory<Socket> {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Socket socket = pooledObject.getObject();
|
||||
Socket socket = (Socket) pooledObject.getObject();
|
||||
return socket != null && !socket.isClosed();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void activateObject(PooledObject<Socket> pooledObject) {
|
||||
public void activateObject(PooledObject<Socket> pooledObject) throws Exception {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
@Override
|
||||
public void passivateObject(PooledObject<Socket> pooledObject) {
|
||||
public void passivateObject(PooledObject<Socket> pooledObject) throws Exception {
|
||||
// do nothing
|
||||
}
|
||||
}
|
||||
+8
-46
@@ -6,8 +6,6 @@ import java.io.OutputStreamWriter;
|
||||
import java.io.PrintWriter;
|
||||
import java.net.Socket;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.commons.pool2.impl.GenericObjectPool;
|
||||
import org.apache.commons.pool2.impl.GenericObjectPoolConfig;
|
||||
@@ -16,9 +14,7 @@ import org.collectd.api.CollectdConfigInterface;
|
||||
import org.collectd.api.CollectdShutdownInterface;
|
||||
import org.collectd.api.CollectdWriteInterface;
|
||||
import org.collectd.api.OConfigItem;
|
||||
import org.collectd.api.OConfigValue;
|
||||
import org.collectd.api.ValueList;
|
||||
import org.slf4j.event.Level;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -39,15 +35,15 @@ public class WriteTimelyPlugin extends CollectDPluginParent implements CollectdC
|
||||
Collectd.registerWrite(WriteTimelyPlugin.class.getName(), this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(MetricData metricData) {
|
||||
public int write(ValueList vl) {
|
||||
|
||||
Socket socket = null;
|
||||
try {
|
||||
socket = socketPool.borrowObject();
|
||||
if (socket == null) {
|
||||
return;
|
||||
return -1;
|
||||
}
|
||||
super.process(metricData, socket.getOutputStream());
|
||||
super.process(vl, socket.getOutputStream());
|
||||
} catch (Exception e) {
|
||||
Collectd.logWarning(e.getMessage());
|
||||
try {
|
||||
@@ -59,16 +55,12 @@ public class WriteTimelyPlugin extends CollectDPluginParent implements CollectdC
|
||||
} catch (IOException e1) {
|
||||
Collectd.logError(e1.getMessage());
|
||||
}
|
||||
return -1;
|
||||
} finally {
|
||||
if (socket != null) {
|
||||
socketPool.returnObject(socket);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int write(ValueList vl) {
|
||||
MetricData metricData = new MetricData(vl);
|
||||
write(metricData);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -88,23 +80,10 @@ public class WriteTimelyPlugin extends CollectDPluginParent implements CollectdC
|
||||
}
|
||||
|
||||
public int config(OConfigItem config) {
|
||||
Map<String,Object> configMap = new HashMap<>();
|
||||
for (OConfigItem c : config.getChildren()) {
|
||||
String key = c.getKey();
|
||||
OConfigValue value = c.getValues().get(0);
|
||||
int type = value.getType();
|
||||
if (type == 0) {
|
||||
configMap.put(key, value.getString());
|
||||
} else if (type == 1) {
|
||||
configMap.put(key, value.getNumber());
|
||||
} else if (type == 2) {
|
||||
configMap.put(key, value.getBoolean());
|
||||
}
|
||||
}
|
||||
|
||||
int retval;
|
||||
super.config(config);
|
||||
int retval = 0;
|
||||
PooledSocketFactory socketFactory = new PooledSocketFactory();
|
||||
retval = socketFactory.config(configMap);
|
||||
retval = socketFactory.config(config);
|
||||
if (retval == 0) {
|
||||
GenericObjectPoolConfig<Socket> poolConfig = new GenericObjectPoolConfig<>();
|
||||
// use max size for maxTotal and maxIdle
|
||||
@@ -114,24 +93,7 @@ public class WriteTimelyPlugin extends CollectDPluginParent implements CollectdC
|
||||
poolConfig.setTestOnReturn(true);
|
||||
socketPool = new GenericObjectPool<>(socketFactory, poolConfig);
|
||||
}
|
||||
super.config(configMap);
|
||||
return retval;
|
||||
}
|
||||
|
||||
public void log(Level level, String s) {
|
||||
// collectd must be compiled with debug enabled in order for log level debug to work
|
||||
if (isDebug()) {
|
||||
Collectd.logInfo(s);
|
||||
} else {
|
||||
if (level.equals(Level.DEBUG)) {
|
||||
Collectd.logDebug(s);
|
||||
} else if (level.equals(Level.INFO)) {
|
||||
Collectd.logInfo(s);
|
||||
} else if (level.equals(Level.WARN)) {
|
||||
Collectd.logWarning(s);
|
||||
} else if (level.equals(Level.ERROR)) {
|
||||
Collectd.logError(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<FindBugsFilter>
|
||||
<Match>
|
||||
<Bug pattern="DM_DEFAULT_ENCODING"/>
|
||||
<Method name="connect" />
|
||||
<Class name="timely.collectd.plugin.WriteTimelyPlugin"/>
|
||||
</Match>
|
||||
</FindBugsFilter>
|
||||
+4
-1
@@ -21,9 +21,12 @@ import org.powermock.core.classloader.annotations.PowerMockIgnore;
|
||||
import org.powermock.core.classloader.annotations.PrepareForTest;
|
||||
import org.powermock.modules.junit4.PowerMockRunner;
|
||||
|
||||
import net.jcip.annotations.NotThreadSafe;
|
||||
|
||||
@RunWith(PowerMockRunner.class)
|
||||
@PrepareForTest({Collectd.class})
|
||||
@PowerMockIgnore({"javax.management.*", "jdk.internal.reflect.*"})
|
||||
@NotThreadSafe
|
||||
@PowerMockIgnore("javax.management.*")
|
||||
public class WriteTimelyPluginTest {
|
||||
|
||||
private WriteTimelyPlugin plugin = null;
|
||||
@@ -0,0 +1,24 @@
|
||||
Configuration:
|
||||
status: warn
|
||||
monitorInterval: 60
|
||||
|
||||
Properties:
|
||||
Property:
|
||||
- name: PID
|
||||
value: "????"
|
||||
- name: LOG_PATTERN
|
||||
value: "%clr{%d{yyyy-MM-dd HH:mm:ss.SSS}}{faint} %clr{%5p} %clr{${sys:PID}}{magenta} %clr{---}{faint} %clr{[%15.15t]}{faint} %clr{%-40.40c{1.}}{cyan} %clr{:}{faint} %m%n%wEx"
|
||||
|
||||
Appenders:
|
||||
Console:
|
||||
name: Console
|
||||
target: SYSTEM_OUT
|
||||
follow: true
|
||||
PatternLayout:
|
||||
pattern: "${LOG_PATTERN}"
|
||||
|
||||
Loggers:
|
||||
Root:
|
||||
level: warn
|
||||
AppenderRef:
|
||||
- ref: Console
|
||||
@@ -1,133 +0,0 @@
|
||||
package timely.collectd.plugin;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import org.collectd.api.ValueList;
|
||||
|
||||
public class MetricData {
|
||||
|
||||
public static final String COUNTER = "COUNTER";
|
||||
public static final String GAUGE = "GAUGE";
|
||||
public static final String DERIVE = "DERIVE";
|
||||
public static final String ABSOLUTE = "ABSOLUTE";
|
||||
|
||||
private Long timestamp;
|
||||
private String host;
|
||||
private String plugin;
|
||||
private String pluginInstance;
|
||||
private String type;
|
||||
private String typeInstance;
|
||||
private List<Pair<Double,String>> valuePairs = new ArrayList<>();
|
||||
|
||||
public MetricData(Long timestamp, String host, String plugin, String pluginInstance, String type, String typeInstance, List<Double> values,
|
||||
List<String> valueTypes) {
|
||||
this.timestamp = timestamp;
|
||||
this.host = host;
|
||||
this.plugin = plugin;
|
||||
this.pluginInstance = pluginInstance;
|
||||
this.type = type;
|
||||
this.typeInstance = typeInstance;
|
||||
for (int x = 0; x < values.size(); x++) {
|
||||
Double value = values.get(x);
|
||||
String valueType = valueTypes.size() > x ? valueTypes.get(x) : "GAUGE";
|
||||
valuePairs.add(Pair.of(value, valueType));
|
||||
}
|
||||
}
|
||||
|
||||
public MetricData(ValueList vl) {
|
||||
this.timestamp = vl.getTime();
|
||||
this.host = vl.getHost();
|
||||
this.plugin = vl.getPlugin();
|
||||
this.pluginInstance = vl.getPluginInstance();
|
||||
this.type = vl.getType();
|
||||
this.typeInstance = vl.getTypeInstance();
|
||||
List<Number> valueList = vl.getValues();
|
||||
List<String> valueTypes = vl.getDataSet().getDataSources().stream().map(ds -> convertType(ds.getType())).collect(Collectors.toList());
|
||||
for (int x = 0; x < vl.getValues().size(); x++) {
|
||||
Number n = valueList.get(x);
|
||||
String type = valueTypes.size() > x ? valueTypes.get(x) : "GAUGE";
|
||||
valuePairs.add(Pair.of(n.doubleValue(), type));
|
||||
}
|
||||
}
|
||||
|
||||
public Long getTimestamp() {
|
||||
return timestamp;
|
||||
}
|
||||
|
||||
public void setTimestamp(Long timestamp) {
|
||||
this.timestamp = timestamp;
|
||||
}
|
||||
|
||||
public String getHost() {
|
||||
return host;
|
||||
}
|
||||
|
||||
public void setHost(String host) {
|
||||
this.host = host;
|
||||
}
|
||||
|
||||
public String getPlugin() {
|
||||
return plugin;
|
||||
}
|
||||
|
||||
public void setPlugin(String plugin) {
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
public String getPluginInstance() {
|
||||
return pluginInstance;
|
||||
}
|
||||
|
||||
public void setPluginInstance(String pluginInstance) {
|
||||
this.pluginInstance = pluginInstance;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getTypeInstance() {
|
||||
return typeInstance;
|
||||
}
|
||||
|
||||
public void setTypeInstance(String typeInstance) {
|
||||
this.typeInstance = typeInstance;
|
||||
}
|
||||
|
||||
public List<Pair<Double,String>> getValuePairs() {
|
||||
return valuePairs;
|
||||
}
|
||||
|
||||
public void setValuePairs(List<Pair<Double,String>> valuePairs) {
|
||||
this.valuePairs = valuePairs;
|
||||
}
|
||||
|
||||
public static String convertType(int type) {
|
||||
switch (type) {
|
||||
case 0:
|
||||
return COUNTER;
|
||||
case 1:
|
||||
return GAUGE;
|
||||
case 2:
|
||||
return DERIVE;
|
||||
case 3:
|
||||
return ABSOLUTE;
|
||||
default:
|
||||
return GAUGE;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this).append("timestamp", timestamp).append("host", host).append("plugin", plugin).append("pluginInstance", pluginInstance)
|
||||
.append("type", type).append("typeInstance", typeInstance).append("valuePairs", valuePairs).toString();
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
package timely.collectd.plugin;
|
||||
|
||||
import org.slf4j.event.Level;
|
||||
|
||||
public interface PluginLogger {
|
||||
|
||||
void log(Level level, String s);
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
package timely.collectd.plugin;
|
||||
|
||||
public interface WritesMetrics {
|
||||
|
||||
void write(MetricData metricData);
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<FindBugsFilter>
|
||||
<Match>
|
||||
<Class name="timely.collectd.plugin.MetricData" />
|
||||
<Bug pattern="EI_EXPOSE_REP" />
|
||||
</Match>
|
||||
<Match>
|
||||
<Class name="timely.collectd.plugin.MetricData" />
|
||||
<Bug pattern="EI_EXPOSE_REP2" />
|
||||
</Match>
|
||||
<Match>
|
||||
<Class name="timely.collectd.plugin.CollectDPluginParent" />
|
||||
<Bug pattern="EI_EXPOSE_REP2" />
|
||||
</Match>
|
||||
</FindBugsFilter>
|
||||
@@ -1,3 +0,0 @@
|
||||
sys.ethstat.*_to_.*
|
||||
sys.interface.if_packets
|
||||
sys.interface.if_octets
|
||||
@@ -1,3 +0,0 @@
|
||||
sys.interface.if_packets sampleType,instance
|
||||
sys.interface.if_octets sampleType,instance
|
||||
sys.ethstat.rx_queue_bytes sampleType,instance
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>timely</groupId>
|
||||
<artifactId>timely</artifactId>
|
||||
<version>2.2.6-SNAPSHOT</version>
|
||||
<version>2.1.6-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>timely-common</artifactId>
|
||||
<dependencies>
|
||||
|
||||
@@ -1,63 +1,10 @@
|
||||
package timely.api.request;
|
||||
|
||||
import io.netty.handler.codec.http.FullHttpRequest;
|
||||
import io.netty.util.ReferenceCounted;
|
||||
|
||||
public interface HttpRequest extends Request, ReferenceCounted {
|
||||
public interface HttpRequest extends Request {
|
||||
|
||||
public void setHttpRequest(FullHttpRequest httpRequest);
|
||||
|
||||
public FullHttpRequest getHttpRequest();
|
||||
|
||||
default int refCnt() {
|
||||
if (getHttpRequest() != null) {
|
||||
return getHttpRequest().refCnt();
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
default ReferenceCounted retain() {
|
||||
if (getHttpRequest() != null) {
|
||||
getHttpRequest().retain();
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
default ReferenceCounted retain(int increment) {
|
||||
if (getHttpRequest() != null) {
|
||||
getHttpRequest().retain(increment);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
default ReferenceCounted touch() {
|
||||
if (getHttpRequest() != null) {
|
||||
getHttpRequest().touch();
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
default ReferenceCounted touch(Object hint) {
|
||||
if (getHttpRequest() != null) {
|
||||
getHttpRequest().touch(hint);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
default boolean release() {
|
||||
if (getHttpRequest() != null) {
|
||||
return getHttpRequest().release();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
default boolean release(int decrement) {
|
||||
if (getHttpRequest() != null) {
|
||||
return getHttpRequest().release(decrement);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package timely.api.response;
|
||||
|
||||
public class StrictTransportResponse {
|
||||
|
||||
}
|
||||
@@ -1,7 +1,5 @@
|
||||
package timely.common.configuration;
|
||||
|
||||
import static org.apache.accumulo.core.conf.ConfigurationTypeHelper.getTimeInMillis;
|
||||
|
||||
import org.apache.accumulo.core.client.Accumulo;
|
||||
import org.apache.accumulo.core.client.AccumuloClient;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
|
||||
@@ -18,13 +16,7 @@ public class AccumuloConfiguration {
|
||||
@Bean
|
||||
@ConditionalOnMissingBean
|
||||
public AccumuloClient accumuloClient(AccumuloProperties accumuloProperties, ZookeeperProperties zookeeperProperties) {
|
||||
// @formatter:off
|
||||
return Accumulo.newClient()
|
||||
.to(accumuloProperties.getInstanceName(), zookeeperProperties.getServers())
|
||||
.as(accumuloProperties.getUsername(), accumuloProperties.getPassword())
|
||||
.batchScannerQueryThreads(accumuloProperties.getScan().getThreads())
|
||||
.zkTimeout(Long.valueOf(getTimeInMillis(zookeeperProperties.getTimeout())).intValue())
|
||||
.build();
|
||||
// @formatter:on
|
||||
return Accumulo.newClient().to(accumuloProperties.getInstanceName(), zookeeperProperties.getServers())
|
||||
.as(accumuloProperties.getUsername(), accumuloProperties.getPassword()).build();
|
||||
}
|
||||
}
|
||||
@@ -20,6 +20,7 @@ public class HttpProperties {
|
||||
private Integer basePort;
|
||||
@NotNull
|
||||
private String host;
|
||||
private String redirectPath = "/secure-me";
|
||||
private long strictTransportMaxAge = 604800;
|
||||
@Valid
|
||||
@NestedConfigurationProperty
|
||||
@@ -57,6 +58,14 @@ public class HttpProperties {
|
||||
this.host = host;
|
||||
}
|
||||
|
||||
public String getRedirectPath() {
|
||||
return redirectPath;
|
||||
}
|
||||
|
||||
public void setRedirectPath(String redirectPath) {
|
||||
this.redirectPath = redirectPath;
|
||||
}
|
||||
|
||||
public long getStrictTransportMaxAge() {
|
||||
return strictTransportMaxAge;
|
||||
}
|
||||
|
||||
@@ -21,7 +21,8 @@ public class SslServerProperties implements SslProperties {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(SslServerProperties.class);
|
||||
|
||||
private String[] ciphers = new String[] {"TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384", "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384"};
|
||||
private String[] ciphers = new String[] {"TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256", "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA", "TLS_RSA_WITH_AES_128_GCM_SHA256",
|
||||
"TLS_RSA_WITH_AES_128_CBC_SHA", "SSL_RSA_WITH_3DES_EDE_CBC_SHA"};
|
||||
private String[] enabledProtocols;
|
||||
private String keyStoreType;
|
||||
private String keyStoreFile;
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
package timely.common.configuration;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import timely.util.Exclusions;
|
||||
|
||||
@Configuration
|
||||
@EnableConfigurationProperties({AccumuloProperties.class, CacheProperties.class, CorsProperties.class, HttpProperties.class, MetaCacheProperties.class,
|
||||
RestClientProperties.class, ScanProperties.class, SecurityProperties.class, ServerProperties.class, SslClientProperties.class,
|
||||
@@ -14,15 +10,4 @@ import timely.util.Exclusions;
|
||||
|
||||
public class TimelyCommonConfiguration {
|
||||
|
||||
@Bean
|
||||
public Exclusions exclusions(TimelyProperties timelyProperties) {
|
||||
Exclusions exclusions = new Exclusions();
|
||||
if (StringUtils.isNotBlank(timelyProperties.getFilteredMetricsFile())) {
|
||||
exclusions.setFilteredMetricsFile(timelyProperties.getFilteredMetricsFile());
|
||||
}
|
||||
if (StringUtils.isNotBlank(timelyProperties.getFilteredTagsFile())) {
|
||||
exclusions.setFilteredTagsFile(timelyProperties.getFilteredTagsFile());
|
||||
}
|
||||
return exclusions;
|
||||
}
|
||||
}
|
||||
@@ -25,8 +25,6 @@ public class TimelyProperties {
|
||||
private int portIncrement = 100;
|
||||
private String defaultVisibility = null;
|
||||
private int tagFilterCacheSize = 10000;
|
||||
private String filteredMetricsFile = null;
|
||||
private String filteredTagsFile = null;
|
||||
|
||||
public boolean isTest() {
|
||||
return test;
|
||||
@@ -102,20 +100,4 @@ public class TimelyProperties {
|
||||
public int getTagFilterCacheSize() {
|
||||
return tagFilterCacheSize;
|
||||
}
|
||||
|
||||
public void setFilteredMetricsFile(String filteredMetricsFile) {
|
||||
this.filteredMetricsFile = filteredMetricsFile;
|
||||
}
|
||||
|
||||
public String getFilteredMetricsFile() {
|
||||
return filteredMetricsFile;
|
||||
}
|
||||
|
||||
public void setFilteredTagsFile(String filteredTagsFile) {
|
||||
this.filteredTagsFile = filteredTagsFile;
|
||||
}
|
||||
|
||||
public String getFilteredTagsFile() {
|
||||
return filteredTagsFile;
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,6 @@ import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import timely.model.Tag;
|
||||
|
||||
@@ -25,7 +24,9 @@ public class TagListParser implements Parser<List<Tag>>, Combiner<Collection<Tag
|
||||
if (!p.isEmpty()) {
|
||||
Tag tag = tagParser.parse(p);
|
||||
// unescape commas in the key and value of the tag
|
||||
tags.add(unescapeCommas(tag));
|
||||
tag.setKey(tag.getKey().replaceAll("\\\\,", ","));
|
||||
tag.setValue(tag.getValue().replaceAll("\\\\,", ","));
|
||||
tags.add(tag);
|
||||
}
|
||||
}
|
||||
return tags;
|
||||
@@ -35,9 +36,7 @@ public class TagListParser implements Parser<List<Tag>>, Combiner<Collection<Tag
|
||||
public String combine(Collection<Tag> tags) {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
if (!tags.isEmpty()) {
|
||||
tags.forEach(p -> {
|
||||
builder.append(tagParser.combine(escapeCommas(p))).append(',');
|
||||
});
|
||||
tags.forEach(p -> builder.append(tagParser.combine(p)).append(','));
|
||||
builder.setLength(builder.length() - 1);
|
||||
}
|
||||
return builder.toString();
|
||||
@@ -49,26 +48,11 @@ public class TagListParser implements Parser<List<Tag>>, Combiner<Collection<Tag
|
||||
* @return string representation
|
||||
*/
|
||||
public String combine(Map<String,String> tags) {
|
||||
return combine(tags.entrySet().stream().map(e -> new Tag(e.getKey(), e.getValue())).collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
private Tag escapeCommas(Tag tag) {
|
||||
return escapeCommas(tag.getKey(), tag.getValue());
|
||||
}
|
||||
|
||||
private Tag escapeCommas(String k, String v) {
|
||||
k = k.replaceAll(",", "\\\\,");
|
||||
v = v.replaceAll(",", "\\\\,");
|
||||
return new Tag(k, v);
|
||||
}
|
||||
|
||||
private Tag unescapeCommas(Tag tag) {
|
||||
return unescapeCommas(tag.getKey(), tag.getValue());
|
||||
}
|
||||
|
||||
private Tag unescapeCommas(String k, String v) {
|
||||
k = k.replaceAll("\\\\,", ",");
|
||||
v = v.replaceAll("\\\\,", ",");
|
||||
return new Tag(k, v);
|
||||
StringBuilder builder = new StringBuilder();
|
||||
if (!tags.isEmpty()) {
|
||||
tags.forEach((k, v) -> builder.append(tagParser.combine(new Tag(k, v))).append(','));
|
||||
builder.setLength(builder.length() - 1);
|
||||
}
|
||||
return builder.toString();
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@ package timely.netty;
|
||||
|
||||
public class Constants {
|
||||
|
||||
public static final String ERR_WRITING_RESPONSE = "Error writing response to pipeline: %s";
|
||||
public static final String ERR_WRITING_RESPONSE = "Error writing response to pipeline: {}";
|
||||
public static final String TEXT_TYPE = "text/plain";
|
||||
public static final String HTML_TYPE = "text/html";
|
||||
public static final String JSON_TYPE = "application/json";
|
||||
|
||||
@@ -27,6 +27,7 @@ import timely.api.request.AuthenticatedRequest;
|
||||
import timely.api.request.HttpGetRequest;
|
||||
import timely.api.request.HttpPostRequest;
|
||||
import timely.api.request.HttpRequest;
|
||||
import timely.api.response.StrictTransportResponse;
|
||||
import timely.api.response.TimelyException;
|
||||
import timely.auth.SubjectIssuerDNPair;
|
||||
import timely.auth.TimelyAuthenticationToken;
|
||||
@@ -44,11 +45,13 @@ public class HttpRequestDecoder extends MessageToMessageDecoder<FullHttpRequest>
|
||||
private static final String LOG_PARSED_REQUEST = "Parsed request {}";
|
||||
|
||||
protected SecurityProperties securityProperties;
|
||||
private final String nonSecureRedirectAddress;
|
||||
private AuthenticationService authenticationService;
|
||||
|
||||
public HttpRequestDecoder(AuthenticationService authenticationService, SecurityProperties securityProperties, HttpProperties httpProperties) {
|
||||
|
||||
this.securityProperties = securityProperties;
|
||||
this.nonSecureRedirectAddress = httpProperties.getRedirectPath();
|
||||
this.authenticationService = authenticationService;
|
||||
}
|
||||
|
||||
@@ -79,6 +82,11 @@ public class HttpRequestDecoder extends MessageToMessageDecoder<FullHttpRequest>
|
||||
|
||||
final String uri = msg.uri();
|
||||
final QueryStringDecoder decoder = new QueryStringDecoder(uri);
|
||||
if (decoder.path().equals(nonSecureRedirectAddress)) {
|
||||
out.add(new StrictTransportResponse());
|
||||
return;
|
||||
}
|
||||
|
||||
final String sessionId = getSessionId(msg);
|
||||
log.trace("SessionID: " + sessionId);
|
||||
|
||||
|
||||
@@ -0,0 +1,385 @@
|
||||
/*
|
||||
* Copyright 2012 The Netty Project
|
||||
*
|
||||
* The Netty Project licenses this file to you 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 timely.netty.http;
|
||||
|
||||
import static io.netty.handler.codec.http.HttpHeaderNames.CACHE_CONTROL;
|
||||
import static io.netty.handler.codec.http.HttpHeaderNames.CONNECTION;
|
||||
import static io.netty.handler.codec.http.HttpHeaderNames.CONTENT_TYPE;
|
||||
import static io.netty.handler.codec.http.HttpHeaderNames.DATE;
|
||||
import static io.netty.handler.codec.http.HttpHeaderNames.EXPIRES;
|
||||
import static io.netty.handler.codec.http.HttpHeaderNames.IF_MODIFIED_SINCE;
|
||||
import static io.netty.handler.codec.http.HttpHeaderNames.LAST_MODIFIED;
|
||||
import static io.netty.handler.codec.http.HttpHeaderNames.LOCATION;
|
||||
import static io.netty.handler.codec.http.HttpMethod.GET;
|
||||
import static io.netty.handler.codec.http.HttpResponseStatus.BAD_REQUEST;
|
||||
import static io.netty.handler.codec.http.HttpResponseStatus.FORBIDDEN;
|
||||
import static io.netty.handler.codec.http.HttpResponseStatus.FOUND;
|
||||
import static io.netty.handler.codec.http.HttpResponseStatus.INTERNAL_SERVER_ERROR;
|
||||
import static io.netty.handler.codec.http.HttpResponseStatus.METHOD_NOT_ALLOWED;
|
||||
import static io.netty.handler.codec.http.HttpResponseStatus.NOT_FOUND;
|
||||
import static io.netty.handler.codec.http.HttpResponseStatus.NOT_MODIFIED;
|
||||
import static io.netty.handler.codec.http.HttpResponseStatus.OK;
|
||||
import static io.netty.handler.codec.http.HttpVersion.HTTP_1_1;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.RandomAccessFile;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLDecoder;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.GregorianCalendar;
|
||||
import java.util.Locale;
|
||||
import java.util.TimeZone;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import javax.activation.MimetypesFileTypeMap;
|
||||
import javax.net.ssl.SSLHandshakeException;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.Unpooled;
|
||||
import io.netty.channel.ChannelFutureListener;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.channel.SimpleChannelInboundHandler;
|
||||
import io.netty.handler.codec.http.DefaultFullHttpResponse;
|
||||
import io.netty.handler.codec.http.DefaultHttpResponse;
|
||||
import io.netty.handler.codec.http.FullHttpRequest;
|
||||
import io.netty.handler.codec.http.FullHttpResponse;
|
||||
import io.netty.handler.codec.http.HttpChunkedInput;
|
||||
import io.netty.handler.codec.http.HttpHeaderValues;
|
||||
import io.netty.handler.codec.http.HttpResponse;
|
||||
import io.netty.handler.codec.http.HttpResponseStatus;
|
||||
import io.netty.handler.codec.http.HttpUtil;
|
||||
import io.netty.handler.stream.ChunkedFile;
|
||||
import io.netty.util.CharsetUtil;
|
||||
import io.netty.util.internal.SystemPropertyUtil;
|
||||
import timely.netty.Constants;
|
||||
|
||||
/**
|
||||
* A simple handler that serves incoming HTTP requests to send their respective HTTP responses. It also implements {@code 'If-Modified-Since'} header to take
|
||||
* advantage of browser cache, as described in <a href="http://tools.ietf.org/html/rfc2616#section-14.25">RFC 2616</a>.
|
||||
*
|
||||
* <h3>How Browser Caching Works</h3>
|
||||
*
|
||||
* Web browser caching works with HTTP headers as illustrated by the following sample:
|
||||
* <ol>
|
||||
* <li>Request #1 returns the content of {@code /file1.txt}.</li>
|
||||
* <li>Contents of {@code /file1.txt} is cached by the browser.</li>
|
||||
* <li>Request #2 for {@code /file1.txt} does return the contents of the file again. Rather, a 304 Not Modified is returned. This tells the browser to use the
|
||||
* contents stored in its cache.</li>
|
||||
* <li>The server knows the file has not been modified because the {@code If-Modified-Since} date is the same as the file's last modified date.</li>
|
||||
* </ol>
|
||||
*
|
||||
* <pre>
|
||||
* Request #1 Headers
|
||||
* ===================
|
||||
* GET /file1.txt HTTP/1.1
|
||||
*
|
||||
* Response #1 Headers
|
||||
* ===================
|
||||
* HTTP/1.1 200 OK
|
||||
* Date: Tue, 01 Mar 2011 22:44:26 GMT
|
||||
* Last-Modified: Wed, 30 Jun 2010 21:36:48 GMT
|
||||
* Expires: Tue, 01 Mar 2012 22:44:26 GMT
|
||||
* Cache-Control: private, max-age=31536000
|
||||
*
|
||||
* Request #2 Headers
|
||||
* ===================
|
||||
* GET /file1.txt HTTP/1.1
|
||||
* If-Modified-Since: Wed, 30 Jun 2010 21:36:48 GMT
|
||||
*
|
||||
* Response #2 Headers
|
||||
* ===================
|
||||
* HTTP/1.1 304 Not Modified
|
||||
* Date: Tue, 01 Mar 2011 22:44:28 GMT
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
public class HttpStaticFileServerHandler extends SimpleChannelInboundHandler<FullHttpRequest> implements TimelyHttpHandler {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(HttpStaticFileServerHandler.class);
|
||||
public static final String HTTP_DATE_FORMAT = "EEE, dd MMM yyyy HH:mm:ss zzz";
|
||||
public static final String HTTP_DATE_GMT_TIMEZONE = "GMT";
|
||||
public static final int HTTP_CACHE_SECONDS = 60;
|
||||
private boolean ignoreSslHandshakeErrors = false;
|
||||
|
||||
@Override
|
||||
public void channelRead0(ChannelHandlerContext ctx, FullHttpRequest request) throws Exception {
|
||||
if (!request.decoderResult().isSuccess()) {
|
||||
sendError(ctx, BAD_REQUEST);
|
||||
return;
|
||||
}
|
||||
|
||||
if (request.method() != GET) {
|
||||
sendError(ctx, METHOD_NOT_ALLOWED);
|
||||
return;
|
||||
}
|
||||
|
||||
String uri = request.uri();
|
||||
if (uri.startsWith("/favicon.ico")) {
|
||||
uri = uri.replaceFirst("\\/", "/webapp/");
|
||||
}
|
||||
|
||||
if (!uri.startsWith("/webapp")) {
|
||||
sendError(ctx, FORBIDDEN);
|
||||
return;
|
||||
}
|
||||
|
||||
final String path = sanitizeUri(uri);
|
||||
if (path == null) {
|
||||
sendError(ctx, FORBIDDEN);
|
||||
return;
|
||||
}
|
||||
|
||||
log.trace("Looking for requested file at: " + path);
|
||||
|
||||
File file = new File(path);
|
||||
if (file.isHidden() || !file.exists()) {
|
||||
sendError(ctx, NOT_FOUND);
|
||||
return;
|
||||
}
|
||||
|
||||
if (file.isDirectory()) {
|
||||
if (uri.endsWith("/")) {
|
||||
sendListing(ctx, file);
|
||||
} else {
|
||||
sendRedirect(ctx, uri + '/');
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (!file.isFile()) {
|
||||
sendError(ctx, FORBIDDEN);
|
||||
return;
|
||||
}
|
||||
|
||||
// Cache Validation
|
||||
String ifModifiedSince = request.headers().get(IF_MODIFIED_SINCE);
|
||||
if (ifModifiedSince != null && !ifModifiedSince.isEmpty()) {
|
||||
SimpleDateFormat dateFormatter = new SimpleDateFormat(HTTP_DATE_FORMAT, Locale.US);
|
||||
Date ifModifiedSinceDate = dateFormatter.parse(ifModifiedSince);
|
||||
|
||||
// Only compare up to the second because the datetime format we send
|
||||
// to the client
|
||||
// does not have milliseconds
|
||||
long ifModifiedSinceDateSeconds = ifModifiedSinceDate.getTime() / 1000;
|
||||
long fileLastModifiedSeconds = file.lastModified() / 1000;
|
||||
if (ifModifiedSinceDateSeconds == fileLastModifiedSeconds) {
|
||||
sendNotModified(ctx);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
RandomAccessFile raf;
|
||||
try {
|
||||
raf = new RandomAccessFile(file, "r");
|
||||
} catch (FileNotFoundException ignore) {
|
||||
sendError(ctx, NOT_FOUND);
|
||||
return;
|
||||
}
|
||||
|
||||
long fileLength = raf.length();
|
||||
|
||||
HttpResponse response = new DefaultHttpResponse(HTTP_1_1, OK);
|
||||
HttpUtil.setContentLength(response, fileLength);
|
||||
setContentTypeHeader(response, file);
|
||||
setDateAndCacheHeaders(response, file);
|
||||
HttpUtil.setTransferEncodingChunked(response, true);
|
||||
if (HttpUtil.isKeepAlive(request)) {
|
||||
response.headers().set(CONNECTION, HttpHeaderValues.KEEP_ALIVE);
|
||||
}
|
||||
|
||||
// Write the initial line and the header.
|
||||
sendResponse(ctx, response);
|
||||
log.trace("Returning {}", response);
|
||||
|
||||
// Write the content.
|
||||
sendResponse(ctx, new HttpChunkedInput(new ChunkedFile(raf, 0, fileLength, 8192)));
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
|
||||
// ignore SSLHandshakeException when using a self-signed server certificate
|
||||
if (ignoreSslHandshakeErrors && cause.getCause() instanceof SSLHandshakeException) {
|
||||
return;
|
||||
}
|
||||
log.error("Error serving file", cause);
|
||||
if (ctx.channel().isActive()) {
|
||||
sendError(ctx, INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
private static final Pattern INSECURE_URI = Pattern.compile(".*[<>&\"].*");
|
||||
|
||||
private static String sanitizeUri(String uri) {
|
||||
// Decode the path.
|
||||
try {
|
||||
uri = URLDecoder.decode(uri, "UTF-8");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
throw new Error(e);
|
||||
}
|
||||
|
||||
if (uri.isEmpty() || uri.charAt(0) != '/') {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Convert file separators.
|
||||
uri = uri.replace('/', File.separatorChar);
|
||||
|
||||
// Simplistic dumb security check.
|
||||
// You will have to do something serious in the production environment.
|
||||
if (uri.contains(File.separator + '.') || uri.contains('.' + File.separator) || uri.charAt(0) == '.' || uri.charAt(uri.length() - 1) == '.'
|
||||
|| INSECURE_URI.matcher(uri).matches()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Convert to absolute path.
|
||||
return SystemPropertyUtil.get("user.dir") + File.separator + uri;
|
||||
}
|
||||
|
||||
private static final Pattern ALLOWED_FILE_NAME = Pattern.compile("[A-Za-z0-9][-_A-Za-z0-9\\.]*");
|
||||
|
||||
private static void sendListing(ChannelHandlerContext ctx, File dir) {
|
||||
FullHttpResponse response = new DefaultFullHttpResponse(HTTP_1_1, OK);
|
||||
response.headers().set(CONTENT_TYPE, "text/html; charset=UTF-8");
|
||||
|
||||
String dirPath = dir.getPath();
|
||||
StringBuilder buf = new StringBuilder().append("<!DOCTYPE html>\r\n").append("<html><head><title>").append("Listing of: ").append(dirPath)
|
||||
.append("</title></head><body>\r\n")
|
||||
|
||||
.append("<h3>Listing of: ").append(dirPath).append("</h3>\r\n")
|
||||
|
||||
.append("<ul>").append("<li><a href=\"../\">..</a></li>\r\n");
|
||||
|
||||
File[] files = dir.listFiles();
|
||||
if (null != files) {
|
||||
for (File f : files) {
|
||||
if (f.isHidden() || !f.canRead()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
String name = f.getName();
|
||||
if (!ALLOWED_FILE_NAME.matcher(name).matches()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
buf.append("<li><a href=\"").append(name).append("\">").append(name).append("</a></li>\r\n");
|
||||
}
|
||||
}
|
||||
|
||||
buf.append("</ul></body></html>\r\n");
|
||||
ByteBuf buffer = Unpooled.copiedBuffer(buf, CharsetUtil.UTF_8);
|
||||
response.content().writeBytes(buffer);
|
||||
buffer.release();
|
||||
|
||||
// Close the connection as soon as the error message is sent.
|
||||
ctx.writeAndFlush(response).addListener(ChannelFutureListener.CLOSE);
|
||||
log.trace(Constants.LOG_RETURNING_RESPONSE, response);
|
||||
}
|
||||
|
||||
private static void sendRedirect(ChannelHandlerContext ctx, String newUri) {
|
||||
FullHttpResponse response = new DefaultFullHttpResponse(HTTP_1_1, FOUND);
|
||||
response.headers().set(LOCATION, newUri);
|
||||
|
||||
// Close the connection as soon as the error message is sent.
|
||||
ctx.writeAndFlush(response).addListener(ChannelFutureListener.CLOSE);
|
||||
log.trace(Constants.LOG_RETURNING_RESPONSE, response);
|
||||
}
|
||||
|
||||
private static void sendError(ChannelHandlerContext ctx, HttpResponseStatus status) {
|
||||
FullHttpResponse response = new DefaultFullHttpResponse(HTTP_1_1, status, Unpooled.copiedBuffer("Failure: " + status + "\r\n", CharsetUtil.UTF_8));
|
||||
response.headers().set(CONTENT_TYPE, "text/plain; charset=UTF-8");
|
||||
|
||||
// Close the connection as soon as the error message is sent.
|
||||
ctx.writeAndFlush(response).addListener(ChannelFutureListener.CLOSE);
|
||||
log.trace(Constants.LOG_RETURNING_RESPONSE, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* When file timestamp is the same as what the browser is sending up, send a "304 Not Modified"
|
||||
*
|
||||
* @param ctx
|
||||
* Context
|
||||
*/
|
||||
private static void sendNotModified(ChannelHandlerContext ctx) {
|
||||
FullHttpResponse response = new DefaultFullHttpResponse(HTTP_1_1, NOT_MODIFIED);
|
||||
setDateHeader(response);
|
||||
|
||||
// Close the connection as soon as the error message is sent.
|
||||
ctx.writeAndFlush(response).addListener(ChannelFutureListener.CLOSE);
|
||||
log.trace(Constants.LOG_RETURNING_RESPONSE, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the Date header for the HTTP response
|
||||
*
|
||||
* @param response
|
||||
* HTTP response
|
||||
*/
|
||||
private static void setDateHeader(FullHttpResponse response) {
|
||||
SimpleDateFormat dateFormatter = new SimpleDateFormat(HTTP_DATE_FORMAT, Locale.US);
|
||||
dateFormatter.setTimeZone(TimeZone.getTimeZone(HTTP_DATE_GMT_TIMEZONE));
|
||||
|
||||
Calendar time = new GregorianCalendar();
|
||||
response.headers().set(DATE, dateFormatter.format(time.getTime()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the Date and Cache headers for the HTTP Response
|
||||
*
|
||||
* @param response
|
||||
* HTTP response
|
||||
* @param fileToCache
|
||||
* file to extract content type
|
||||
*/
|
||||
private static void setDateAndCacheHeaders(HttpResponse response, File fileToCache) {
|
||||
SimpleDateFormat dateFormatter = new SimpleDateFormat(HTTP_DATE_FORMAT, Locale.US);
|
||||
dateFormatter.setTimeZone(TimeZone.getTimeZone(HTTP_DATE_GMT_TIMEZONE));
|
||||
|
||||
// Date header
|
||||
Calendar time = new GregorianCalendar();
|
||||
response.headers().set(DATE, dateFormatter.format(time.getTime()));
|
||||
|
||||
// Add cache headers
|
||||
time.add(Calendar.SECOND, HTTP_CACHE_SECONDS);
|
||||
response.headers().set(EXPIRES, dateFormatter.format(time.getTime()));
|
||||
response.headers().set(CACHE_CONTROL, "private, max-age=" + HTTP_CACHE_SECONDS);
|
||||
response.headers().set(LAST_MODIFIED, dateFormatter.format(new Date(fileToCache.lastModified())));
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the content type header for the HTTP Response
|
||||
*
|
||||
* @param response
|
||||
* HTTP response
|
||||
* @param file
|
||||
* file to extract content type
|
||||
*/
|
||||
private static void setContentTypeHeader(HttpResponse response, File file) {
|
||||
MimetypesFileTypeMap mimeTypesMap = new MimetypesFileTypeMap();
|
||||
response.headers().set(CONTENT_TYPE, mimeTypesMap.getContentType(file.getPath()));
|
||||
}
|
||||
|
||||
public HttpStaticFileServerHandler setIgnoreSslHandshakeErrors(boolean ignoreSslHandshakeErrors) {
|
||||
this.ignoreSslHandshakeErrors = ignoreSslHandshakeErrors;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
package timely.netty.http;
|
||||
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.channel.ChannelOutboundHandlerAdapter;
|
||||
import io.netty.channel.ChannelPromise;
|
||||
import io.netty.handler.codec.http.HttpResponse;
|
||||
import timely.common.configuration.HttpProperties;
|
||||
|
||||
public class HttpStrictTransportSecurityHandler extends ChannelOutboundHandlerAdapter {
|
||||
|
||||
public static final String HSTS_HEADER_NAME = "Strict-Transport-Security";
|
||||
private final String HSTS_HEADER_VALUE;
|
||||
|
||||
public HttpStrictTransportSecurityHandler(HttpProperties httpProperties) {
|
||||
this.HSTS_HEADER_VALUE = String.format("max-age=%d; includeSubDomains; preload", httpProperties.getStrictTransportMaxAge());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception {
|
||||
// Check if the connection is SSL/TLS encrypted
|
||||
boolean isHttps = ctx.channel().pipeline().get(io.netty.handler.ssl.SslHandler.class) != null;
|
||||
if (isHttps && msg instanceof HttpResponse) {
|
||||
HttpResponse response = (HttpResponse) msg;
|
||||
// Add the HSTS header only if it isn't already present
|
||||
if (!response.headers().contains(HSTS_HEADER_NAME)) {
|
||||
response.headers().set(HSTS_HEADER_NAME, HSTS_HEADER_VALUE);
|
||||
}
|
||||
}
|
||||
// Forward the message to the next handler in the pipeline
|
||||
super.write(ctx, msg, promise);
|
||||
}
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
package timely.netty.http;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import io.netty.buffer.Unpooled;
|
||||
import io.netty.channel.ChannelFutureListener;
|
||||
import io.netty.channel.ChannelHandler;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.channel.ChannelInboundHandlerAdapter;
|
||||
import io.netty.handler.ssl.OptionalSslHandler;
|
||||
import io.netty.handler.ssl.SslContext;
|
||||
import io.netty.util.CharsetUtil;
|
||||
import io.netty.util.ReferenceCountUtil;
|
||||
import timely.netty.Constants;
|
||||
|
||||
public class NonSslForbiddenHandler extends OptionalSslHandler {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(NonSslForbiddenHandler.class);
|
||||
|
||||
public NonSslForbiddenHandler(SslContext sslContext) {
|
||||
super(sslContext);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String newSslHandlerName() {
|
||||
return "ssl";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String newNonSslHandlerName() {
|
||||
return "nonSslForbidden";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ChannelHandler newNonSslHandler(ChannelHandlerContext context) {
|
||||
return new ChannelInboundHandlerAdapter() {
|
||||
|
||||
@Override
|
||||
public void channelRead(ChannelHandlerContext ctx, Object msg) {
|
||||
try {
|
||||
log.trace("Received non-SSL request, returning forbidden");
|
||||
String response = "HTTP/1.1 403 Forbidden\r\nContent-Length: 0\r\n\r\n";
|
||||
log.trace(Constants.LOG_RETURNING_RESPONSE, response);
|
||||
ctx.writeAndFlush(Unpooled.copiedBuffer(response, CharsetUtil.UTF_8)).addListener(ChannelFutureListener.CLOSE);
|
||||
} finally {
|
||||
ReferenceCountUtil.release(msg);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package timely.netty.http;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import io.netty.buffer.Unpooled;
|
||||
import io.netty.channel.ChannelHandler;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.channel.ChannelInboundHandlerAdapter;
|
||||
import io.netty.handler.codec.http.DefaultFullHttpResponse;
|
||||
import io.netty.handler.codec.http.FullHttpResponse;
|
||||
import io.netty.handler.codec.http.HttpHeaderNames;
|
||||
import io.netty.handler.codec.http.HttpResponseEncoder;
|
||||
import io.netty.handler.codec.http.HttpResponseStatus;
|
||||
import io.netty.handler.codec.http.HttpVersion;
|
||||
import io.netty.handler.ssl.OptionalSslHandler;
|
||||
import io.netty.handler.ssl.SslContext;
|
||||
import timely.common.configuration.HttpProperties;
|
||||
import timely.netty.Constants;
|
||||
|
||||
public class NonSslRedirectHandler extends OptionalSslHandler implements TimelyHttpHandler {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(NonSslRedirectHandler.class);
|
||||
private final String redirectAddress;
|
||||
|
||||
public NonSslRedirectHandler(HttpProperties httpProperties, SslContext sslContext) {
|
||||
super(sslContext);
|
||||
String timelyHost = httpProperties.getHost();
|
||||
int timelyPort = httpProperties.getPort();
|
||||
String path = httpProperties.getRedirectPath();
|
||||
redirectAddress = "https://" + timelyHost + ":" + timelyPort + path;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String newSslHandlerName() {
|
||||
return "ssl";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String newNonSslHandlerName() {
|
||||
return "ssl";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ChannelHandler newNonSslHandler(ChannelHandlerContext context) {
|
||||
return new ChannelInboundHandlerAdapter() {
|
||||
|
||||
private HttpResponseEncoder encoder = new HttpResponseEncoder();
|
||||
|
||||
@Override
|
||||
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
|
||||
log.trace("Received non-SSL request, returning redirect");
|
||||
FullHttpResponse response = new DefaultFullHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.MOVED_PERMANENTLY, Unpooled.EMPTY_BUFFER);
|
||||
response.headers().set(HttpHeaderNames.LOCATION, redirectAddress);
|
||||
log.trace(Constants.LOG_RETURNING_RESPONSE, response);
|
||||
encoder.write(ctx, response, ctx.voidPromise());
|
||||
ctx.flush();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
/*
|
||||
* Copyright 2012 The Netty Project
|
||||
*
|
||||
* The Netty Project licenses this file to you 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 timely.netty.http;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import io.netty.buffer.Unpooled;
|
||||
import io.netty.channel.ChannelFutureListener;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.channel.SimpleChannelInboundHandler;
|
||||
import io.netty.handler.codec.http.DefaultFullHttpResponse;
|
||||
import io.netty.handler.codec.http.FullHttpRequest;
|
||||
import io.netty.handler.codec.http.FullHttpResponse;
|
||||
import io.netty.handler.codec.http.HttpHeaderNames;
|
||||
import io.netty.handler.codec.http.HttpHeaderValues;
|
||||
import io.netty.handler.codec.http.HttpResponseStatus;
|
||||
import io.netty.handler.codec.http.HttpVersion;
|
||||
import timely.netty.Constants;
|
||||
|
||||
public class NotFoundHandler extends SimpleChannelInboundHandler<FullHttpRequest> implements TimelyHttpHandler {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(NotFoundHandler.class);
|
||||
|
||||
@Override
|
||||
public void channelRead0(ChannelHandlerContext ctx, FullHttpRequest request) throws Exception {
|
||||
// if the request reaches this handler, it means that no other handler has processed it, so we return a 404 Not Found response
|
||||
FullHttpResponse response = new DefaultFullHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.NOT_FOUND, Unpooled.EMPTY_BUFFER);
|
||||
response.headers().set(HttpHeaderNames.CONTENT_LENGTH, 0);
|
||||
log.trace(Constants.LOG_RETURNING_RESPONSE, response);
|
||||
ctx.writeAndFlush(response).addListener(ChannelFutureListener.CLOSE);
|
||||
}
|
||||
}
|
||||
@@ -23,27 +23,21 @@ public interface TimelyHttpHandler {
|
||||
Logger log = LoggerFactory.getLogger(TimelyHttpHandler.class);
|
||||
|
||||
default void sendHttpError(ChannelHandlerContext ctx, TimelyException e) throws JsonProcessingException {
|
||||
try {
|
||||
log.error("Error in pipeline, response code: {}, message: {}", e.getCode(), e.getMessage());
|
||||
byte[] buf = JsonUtil.getObjectMapper().writeValueAsBytes(new TimelyExceptionResponse(e));
|
||||
FullHttpResponse response = new DefaultFullHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.valueOf(e.getCode()), Unpooled.copiedBuffer(buf));
|
||||
response.headers().set(HttpHeaderNames.CONTENT_TYPE, Constants.JSON_TYPE);
|
||||
response.headers().set(HttpHeaderNames.CONTENT_LENGTH, response.content().readableBytes());
|
||||
e.getResponseHeaders().entrySet().forEach(entry -> response.headers().set(entry.getKey(), entry.getValue()));
|
||||
// Send the error response
|
||||
sendResponse(ctx, response);
|
||||
} catch (Exception ex) {
|
||||
log.error(ex.getMessage(), ex);
|
||||
}
|
||||
log.error("Error in pipeline, response code: {}, message: {}", e.getCode(), e.getMessage());
|
||||
byte[] buf = JsonUtil.getObjectMapper().writeValueAsBytes(new TimelyExceptionResponse(e));
|
||||
FullHttpResponse response = new DefaultFullHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.valueOf(e.getCode()), Unpooled.copiedBuffer(buf));
|
||||
response.headers().set(HttpHeaderNames.CONTENT_TYPE, Constants.JSON_TYPE);
|
||||
response.headers().set(HttpHeaderNames.CONTENT_LENGTH, response.content().readableBytes());
|
||||
e.getResponseHeaders().entrySet().forEach(entry -> response.headers().set(entry.getKey(), entry.getValue()));
|
||||
// Send the error response
|
||||
sendResponse(ctx, response);
|
||||
}
|
||||
|
||||
default void sendResponse(ChannelHandlerContext ctx, Object msg) {
|
||||
ChannelFuture cf = ctx.writeAndFlush(msg);
|
||||
ChannelFuture f = ctx.writeAndFlush(msg);
|
||||
log.trace(Constants.LOG_RETURNING_RESPONSE, msg);
|
||||
if (!cf.isSuccess()) {
|
||||
Throwable t = cf.cause();
|
||||
String message = (t == null) ? "" : t.getMessage();
|
||||
log.error(String.format(Constants.ERR_WRITING_RESPONSE, message), cf.cause());
|
||||
if (!f.isSuccess()) {
|
||||
log.error(Constants.ERR_WRITING_RESPONSE, f.cause());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,149 +0,0 @@
|
||||
package timely.util;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.text.MessageFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import timely.model.Metric;
|
||||
import timely.model.Tag;
|
||||
import timely.model.parse.MetricParser;
|
||||
|
||||
public class Exclusions {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(Exclusions.class);
|
||||
private static final MetricParser metricParser = new MetricParser();
|
||||
private List<String> filteredMetrics = new ArrayList<>();
|
||||
private Map<String,Set<String>> filteredTags = new LinkedHashMap<>();
|
||||
|
||||
public interface LineHandler {
|
||||
void handleLine(String line);
|
||||
}
|
||||
|
||||
public void readFile(String file, LineHandler lineHandler) {
|
||||
File f = new File(file);
|
||||
if (f.exists() && f.isFile() && f.canRead()) {
|
||||
try (InputStream iStream = new FileInputStream(f);
|
||||
InputStreamReader streamReader = new InputStreamReader(iStream, StandardCharsets.UTF_8);
|
||||
BufferedReader reader = new BufferedReader(streamReader)) {
|
||||
|
||||
String line;
|
||||
while ((line = reader.readLine()) != null) {
|
||||
try {
|
||||
lineHandler.handleLine(line);
|
||||
} catch (Exception e) {
|
||||
log.error(MessageFormat.format("Error reading line {0}", line), e);
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
log.error(MessageFormat.format("Error reading file {0}", file), e);
|
||||
}
|
||||
} else {
|
||||
log.error(MessageFormat.format("File ''{0}'' either does not exist or is not readable", file));
|
||||
}
|
||||
}
|
||||
|
||||
public List<String> getFilteredMetrics(String filteredMetricsFile) {
|
||||
List<String> filteredMetricRegexes = new ArrayList<>();
|
||||
readFile(filteredMetricsFile, (line) -> {
|
||||
if (!line.endsWith(".*")) {
|
||||
line = line + ".*";
|
||||
}
|
||||
filteredMetricRegexes.add(line);
|
||||
});
|
||||
return filteredMetricRegexes;
|
||||
}
|
||||
|
||||
public Map<String,Set<String>> getFilteredTags(String filteredTagsFile) {
|
||||
Map<String,Set<String>> filteredTagsForMetrics = new LinkedHashMap<>();
|
||||
readFile(filteredTagsFile, (line) -> {
|
||||
int x = line.indexOf(" ");
|
||||
String metric = line.substring(0, x);
|
||||
String tags = line.substring(x + 1).trim();
|
||||
Set<String> tagSet = Arrays.stream(tags.split(",")).map(tag -> tag.trim()).collect(Collectors.toSet());
|
||||
filteredTagsForMetrics.put(metric, tagSet);
|
||||
});
|
||||
return filteredTagsForMetrics;
|
||||
}
|
||||
|
||||
public void setFilteredMetricsFile(String filteredMetricsFile) {
|
||||
this.filteredMetrics = getFilteredMetrics(filteredMetricsFile);
|
||||
}
|
||||
|
||||
public void setFilteredTagsFile(String filteredTagsFile) {
|
||||
this.filteredTags = getFilteredTags(filteredTagsFile);
|
||||
}
|
||||
|
||||
// format put metric timestamp value tag1=value1 tag2=value2 tag3=value3
|
||||
// where the tags are sorted
|
||||
public boolean filterMetric(String metricPutLine) {
|
||||
String metricLine = buildMetricLine(metricPutLine);
|
||||
for (String filteredRegex : filteredMetrics) {
|
||||
if (metricLine.matches(filteredRegex)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean filterMetric(Metric metric) {
|
||||
String metricLine = buildMetricLine(metric);
|
||||
for (String filteredRegex : filteredMetrics) {
|
||||
if (metricLine.matches(filteredRegex)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
protected String buildMetricLine(String metricPutLine) {
|
||||
Metric metric = metricParser.parse(metricPutLine);
|
||||
return buildMetricLine(metric);
|
||||
}
|
||||
|
||||
protected String buildMetricLine(Metric metric) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(metric.getName()).append(" ");
|
||||
metric.getTags().stream().forEach(t -> sb.append(t.join()).append(" "));
|
||||
return sb.toString().trim();
|
||||
}
|
||||
|
||||
public String filterExcludedTags(String metricLineOrig) {
|
||||
if (filteredTags.isEmpty()) {
|
||||
return metricLineOrig;
|
||||
}
|
||||
Metric metric = metricParser.parse(metricLineOrig);
|
||||
filterExcludedTags(metric);
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("put ");
|
||||
sb.append(metric.getName()).append(" ");
|
||||
sb.append(metric.getValue().getTimestamp()).append(" ");
|
||||
sb.append(metric.getValue().getMeasure()).append(" ");
|
||||
metric.getTags().stream().forEach(t -> sb.append(t.join()).append(" "));
|
||||
return sb.toString().trim();
|
||||
}
|
||||
|
||||
public void filterExcludedTags(Metric metric) {
|
||||
if (!filteredTags.isEmpty()) {
|
||||
Set<String> tags = filteredTags.get(metric.getName());
|
||||
if (tags != null && !tags.isEmpty()) {
|
||||
List<Tag> filteredTags = metric.getTags().stream().filter(t -> !tags.contains(t.getKey())).collect(Collectors.toList());
|
||||
metric.setTags(filteredTags);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
package timely.util;
|
||||
|
||||
import java.net.URL;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
public class ExclusionTest {
|
||||
|
||||
@Test
|
||||
public void testLoadFilteredMetricsFile() {
|
||||
Exclusions exclusions = new Exclusions();
|
||||
URL url = getClass().getClassLoader().getResource("filteredMetrics.txt");
|
||||
List<String> metricExclusions = exclusions.getFilteredMetrics(url.getFile());
|
||||
Assert.assertEquals(4, metricExclusions.size());
|
||||
System.out.println(metricExclusions);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLoadFilteredTagsFile() {
|
||||
Exclusions exclusions = new Exclusions();
|
||||
URL url = getClass().getClassLoader().getResource("filteredTags.txt");
|
||||
Map<String,Set<String>> filteredTags = exclusions.getFilteredTags(url.getFile());
|
||||
Assert.assertEquals(2, filteredTags.size());
|
||||
System.out.println(filteredTags);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMetricExclusions() {
|
||||
Exclusions exclusions = new Exclusions();
|
||||
URL filteredMetrics = getClass().getClassLoader().getResource("filteredMetrics.txt");
|
||||
URL filteredTags = getClass().getClassLoader().getResource("filteredTags.txt");
|
||||
exclusions.setFilteredMetricsFile(filteredMetrics.getFile());
|
||||
exclusions.setFilteredTagsFile(filteredTags.getFile());
|
||||
|
||||
String metric1 = "put sys.interface.if_octets 1740090590221 71838.0 host=localhost instance=veth88545ad sampleType=DERIVE";
|
||||
Assert.assertTrue(exclusions.filterMetric(metric1));
|
||||
String metric2 = "put sys.interface.if_errors 1740090590221 71838.0 host=localhost instance=veth88545ad sampleType=DERIVE";
|
||||
Assert.assertFalse(exclusions.filterMetric(metric2));
|
||||
Assert.assertEquals("put sys.interface.if_octets 1740090590221 71838.0 host=localhost", exclusions.filterExcludedTags(metric1));
|
||||
}
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
sys.ethstat.(tx|rx)[-]?[0-9]+[_.]
|
||||
sys.ethstat.*_to_.*
|
||||
sys.interface.if_packets
|
||||
sys.interface.if_octets
|
||||
@@ -1,2 +0,0 @@
|
||||
sys.interface.if_packets sampleType,instance
|
||||
sys.interface.if_octets sampleType,instance
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>timely</groupId>
|
||||
<artifactId>timely</artifactId>
|
||||
<version>2.2.6-SNAPSHOT</version>
|
||||
<version>2.1.6-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>timely-datasource</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
/*! For license information please see module.js.LICENSE.txt */
|
||||
/* [create-plugin] version: 5.12.4 */
|
||||
define(["@grafana/data","@grafana/runtime","@grafana/ui","lodash","module","react","react-dom"],((e,t,n,r,o,i,a)=>(()=>{var l={210:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var r=n(942),o=n.n(r),i=n(278),a=n.n(i)()(o());a.push([e.id,"div.timely .form-control {\n display: block;\n width: 100%;\n height: 32px;\n padding: 0px 8px;\n font-size: 14px;\n font-weight: 400;\n line-height: 1.5;\n border: 1px solid #ced4da;\n border-radius: 2px;\n transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;\n background-clip: padding-box;\n}\n\ndiv.timely .form-control::-ms-expand {\n background-color: transparent;\n border: 0;\n}\n\ndiv.timely .form-control:-moz-focusring {\n color: transparent;\n text-shadow: 0 0 0 #495057;\n}\n\ndiv.timely .form-control:focus,\ndiv.timely input:focus {\n border-color: #80bdff;\n outline: 0;\n transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;\n}\n\ndiv.timely .form-control-file,\ndiv.timely .form-control-range {\n display: block;\n width: 100%;\n}\n\ndiv.timely .form-control-plaintext {\n display: block;\n width: 100%;\n padding: 0.375rem 0;\n margin-bottom: 0;\n font-size: 1rem;\n line-height: 1.5;\n border: solid transparent;\n border-width: 1px 0;\n}\n\ndiv.timely .form-control-plaintext.form-control-sm,\ndiv.timely .form-control-plaintext.form-control-lg {\n padding-right: 0;\n padding-left: 0;\n}\n\ndiv.timely .form-control-sm {\n height: calc(1.5em + 0.5rem + 2px);\n padding: 0.25rem 0.5rem;\n font-size: 0.875rem;\n line-height: 1.5;\n border-radius: 0.2rem;\n}\n\ndiv.timely .form-control-lg {\n height: calc(1.5em + 1rem + 2px);\n padding: 0.5rem 1rem;\n font-size: 1.25rem;\n line-height: 1.5;\n border-radius: 0.3rem;\n}\n\ndiv.timely select.form-control[size],\ndiv.timely select.form-control[multiple] {\n height: auto;\n}\n\ndiv.timely textarea.form-control {\n height: auto;\n}\n\ndiv.timely .dropdown-item {\n display: block;\n width: 100%;\n padding: 0.25rem 1.5rem;\n clear: both;\n font-weight: 400;\n color: #212529;\n text-align: inherit;\n white-space: nowrap;\n background-color: transparent;\n border: 0;\n}\n\ndiv.timely .dropdown-item:hover,\ndiv.timely .dropdown-item:focus {\n color: #16181b;\n text-decoration: none;\n background-color: #f8f9fa;\n}\n\ndiv.timely .dropdown-item.active,\ndiv.timely .dropdown-item:active {\n color: #fff;\n text-decoration: none;\n background-color: #007bff;\n}\n\ndiv.timely .dropdown-item.disabled,\ndiv.timely .dropdown-item:disabled {\n pointer-events: none;\n background-color: transparent;\n}\n\ndiv.timely .dropdown-item-text {\n display: block;\n padding: 0.25rem 1.5rem;\n color: #212529;\n}\n\ndiv.timely .dropup,\ndiv.timely .dropright,\ndiv.timely .dropdown,\ndiv.timely .dropleft {\n position: relative;\n}\n\ndiv.timely .dropdown-toggle {\n white-space: nowrap;\n}\n\ndiv.timely .dropdown-toggle::after {\n display: inline-block;\n margin-left: 0.255em;\n vertical-align: 0.255em;\n content: '';\n border-top: 0.3em solid;\n border-right: 0.3em solid transparent;\n border-bottom: 0;\n border-left: 0.3em solid transparent;\n}\n\ndiv.timely .dropdown-toggle:empty::after {\n margin-left: 0;\n}\n\ndiv.timely .dropdown-menu {\n position: absolute;\n top: 100%;\n left: 0;\n z-index: 1000;\n display: none;\n float: left;\n min-width: 10rem;\n padding: 0.5rem 0;\n margin: 0.125rem 0 0;\n font-size: 1rem;\n text-align: left;\n list-style: none;\n background-color: #fff;\n background-clip: padding-box;\n border: 1px solid rgba(0, 0, 0, 0.15);\n border-radius: 0.25rem;\n}\n\ndiv.timely .dropdown-menu-left {\n right: auto;\n left: 0;\n}\n\ndiv.timely .dropdown-menu-right {\n right: 0;\n left: auto;\n}\n\ndiv.timely .dropup .dropdown-menu {\n top: auto;\n bottom: 100%;\n margin-top: 0;\n margin-bottom: 0.125rem;\n}\n\ndiv.timely .dropup .dropdown-toggle::after {\n display: inline-block;\n margin-left: 0.255em;\n vertical-align: 0.255em;\n content: '';\n border-top: 0;\n border-right: 0.3em solid transparent;\n border-bottom: 0.3em solid;\n border-left: 0.3em solid transparent;\n}\n\ndiv.timely .dropup .dropdown-toggle:empty::after {\n margin-left: 0;\n}\n\ndiv.timely .dropright .dropdown-menu {\n top: 0;\n right: auto;\n left: 100%;\n margin-top: 0;\n margin-left: 0.125rem;\n}\n\ndiv.timely .dropright .dropdown-toggle::after {\n display: inline-block;\n margin-left: 0.255em;\n vertical-align: 0.255em;\n content: '';\n border-top: 0.3em solid transparent;\n border-right: 0;\n border-bottom: 0.3em solid transparent;\n border-left: 0.3em solid;\n}\n\ndiv.timely .dropright .dropdown-toggle:empty::after {\n margin-left: 0;\n}\n\ndiv.timely .dropright .dropdown-toggle::after {\n vertical-align: 0;\n}\n\ndiv.timely .dropleft .dropdown-menu {\n top: 0;\n right: 100%;\n left: auto;\n margin-top: 0;\n margin-right: 0.125rem;\n}\n\ndiv.timely .dropleft .dropdown-toggle::after {\n display: inline-bloLine truncated
|
||||
define(["@grafana/data","@grafana/runtime","@grafana/ui","lodash","module","react","react-dom"],((e,t,n,r,o,i,a)=>(()=>{var l={210:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var r=n(942),o=n.n(r),i=n(278),a=n.n(i)()(o());a.push([e.id,"div.timely .form-control {\n display: block;\n width: 100%;\n height: 32px;\n padding: 0px 8px;\n font-size: 14px;\n font-weight: 400;\n line-height: 1.5;\n border: 1px solid #ced4da;\n border-radius: 2px;\n transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;\n background-clip: padding-box;\n}\n\ndiv.timely .form-control::-ms-expand {\n background-color: transparent;\n border: 0;\n}\n\ndiv.timely .form-control:-moz-focusring {\n color: transparent;\n text-shadow: 0 0 0 #495057;\n}\n\ndiv.timely .form-control:focus,\ndiv.timely input:focus {\n border-color: #80bdff;\n outline: 0;\n transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;\n}\n\ndiv.timely .form-control-file,\ndiv.timely .form-control-range {\n display: block;\n width: 100%;\n}\n\ndiv.timely .form-control-plaintext {\n display: block;\n width: 100%;\n padding: 0.375rem 0;\n margin-bottom: 0;\n font-size: 1rem;\n line-height: 1.5;\n border: solid transparent;\n border-width: 1px 0;\n}\n\ndiv.timely .form-control-plaintext.form-control-sm,\ndiv.timely .form-control-plaintext.form-control-lg {\n padding-right: 0;\n padding-left: 0;\n}\n\ndiv.timely .form-control-sm {\n height: calc(1.5em + 0.5rem + 2px);\n padding: 0.25rem 0.5rem;\n font-size: 0.875rem;\n line-height: 1.5;\n border-radius: 0.2rem;\n}\n\ndiv.timely .form-control-lg {\n height: calc(1.5em + 1rem + 2px);\n padding: 0.5rem 1rem;\n font-size: 1.25rem;\n line-height: 1.5;\n border-radius: 0.3rem;\n}\n\ndiv.timely select.form-control[size],\ndiv.timely select.form-control[multiple] {\n height: auto;\n}\n\ndiv.timely textarea.form-control {\n height: auto;\n}\n\ndiv.timely .dropdown-item {\n display: block;\n width: 100%;\n padding: 0.25rem 1.5rem;\n clear: both;\n font-weight: 400;\n color: #212529;\n text-align: inherit;\n white-space: nowrap;\n background-color: transparent;\n border: 0;\n}\n\ndiv.timely .dropdown-item:hover,\ndiv.timely .dropdown-item:focus {\n color: #16181b;\n text-decoration: none;\n background-color: #f8f9fa;\n}\n\ndiv.timely .dropdown-item.active,\ndiv.timely .dropdown-item:active {\n color: #fff;\n text-decoration: none;\n background-color: #007bff;\n}\n\ndiv.timely .dropdown-item.disabled,\ndiv.timely .dropdown-item:disabled {\n pointer-events: none;\n background-color: transparent;\n}\n\ndiv.timely .dropdown-item-text {\n display: block;\n padding: 0.25rem 1.5rem;\n color: #212529;\n}\n\ndiv.timely .dropup,\ndiv.timely .dropright,\ndiv.timely .dropdown,\ndiv.timely .dropleft {\n position: relative;\n}\n\ndiv.timely .dropdown-toggle {\n white-space: nowrap;\n}\n\ndiv.timely .dropdown-toggle::after {\n display: inline-block;\n margin-left: 0.255em;\n vertical-align: 0.255em;\n content: '';\n border-top: 0.3em solid;\n border-right: 0.3em solid transparent;\n border-bottom: 0;\n border-left: 0.3em solid transparent;\n}\n\ndiv.timely .dropdown-toggle:empty::after {\n margin-left: 0;\n}\n\ndiv.timely .dropdown-menu {\n position: absolute;\n top: 100%;\n left: 0;\n z-index: 1000;\n display: none;\n float: left;\n min-width: 10rem;\n padding: 0.5rem 0;\n margin: 0.125rem 0 0;\n font-size: 1rem;\n text-align: left;\n list-style: none;\n background-color: #fff;\n background-clip: padding-box;\n border: 1px solid rgba(0, 0, 0, 0.15);\n border-radius: 0.25rem;\n}\n\ndiv.timely .dropdown-menu-left {\n right: auto;\n left: 0;\n}\n\ndiv.timely .dropdown-menu-right {\n right: 0;\n left: auto;\n}\n\ndiv.timely .dropup .dropdown-menu {\n top: auto;\n bottom: 100%;\n margin-top: 0;\n margin-bottom: 0.125rem;\n}\n\ndiv.timely .dropup .dropdown-toggle::after {\n display: inline-block;\n margin-left: 0.255em;\n vertical-align: 0.255em;\n content: '';\n border-top: 0;\n border-right: 0.3em solid transparent;\n border-bottom: 0.3em solid;\n border-left: 0.3em solid transparent;\n}\n\ndiv.timely .dropup .dropdown-toggle:empty::after {\n margin-left: 0;\n}\n\ndiv.timely .dropright .dropdown-menu {\n top: 0;\n right: auto;\n left: 100%;\n margin-top: 0;\n margin-left: 0.125rem;\n}\n\ndiv.timely .dropright .dropdown-toggle::after {\n display: inline-block;\n margin-left: 0.255em;\n vertical-align: 0.255em;\n content: '';\n border-top: 0.3em solid transparent;\n border-right: 0;\n border-bottom: 0.3em solid transparent;\n border-left: 0.3em solid;\n}\n\ndiv.timely .dropright .dropdown-toggle:empty::after {\n margin-left: 0;\n}\n\ndiv.timely .dropright .dropdown-toggle::after {\n vertical-align: 0;\n}\n\ndiv.timely .dropleft .dropdown-menu {\n top: 0;\n right: 100%;\n left: auto;\n margin-top: 0;\n margin-right: 0.125rem;\n}\n\ndiv.timely .dropleft .dropdown-toggle::after {\n display: inline-bloLine truncated
|
||||
//# sourceMappingURL=module.js.map
|
||||
+1
-1
@@ -1 +1 @@
|
||||
{"version":3,"file":"module.js","mappings":";;0MAGIA,QAA0B,GAA4B,KAE1DA,EAAwBC,KAAK,CAACC,EAAOC,GAAI,uhNAmUtC,GAAG,CAAC,QAAU,EAAE,QAAU,CAAC,+CAA+C,MAAQ,GAAG,SAAW,igFAAigF,eAAiB,CAAC,whNAAwhN,WAAa,MAE3pS,sFCvUIH,QAA0B,GAA4B,KAE1DA,EAAwBC,KAAK,CAACC,EAAOC,GAAI,kyDA8GtC,GAAG,CAAC,QAAU,EAAE,QAAU,CAAC,qCAAqC,MAAQ,GAAG,SAAW,kvBAAkvB,eAAiB,CAAC,myDAAmyD,WAAa,MAE7oF,gCC/GAD,EAAOE,QAAU,SAAUC,GACzB,IAAIC,EAAO,GA4EX,OAzEAA,EAAKC,SAAW,WACd,OAAOC,KAAKC,KAAI,SAAUC,GACxB,IAAIC,EAAU,GACVC,OAA+B,IAAZF,EAAK,GAoB5B,OAnBIA,EAAK,KACPC,GAAW,cAAcE,OAAOH,EAAK,GAAI,QAEvCA,EAAK,KACPC,GAAW,UAAUE,OAAOH,EAAK,GAAI,OAEnCE,IACFD,GAAW,SAASE,OAAOH,EAAK,GAAGI,OAAS,EAAI,IAAID,OAAOH,EAAK,IAAM,GAAI,OAE5EC,GAAWN,EAAuBK,GAC9BE,IACFD,GAAW,KAETD,EAAK,KACPC,GAAW,KAETD,EAAK,KACPC,GAAW,KAENA,CACT,IAAGI,KAAK,GACV,EAGAT,EAAKU,EAAI,SAAWC,EAASC,EAAOC,EAAQC,EAAUC,GAC7B,iBAAZJ,IACTA,EAAU,CAAC,CAAC,KAAMA,OAASK,KAE7B,IAAIC,EAAyB,CAAC,EAC9B,GAAIJ,EACF,IAAK,IAAIK,EAAI,EAAGA,EAAIhB,KAAKM,OAAQU,IAAK,CACpC,IAAIrB,EAAKK,KAAKgB,GAAG,GACP,MAANrB,IACFoB,EAAuBpB,IAAM,EAEjC,CAEF,IAAK,IAAIsB,EAAK,EAAGA,EAAKR,EAAQH,OAAQW,IAAM,CAC1C,IAAIf,EAAO,GAAGG,OAAOI,EAAQQ,IACzBN,GAAUI,EAAuBb,EAAK,WAGrB,IAAVW,SACc,IAAZX,EAAK,KAGdA,EAAK,GAAK,SAASG,OAAOH,EAAK,GAAGI,OAAS,EAAI,IAAID,OAAOH,EAAK,IAAM,GAAI,MAAMG,OAAOH,EAAK,GAAI,MAF/FA,EAAK,GAAKW,GAMVH,IACGR,EAAK,IAGRA,EAAK,GAAK,UAAUG,OAAOH,EAAK,GAAI,MAAMG,OAAOH,EAAK,GAAI,KAC1DA,EAAK,GAAKQ,GAHVR,EAAK,GAAKQ,GAMVE,IACGV,EAAK,IAGRA,EAAK,GAAK,cAAcG,OAAOH,EAAK,GAAI,OAAOG,OAAOH,EAAK,GAAI,KAC/DA,EAAK,GAAKU,GAHVV,EAAK,GAAK,GAAGG,OAAOO,IAMxBd,EAAKL,KAAKS,GACZ,CACF,EACOJ,CACT,wBClFAJ,EAAOE,QAAU,SAAUM,GACzB,IAAIC,EAAUD,EAAK,GACfgB,EAAahB,EAAK,GACtB,IAAKgB,EACH,OAAOf,EAET,GAAoB,mBAATgB,KAAqB,CAC9B,IAAIC,EAASD,KAAKE,SAASC,mBAAmBC,KAAKC,UAAUN,MACzDO,EAAO,+DAA+DpB,OAAOe,GAC7EM,EAAgB,OAAOrB,OAAOoB,EAAM,OACxC,MAAO,CAACtB,GAASE,OAAO,CAACqB,IAAgBnB,KAAK,KAChD,CACA,MAAO,CAACJ,GAASI,KAAK,KACxB,wBCTAb,EAAOE,QAAU,SAAS+B,EAAMC,EAAGC,GACjC,GAAID,IAAMC,EAAG,OAAO,EAEpB,GAAID,GAAKC,GAAiB,iBAALD,GAA6B,iBAALC,EAAe,CAC1D,GAAID,EAAEE,cAAgBD,EAAEC,YAAa,OAAO,EAE5C,IAAIxB,EAAQE,EAAGuB,EACf,GAAIC,MAAMC,QAAQL,GAAI,CAEpB,IADAtB,EAASsB,EAAEtB,SACGuB,EAAEvB,OAAQ,OAAO,EAC/B,IAAKE,EAAIF,EAAgB,GAARE,KACf,IAAKmB,EAAMC,EAAEpB,GAAIqB,EAAErB,IAAK,OAAO,EACjC,OAAO,CACT,CAIA,GAAIoB,EAAEE,cAAgBI,OAAQ,OAAON,EAAEO,SAAWN,EAAEM,QAAUP,EAAEQ,QAAUP,EAAEO,MAC5E,GAAIR,EAAES,UAAYC,OAAOC,UAAUF,QAAS,OAAOT,EAAES,YAAcR,EAAEQ,UACrE,GAAIT,EAAE7B,WAAauC,OAAOC,UAAUxC,SAAU,OAAO6B,EAAE7B,aAAe8B,EAAE9B,WAIxE,IADAO,GADAyB,EAAOO,OAAOP,KAAKH,IACLtB,UACCgC,OAAOP,KAAKF,GAAGvB,OAAQ,OAAO,EAE7C,IAAKE,EAAIF,EAAgB,GAARE,KACf,IAAK8B,OAAOC,UAAUC,eAAeC,KAAKZ,EAAGE,EAAKvB,IAAK,OAAO,EAEhE,IAAKA,EAAIF,EAAgB,GAARE,KAAY,CAC3B,IAAIkC,EAAMX,EAAKvB,GAEf,IAAKmB,EAAMC,EAAEc,GAAMb,EAAEa,IAAO,OAAO,CACrC,CAEA,OAAO,CACT,CAGA,OAAOd,GAAIA,GAAKC,GAAIA,CACtB,uBCGAnC,EAAOE,QA5BS,SAAS+C,EAAWC,EAAQhB,EAAGC,EAAGgB,EAAGC,EAAGC,EAAGC,GAOzD,IAAKL,EAAW,CACd,IAAIM,EACJ,QAAenC,IAAX8B,EACFK,EAAQ,IAAIC,MACV,qIAGG,CACL,IAAIC,EAAO,CAACvB,EAAGC,EAAGgB,EAAGC,EAAGC,EAAGC,GACvBI,EAAW,GACfH,EAAQ,IAAIC,MACVN,EAAOS,QAAQ,OAAO,WAAa,OAAOF,EAAKC,IAAa,MAExDE,KAAO,qBACf,CAGA,MADAL,EAAMM,YAAc,EACdN,CACR,CACF,iBCpCA,IASIO,EAAS,aAGTC,EAAa,qBAGbC,EAAa,aAGbC,EAAY,cAGZC,EAAeC,SAGfC,EAA8B,iBAAV,EAAAC,GAAsB,EAAAA,GAAU,EAAAA,EAAOzB,SAAWA,QAAU,EAAAyB,EAGhFC,EAA0B,iBAARC,MAAoBA,MAAQA,KAAK3B,SAAWA,QAAU2B,KAGxEC,EAAOJ,GAAcE,GAAYG,SAAS,cAATA,GAUjCC,EAPc9B,OAAOC,UAOQxC,SAG7BsE,EAAYC,KAAKC,IACjBC,EAAYF,KAAKG,IAkBjBC,EAAM,WACR,OAAOR,EAAKS,KAAKD,KACnB,EA2MA,SAASE,EAASC,GAChB,IAAIC,SAAcD,EAClB,QAASA,IAAkB,UAARC,GAA4B,YAARA,EACzC,CA2EA,SAASC,EAASF,GAChB,GAAoB,iBAATA,EACT,OAAOA,EAET,GAhCF,SAAkBA,GAChB,MAAuB,iBAATA,GAtBhB,SAAsBA,GACpB,QAASA,GAAyB,iBAATA,CAC3B,CAqBKG,CAAaH,IAzTF,mBAyTYT,EAAe3B,KAAKoC,EAChD,CA6BMI,CAASJ,GACX,OA3VM,IA6VR,GAAID,EAASC,GAAQ,CACnB,IAAIK,EAAgC,mBAAjBL,EAAMxC,QAAwBwC,EAAMxC,UAAYwC,EACnEA,EAAQD,EAASM,GAAUA,EAAQ,GAAMA,CAC3C,CACA,GAAoB,iBAATL,EACT,OAAiB,IAAVA,EAAcA,GAASA,EAEhCA,EAAQA,EAAMxB,QAAQG,EAAQ,IAC9B,IAAI2B,EAAWzB,EAAW0B,KAAKP,GAC/B,OAAQM,GAAYxB,EAAUyB,KAAKP,GAC/BjB,EAAaiB,EAAMQ,MAAM,GAAIF,EAAW,EAAI,GAC3C1B,EAAW2B,KAAKP,GAxWb,KAwW6BA,CACvC,CAEAnF,EAAOE,QAtPP,SAAkB0F,EAAMC,EAAMC,GAC5B,IAAIC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EAAiB,EACjBC,GAAU,EACVC,GAAS,EACTC,GAAW,EAEf,GAAmB,mBAARZ,EACT,MAAM,IAAIa,UArIQ,uBA+IpB,SAASC,EAAWC,GAClB,IAAIlD,EAAOsC,EACPa,EAAUZ,EAKd,OAHAD,EAAWC,OAAW5E,EACtBiF,EAAiBM,EACjBT,EAASN,EAAKiB,MAAMD,EAASnD,EAE/B,CAmBA,SAASqD,EAAaH,GACpB,IAAII,EAAoBJ,EAAOP,EAM/B,YAAyBhF,IAAjBgF,GAA+BW,GAAqBlB,GACzDkB,EAAoB,GAAOR,GANJI,EAAON,GAM8BJ,CACjE,CAEA,SAASe,IACP,IAAIL,EAAO3B,IACX,GAAI8B,EAAaH,GACf,OAAOM,EAAaN,GAGtBR,EAAUe,WAAWF,EAzBvB,SAAuBL,GACrB,IAEIT,EAASL,GAFWc,EAAOP,GAI/B,OAAOG,EAASzB,EAAUoB,EAAQD,GAHRU,EAAON,IAGkCH,CACrE,CAmBqCiB,CAAcR,GACnD,CAEA,SAASM,EAAaN,GAKpB,OAJAR,OAAU/E,EAINoF,GAAYT,EACPW,EAAWC,IAEpBZ,EAAWC,OAAW5E,EACf8E,EACT,CAcA,SAASkB,IACP,IAAIT,EAAO3B,IACPqC,EAAaP,EAAaH,GAM9B,GAJAZ,EAAWuB,UACXtB,EAAW1F,KACX8F,EAAeO,EAEXU,EAAY,CACd,QAAgBjG,IAAZ+E,EACF,OAvEN,SAAqBQ,GAMnB,OAJAN,EAAiBM,EAEjBR,EAAUe,WAAWF,EAAcnB,GAE5BS,EAAUI,EAAWC,GAAQT,CACtCLine truncated
|
||||
{"version":3,"file":"module.js","mappings":";;0MAGIA,QAA0B,GAA4B,KAE1DA,EAAwBC,KAAK,CAACC,EAAOC,GAAI,uhNAmUtC,GAAG,CAAC,QAAU,EAAE,QAAU,CAAC,+CAA+C,MAAQ,GAAG,SAAW,igFAAigF,eAAiB,CAAC,whNAAwhN,WAAa,MAE3pS,sFCvUIH,QAA0B,GAA4B,KAE1DA,EAAwBC,KAAK,CAACC,EAAOC,GAAI,kyDA8GtC,GAAG,CAAC,QAAU,EAAE,QAAU,CAAC,qCAAqC,MAAQ,GAAG,SAAW,kvBAAkvB,eAAiB,CAAC,myDAAmyD,WAAa,MAE7oF,gCC/GAD,EAAOE,QAAU,SAAUC,GACzB,IAAIC,EAAO,GA4EX,OAzEAA,EAAKC,SAAW,WACd,OAAOC,KAAKC,KAAI,SAAUC,GACxB,IAAIC,EAAU,GACVC,OAA+B,IAAZF,EAAK,GAoB5B,OAnBIA,EAAK,KACPC,GAAW,cAAcE,OAAOH,EAAK,GAAI,QAEvCA,EAAK,KACPC,GAAW,UAAUE,OAAOH,EAAK,GAAI,OAEnCE,IACFD,GAAW,SAASE,OAAOH,EAAK,GAAGI,OAAS,EAAI,IAAID,OAAOH,EAAK,IAAM,GAAI,OAE5EC,GAAWN,EAAuBK,GAC9BE,IACFD,GAAW,KAETD,EAAK,KACPC,GAAW,KAETD,EAAK,KACPC,GAAW,KAENA,CACT,IAAGI,KAAK,GACV,EAGAT,EAAKU,EAAI,SAAWC,EAASC,EAAOC,EAAQC,EAAUC,GAC7B,iBAAZJ,IACTA,EAAU,CAAC,CAAC,KAAMA,OAASK,KAE7B,IAAIC,EAAyB,CAAC,EAC9B,GAAIJ,EACF,IAAK,IAAIK,EAAI,EAAGA,EAAIhB,KAAKM,OAAQU,IAAK,CACpC,IAAIrB,EAAKK,KAAKgB,GAAG,GACP,MAANrB,IACFoB,EAAuBpB,IAAM,EAEjC,CAEF,IAAK,IAAIsB,EAAK,EAAGA,EAAKR,EAAQH,OAAQW,IAAM,CAC1C,IAAIf,EAAO,GAAGG,OAAOI,EAAQQ,IACzBN,GAAUI,EAAuBb,EAAK,WAGrB,IAAVW,SACc,IAAZX,EAAK,KAGdA,EAAK,GAAK,SAASG,OAAOH,EAAK,GAAGI,OAAS,EAAI,IAAID,OAAOH,EAAK,IAAM,GAAI,MAAMG,OAAOH,EAAK,GAAI,MAF/FA,EAAK,GAAKW,GAMVH,IACGR,EAAK,IAGRA,EAAK,GAAK,UAAUG,OAAOH,EAAK,GAAI,MAAMG,OAAOH,EAAK,GAAI,KAC1DA,EAAK,GAAKQ,GAHVR,EAAK,GAAKQ,GAMVE,IACGV,EAAK,IAGRA,EAAK,GAAK,cAAcG,OAAOH,EAAK,GAAI,OAAOG,OAAOH,EAAK,GAAI,KAC/DA,EAAK,GAAKU,GAHVV,EAAK,GAAK,GAAGG,OAAOO,IAMxBd,EAAKL,KAAKS,GACZ,CACF,EACOJ,CACT,wBClFAJ,EAAOE,QAAU,SAAUM,GACzB,IAAIC,EAAUD,EAAK,GACfgB,EAAahB,EAAK,GACtB,IAAKgB,EACH,OAAOf,EAET,GAAoB,mBAATgB,KAAqB,CAC9B,IAAIC,EAASD,KAAKE,SAASC,mBAAmBC,KAAKC,UAAUN,MACzDO,EAAO,+DAA+DpB,OAAOe,GAC7EM,EAAgB,OAAOrB,OAAOoB,EAAM,OACxC,MAAO,CAACtB,GAASE,OAAO,CAACqB,IAAgBnB,KAAK,KAChD,CACA,MAAO,CAACJ,GAASI,KAAK,KACxB,wBCTAb,EAAOE,QAAU,SAAS+B,EAAMC,EAAGC,GACjC,GAAID,IAAMC,EAAG,OAAO,EAEpB,GAAID,GAAKC,GAAiB,iBAALD,GAA6B,iBAALC,EAAe,CAC1D,GAAID,EAAEE,cAAgBD,EAAEC,YAAa,OAAO,EAE5C,IAAIxB,EAAQE,EAAGuB,EACf,GAAIC,MAAMC,QAAQL,GAAI,CAEpB,IADAtB,EAASsB,EAAEtB,SACGuB,EAAEvB,OAAQ,OAAO,EAC/B,IAAKE,EAAIF,EAAgB,GAARE,KACf,IAAKmB,EAAMC,EAAEpB,GAAIqB,EAAErB,IAAK,OAAO,EACjC,OAAO,CACT,CAIA,GAAIoB,EAAEE,cAAgBI,OAAQ,OAAON,EAAEO,SAAWN,EAAEM,QAAUP,EAAEQ,QAAUP,EAAEO,MAC5E,GAAIR,EAAES,UAAYC,OAAOC,UAAUF,QAAS,OAAOT,EAAES,YAAcR,EAAEQ,UACrE,GAAIT,EAAE7B,WAAauC,OAAOC,UAAUxC,SAAU,OAAO6B,EAAE7B,aAAe8B,EAAE9B,WAIxE,IADAO,GADAyB,EAAOO,OAAOP,KAAKH,IACLtB,UACCgC,OAAOP,KAAKF,GAAGvB,OAAQ,OAAO,EAE7C,IAAKE,EAAIF,EAAgB,GAARE,KACf,IAAK8B,OAAOC,UAAUC,eAAeC,KAAKZ,EAAGE,EAAKvB,IAAK,OAAO,EAEhE,IAAKA,EAAIF,EAAgB,GAARE,KAAY,CAC3B,IAAIkC,EAAMX,EAAKvB,GAEf,IAAKmB,EAAMC,EAAEc,GAAMb,EAAEa,IAAO,OAAO,CACrC,CAEA,OAAO,CACT,CAGA,OAAOd,GAAIA,GAAKC,GAAIA,CACtB,uBCGAnC,EAAOE,QA5BS,SAAS+C,EAAWC,EAAQhB,EAAGC,EAAGgB,EAAGC,EAAGC,EAAGC,GAOzD,IAAKL,EAAW,CACd,IAAIM,EACJ,QAAenC,IAAX8B,EACFK,EAAQ,IAAIC,MACV,qIAGG,CACL,IAAIC,EAAO,CAACvB,EAAGC,EAAGgB,EAAGC,EAAGC,EAAGC,GACvBI,EAAW,GACfH,EAAQ,IAAIC,MACVN,EAAOS,QAAQ,OAAO,WAAa,OAAOF,EAAKC,IAAa,MAExDE,KAAO,qBACf,CAGA,MADAL,EAAMM,YAAc,EACdN,CACR,CACF,iBCpCA,IASIO,EAAS,aAGTC,EAAa,qBAGbC,EAAa,aAGbC,EAAY,cAGZC,EAAeC,SAGfC,EAA8B,iBAAV,EAAAC,GAAsB,EAAAA,GAAU,EAAAA,EAAOzB,SAAWA,QAAU,EAAAyB,EAGhFC,EAA0B,iBAARC,MAAoBA,MAAQA,KAAK3B,SAAWA,QAAU2B,KAGxEC,EAAOJ,GAAcE,GAAYG,SAAS,cAATA,GAUjCC,EAPc9B,OAAOC,UAOQxC,SAG7BsE,EAAYC,KAAKC,IACjBC,EAAYF,KAAKG,IAkBjBC,EAAM,WACR,OAAOR,EAAKS,KAAKD,KACnB,EA2MA,SAASE,EAASC,GAChB,IAAIC,SAAcD,EAClB,QAASA,IAAkB,UAARC,GAA4B,YAARA,EACzC,CA2EA,SAASC,EAASF,GAChB,GAAoB,iBAATA,EACT,OAAOA,EAET,GAhCF,SAAkBA,GAChB,MAAuB,iBAATA,GAtBhB,SAAsBA,GACpB,QAASA,GAAyB,iBAATA,CAC3B,CAqBKG,CAAaH,IAzTF,mBAyTYT,EAAe3B,KAAKoC,EAChD,CA6BMI,CAASJ,GACX,OA3VM,IA6VR,GAAID,EAASC,GAAQ,CACnB,IAAIK,EAAgC,mBAAjBL,EAAMxC,QAAwBwC,EAAMxC,UAAYwC,EACnEA,EAAQD,EAASM,GAAUA,EAAQ,GAAMA,CAC3C,CACA,GAAoB,iBAATL,EACT,OAAiB,IAAVA,EAAcA,GAASA,EAEhCA,EAAQA,EAAMxB,QAAQG,EAAQ,IAC9B,IAAI2B,EAAWzB,EAAW0B,KAAKP,GAC/B,OAAQM,GAAYxB,EAAUyB,KAAKP,GAC/BjB,EAAaiB,EAAMQ,MAAM,GAAIF,EAAW,EAAI,GAC3C1B,EAAW2B,KAAKP,GAxWb,KAwW6BA,CACvC,CAEAnF,EAAOE,QAtPP,SAAkB0F,EAAMC,EAAMC,GAC5B,IAAIC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EAAiB,EACjBC,GAAU,EACVC,GAAS,EACTC,GAAW,EAEf,GAAmB,mBAARZ,EACT,MAAM,IAAIa,UArIQ,uBA+IpB,SAASC,EAAWC,GAClB,IAAIlD,EAAOsC,EACPa,EAAUZ,EAKd,OAHAD,EAAWC,OAAW5E,EACtBiF,EAAiBM,EACjBT,EAASN,EAAKiB,MAAMD,EAASnD,EAE/B,CAmBA,SAASqD,EAAaH,GACpB,IAAII,EAAoBJ,EAAOP,EAM/B,YAAyBhF,IAAjBgF,GAA+BW,GAAqBlB,GACzDkB,EAAoB,GAAOR,GANJI,EAAON,GAM8BJ,CACjE,CAEA,SAASe,IACP,IAAIL,EAAO3B,IACX,GAAI8B,EAAaH,GACf,OAAOM,EAAaN,GAGtBR,EAAUe,WAAWF,EAzBvB,SAAuBL,GACrB,IAEIT,EAASL,GAFWc,EAAOP,GAI/B,OAAOG,EAASzB,EAAUoB,EAAQD,GAHRU,EAAON,IAGkCH,CACrE,CAmBqCiB,CAAcR,GACnD,CAEA,SAASM,EAAaN,GAKpB,OAJAR,OAAU/E,EAINoF,GAAYT,EACPW,EAAWC,IAEpBZ,EAAWC,OAAW5E,EACf8E,EACT,CAcA,SAASkB,IACP,IAAIT,EAAO3B,IACPqC,EAAaP,EAAaH,GAM9B,GAJAZ,EAAWuB,UACXtB,EAAW1F,KACX8F,EAAeO,EAEXU,EAAY,CACd,QAAgBjG,IAAZ+E,EACF,OAvEN,SAAqBQ,GAMnB,OAJAN,EAAiBM,EAEjBR,EAAUe,WAAWF,EAAcnB,GAE5BS,EAAUI,EAAWC,GAAQT,CACtCLine truncated
|
||||
+4
-4
@@ -2,7 +2,7 @@
|
||||
"$schema": "https://raw.githubusercontent.com/grafana/grafana/main/docs/sources/developers/plugins/plugin.schema.json",
|
||||
"type": "datasource",
|
||||
"name": "Timely",
|
||||
"id": "nsa-timely-datasource",
|
||||
"id": "timely-datasource",
|
||||
"category": "tsdb",
|
||||
"metrics": true,
|
||||
"backend": true,
|
||||
@@ -31,12 +31,12 @@
|
||||
}
|
||||
],
|
||||
"screenshots": [],
|
||||
"version": "2.2.6-SNAPSHOT",
|
||||
"updated": "2026-10-19"
|
||||
"version": "2.2.0",
|
||||
"updated": "2025-03-04"
|
||||
},
|
||||
"dependencies": {
|
||||
"grafanaDependency": ">=10.0.0",
|
||||
"plugins": []
|
||||
},
|
||||
"buildMode": "production"
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -7,7 +7,7 @@ services:
|
||||
context: ./.config
|
||||
args:
|
||||
grafana_image: ${GRAFANA_IMAGE:-grafana-oss}
|
||||
grafana_version: ${GRAFANA_VERSION:-13.0.1}
|
||||
grafana_version: ${GRAFANA_VERSION:-11.5.2}
|
||||
development: ${DEVELOPMENT:-false}
|
||||
anonymous_auth_enabled: ${ANONYMOUS_AUTH_ENABLED:-true}
|
||||
ports:
|
||||
@@ -34,7 +34,7 @@ services:
|
||||
GF_DATAPROXY_LOGGING: 1
|
||||
GF_SECURITY_COOKIE_SECURE: true
|
||||
GF_USERS_AUTO_ASSIGN_ORG_ROLE: Editor
|
||||
GF_PLUGINS_ALLOW_LOADING_UNSIGNED_PLUGINS: nsa-timely-datasource
|
||||
GF_PLUGINS_ALLOW_LOADING_UNSIGNED_PLUGINS: timely-datasource
|
||||
GF_SERVER_ENFORCE_DOMAIN: true
|
||||
GF_SERVER_CERT_FILE: /etc/pki/testServer.cert
|
||||
GF_SERVER_CERT_KEY: /etc/pki/testServer.key
|
||||
|
||||
@@ -1,92 +1,95 @@
|
||||
module github.com/NationalSecurityAgency/timely-datasource
|
||||
|
||||
go 1.25.7
|
||||
go 1.22.7
|
||||
|
||||
toolchain go1.22.9
|
||||
|
||||
require (
|
||||
github.com/grafana/grafana-plugin-sdk-go v0.292.0
|
||||
github.com/grafana/grafana-plugin-sdk-go v0.260.3
|
||||
github.com/hashicorp/go-hclog v1.6.3
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/BurntSushi/toml v1.5.0 // indirect
|
||||
github.com/apache/arrow-go/v18 v18.5.2 // indirect
|
||||
github.com/BurntSushi/toml v1.4.0 // indirect
|
||||
github.com/apache/arrow-go/v18 v18.0.1-0.20241212180703-82be143d7c30 // indirect
|
||||
github.com/beorn7/perks v1.0.1 // indirect
|
||||
github.com/cenkalti/backoff/v5 v5.0.3 // indirect
|
||||
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
|
||||
github.com/cespare/xxhash/v2 v2.3.0 // indirect
|
||||
github.com/cheekybits/genny v1.0.0 // indirect
|
||||
github.com/clipperhouse/displaywidth v0.10.0 // indirect
|
||||
github.com/clipperhouse/uax29/v2 v2.6.0 // indirect
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.7 // indirect
|
||||
github.com/fatih/color v1.18.0 // indirect
|
||||
github.com/go-logr/logr v1.4.3 // indirect
|
||||
github.com/chromedp/cdproto v0.0.0-20220208224320-6efb837e6bc2 // indirect
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.5 // indirect
|
||||
github.com/elazarl/goproxy v0.0.0-20230731152917-f99041a5c027 // indirect
|
||||
github.com/fatih/color v1.15.0 // indirect
|
||||
github.com/getkin/kin-openapi v0.128.0 // indirect
|
||||
github.com/go-logr/logr v1.4.2 // indirect
|
||||
github.com/go-logr/stdr v1.2.2 // indirect
|
||||
github.com/goccy/go-json v0.10.5 // indirect
|
||||
github.com/gogo/googleapis v1.4.1 // indirect
|
||||
github.com/go-openapi/jsonpointer v0.21.0 // indirect
|
||||
github.com/go-openapi/swag v0.23.0 // indirect
|
||||
github.com/goccy/go-json v0.10.4 // indirect
|
||||
github.com/gogo/protobuf v1.3.2 // indirect
|
||||
github.com/golang/protobuf v1.5.4 // indirect
|
||||
github.com/google/flatbuffers v25.12.19+incompatible // indirect
|
||||
github.com/google/go-cmp v0.7.0 // indirect
|
||||
github.com/google/flatbuffers v24.3.25+incompatible // indirect
|
||||
github.com/google/go-cmp v0.6.0 // indirect
|
||||
github.com/google/uuid v1.6.0 // indirect
|
||||
github.com/gorilla/mux v1.8.1 // indirect
|
||||
github.com/grafana/otel-profiling-go v0.5.1 // indirect
|
||||
github.com/grafana/pyroscope-go/godeltaprof v0.1.9 // indirect
|
||||
github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.1.0 // indirect
|
||||
github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.3 // indirect
|
||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.28.0 // indirect
|
||||
github.com/hashicorp/go-plugin v1.7.0 // indirect
|
||||
github.com/hashicorp/yamux v0.1.2 // indirect
|
||||
github.com/jaegertracing/jaeger-idl v0.6.0 // indirect
|
||||
github.com/grafana/pyroscope-go/godeltaprof v0.1.8 // indirect
|
||||
github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.0.1 // indirect
|
||||
github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.1.0 // indirect
|
||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.23.0 // indirect
|
||||
github.com/hashicorp/go-plugin v1.6.2 // indirect
|
||||
github.com/hashicorp/yamux v0.1.1 // indirect
|
||||
github.com/invopop/yaml v0.3.1 // indirect
|
||||
github.com/josharian/intern v1.0.0 // indirect
|
||||
github.com/json-iterator/go v1.1.12 // indirect
|
||||
github.com/klauspost/compress v1.18.4 // indirect
|
||||
github.com/klauspost/cpuid/v2 v2.3.0 // indirect
|
||||
github.com/magefile/mage v1.17.1 // indirect
|
||||
github.com/klauspost/compress v1.17.11 // indirect
|
||||
github.com/klauspost/cpuid/v2 v2.2.9 // indirect
|
||||
github.com/magefile/mage v1.15.0 // indirect
|
||||
github.com/mailru/easyjson v0.7.7 // indirect
|
||||
github.com/mattetti/filebuffer v1.0.1 // indirect
|
||||
github.com/mattn/go-colorable v0.1.14 // indirect
|
||||
github.com/mattn/go-isatty v0.0.20 // indirect
|
||||
github.com/mattn/go-runewidth v0.0.19 // indirect
|
||||
github.com/mattn/go-colorable v0.1.13 // indirect
|
||||
github.com/mattn/go-isatty v0.0.19 // indirect
|
||||
github.com/mattn/go-runewidth v0.0.9 // indirect
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
||||
github.com/modern-go/reflect2 v1.0.2 // indirect
|
||||
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect
|
||||
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
|
||||
github.com/oklog/run v1.1.0 // indirect
|
||||
github.com/olekukonko/cat v0.0.0-20250911104152-50322a0618f6 // indirect
|
||||
github.com/olekukonko/errors v1.2.0 // indirect
|
||||
github.com/olekukonko/ll v0.1.6 // indirect
|
||||
github.com/olekukonko/tablewriter v1.1.4 // indirect
|
||||
github.com/patrickmn/go-cache v2.1.0+incompatible // indirect
|
||||
github.com/pierrec/lz4/v4 v4.1.25 // indirect
|
||||
github.com/prometheus/client_golang v1.23.2 // indirect
|
||||
github.com/prometheus/client_model v0.6.2 // indirect
|
||||
github.com/prometheus/common v0.67.5 // indirect
|
||||
github.com/prometheus/procfs v0.16.1 // indirect
|
||||
github.com/olekukonko/tablewriter v0.0.5 // indirect
|
||||
github.com/perimeterx/marshmallow v1.1.5 // indirect
|
||||
github.com/pierrec/lz4/v4 v4.1.21 // indirect
|
||||
github.com/prometheus/client_golang v1.20.5 // indirect
|
||||
github.com/prometheus/client_model v0.6.1 // indirect
|
||||
github.com/prometheus/common v0.61.0 // indirect
|
||||
github.com/prometheus/procfs v0.15.1 // indirect
|
||||
github.com/russross/blackfriday/v2 v2.1.0 // indirect
|
||||
github.com/unknwon/bra v0.0.0-20200517080246-1e3013ecaff8 // indirect
|
||||
github.com/unknwon/com v1.0.1 // indirect
|
||||
github.com/unknwon/log v0.0.0-20150304194804-e617c87089d3 // indirect
|
||||
github.com/urfave/cli v1.22.17 // indirect
|
||||
github.com/zeebo/xxh3 v1.1.0 // indirect
|
||||
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
|
||||
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.67.0 // indirect
|
||||
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.67.0 // indirect
|
||||
go.opentelemetry.io/contrib/propagators/jaeger v1.42.0 // indirect
|
||||
go.opentelemetry.io/contrib/samplers/jaegerremote v0.36.0 // indirect
|
||||
go.opentelemetry.io/otel v1.43.0 // indirect
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.43.0 // indirect
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.43.0 // indirect
|
||||
go.opentelemetry.io/otel/metric v1.43.0 // indirect
|
||||
go.opentelemetry.io/otel/sdk v1.43.0 // indirect
|
||||
go.opentelemetry.io/otel/trace v1.43.0 // indirect
|
||||
go.opentelemetry.io/proto/otlp v1.10.0 // indirect
|
||||
go.yaml.in/yaml/v2 v2.4.3 // indirect
|
||||
golang.org/x/exp v0.0.0-20260112195511-716be5621a96 // indirect
|
||||
golang.org/x/mod v0.33.0 // indirect
|
||||
golang.org/x/net v0.52.0 // indirect
|
||||
golang.org/x/sync v0.20.0 // indirect
|
||||
golang.org/x/sys v0.43.0 // indirect
|
||||
golang.org/x/telemetry v0.0.0-20260209163413-e7419c687ee4 // indirect
|
||||
golang.org/x/text v0.35.0 // indirect
|
||||
golang.org/x/tools v0.42.0 // indirect
|
||||
golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da // indirect
|
||||
github.com/urfave/cli v1.22.16 // indirect
|
||||
github.com/zeebo/xxh3 v1.0.2 // indirect
|
||||
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.57.0 // indirect
|
||||
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.57.0 // indirect
|
||||
go.opentelemetry.io/contrib/propagators/jaeger v1.32.0 // indirect
|
||||
go.opentelemetry.io/contrib/samplers/jaegerremote v0.26.0 // indirect
|
||||
go.opentelemetry.io/otel v1.32.0 // indirect
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.32.0 // indirect
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.32.0 // indirect
|
||||
go.opentelemetry.io/otel/metric v1.32.0 // indirect
|
||||
go.opentelemetry.io/otel/sdk v1.32.0 // indirect
|
||||
go.opentelemetry.io/otel/trace v1.32.0 // indirect
|
||||
go.opentelemetry.io/proto/otlp v1.3.1 // indirect
|
||||
golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 // indirect
|
||||
golang.org/x/mod v0.22.0 // indirect
|
||||
golang.org/x/net v0.32.0 // indirect
|
||||
golang.org/x/sync v0.10.0 // indirect
|
||||
golang.org/x/sys v0.28.0 // indirect
|
||||
golang.org/x/text v0.21.0 // indirect
|
||||
golang.org/x/tools v0.28.0 // indirect
|
||||
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect
|
||||
google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79 // indirect
|
||||
google.golang.org/grpc v1.80.0 // indirect
|
||||
google.golang.org/protobuf v1.36.11 // indirect
|
||||
google.golang.org/grpc v1.68.1 // indirect
|
||||
google.golang.org/protobuf v1.35.2 // indirect
|
||||
gopkg.in/fsnotify/fsnotify.v1 v1.4.7 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
)
|
||||
+154
-148
@@ -1,58 +1,67 @@
|
||||
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||
github.com/BurntSushi/toml v1.5.0 h1:W5quZX/G/csjUnuI8SUYlsHs9M38FC7znL0lIO+DvMg=
|
||||
github.com/BurntSushi/toml v1.5.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
|
||||
github.com/andybalholm/brotli v1.2.0 h1:ukwgCxwYrmACq68yiUqwIWnGY0cTPox/M94sVwToPjQ=
|
||||
github.com/andybalholm/brotli v1.2.0/go.mod h1:rzTDkvFWvIrjDXZHkuS16NPggd91W3kUSvPlQ1pLaKY=
|
||||
github.com/apache/arrow-go/v18 v18.5.2 h1:3uoHjoaEie5eVsxx/Bt64hKwZx4STb+beAkqKOlq/lY=
|
||||
github.com/apache/arrow-go/v18 v18.5.2/go.mod h1:yNoizNTT4peTciJ7V01d2EgOkE1d0fQ1vZcFOsVtFsw=
|
||||
github.com/apache/thrift v0.22.0 h1:r7mTJdj51TMDe6RtcmNdQxgn9XcyfGDOzegMDRg47uc=
|
||||
github.com/apache/thrift v0.22.0/go.mod h1:1e7J/O1Ae6ZQMTYdy9xa3w9k+XHWPfRvdPyJeynQ+/g=
|
||||
github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0=
|
||||
github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
|
||||
github.com/andybalholm/brotli v1.1.1 h1:PR2pgnyFznKEugtsUo0xLdDop5SKXd5Qf5ysW+7XdTA=
|
||||
github.com/andybalholm/brotli v1.1.1/go.mod h1:05ib4cKhjx3OQYUY22hTVd34Bc8upXjOLL2rKwwZBoA=
|
||||
github.com/apache/arrow-go/v18 v18.0.1-0.20241212180703-82be143d7c30 h1:hXVi7QKuCQ0E8Yujfu9b0f0RnzZ72efpWvPnZgnJPrE=
|
||||
github.com/apache/arrow-go/v18 v18.0.1-0.20241212180703-82be143d7c30/go.mod h1:RNuWDIiGjq5nndL2PyQrndUy9nMLwheA3uWaAV7fe4U=
|
||||
github.com/apache/thrift v0.21.0 h1:tdPmh/ptjE1IJnhbhrcl2++TauVjy242rkV/UzJChnE=
|
||||
github.com/apache/thrift v0.21.0/go.mod h1:W1H8aR/QRtYNvrPeFXBtobyRkd0/YVhTc6i07XIAgDw=
|
||||
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
|
||||
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
|
||||
github.com/bufbuild/protocompile v0.14.1 h1:iA73zAf/fyljNjQKwYzUHD6AD4R8KMasmwa/FBatYVw=
|
||||
github.com/bufbuild/protocompile v0.14.1/go.mod h1:ppVdAIhbr2H8asPk6k4pY7t9zB1OU5DoEw9xY/FUi1c=
|
||||
github.com/cenkalti/backoff/v5 v5.0.3 h1:ZN+IMa753KfX5hd8vVaMixjnqRZ3y8CuJKRKj1xcsSM=
|
||||
github.com/cenkalti/backoff/v5 v5.0.3/go.mod h1:rkhZdG3JZukswDf7f0cwqPNk4K0sa+F97BxZthm/crw=
|
||||
github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA=
|
||||
github.com/bufbuild/protocompile v0.4.0/go.mod h1:3v93+mbWn/v3xzN+31nwkJfrEpAUwp+BagBSZWx+TP8=
|
||||
github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8=
|
||||
github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
|
||||
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
|
||||
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
|
||||
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
|
||||
github.com/cheekybits/genny v1.0.0 h1:uGGa4nei+j20rOSeDeP5Of12XVm7TGUd4dJA9RDitfE=
|
||||
github.com/cheekybits/genny v1.0.0/go.mod h1:+tQajlRqAUrPI7DOSpB0XAqZYtQakVtB7wXkRAgjxjQ=
|
||||
github.com/chromedp/cdproto v0.0.0-20220208224320-6efb837e6bc2 h1:XCdvHbz3LhewBHN7+mQPx0sg/Hxil/1USnBmxkjHcmY=
|
||||
github.com/chromedp/cdproto v0.0.0-20220208224320-6efb837e6bc2/go.mod h1:At5TxYYdxkbQL0TSefRjhLE3Q0lgvqKKMSFUglJ7i1U=
|
||||
github.com/chromedp/sysutil v1.0.0/go.mod h1:kgWmDdq8fTzXYcKIBqIYvRRTnYb9aNS9moAV0xufSww=
|
||||
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
|
||||
github.com/clipperhouse/displaywidth v0.10.0 h1:GhBG8WuerxjFQQYeuZAeVTuyxuX+UraiZGD4HJQ3Y8g=
|
||||
github.com/clipperhouse/displaywidth v0.10.0/go.mod h1:XqJajYsaiEwkxOj4bowCTMcT1SgvHo9flfF3jQasdbs=
|
||||
github.com/clipperhouse/uax29/v2 v2.6.0 h1:z0cDbUV+aPASdFb2/ndFnS9ts/WNXgTNNGFoKXuhpos=
|
||||
github.com/clipperhouse/uax29/v2 v2.6.0/go.mod h1:Wn1g7MK6OoeDT0vL+Q0SQLDz/KpfsVRgg6W7ihQeh4g=
|
||||
github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.7 h1:zbFlGlXEAKlwXpmvle3d8Oe3YnkKIK4xSRTd3sHPnBo=
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.7/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.5 h1:ZtcqGrnekaHpVLArFSe4HK5DoKx1T0rq2DwVB0alcyc=
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.5/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
|
||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/elazarl/goproxy v0.0.0-20230731152917-f99041a5c027 h1:1L0aalTpPz7YlMxETKpmQoWMBkeiuorElZIXoNmgiPE=
|
||||
github.com/elazarl/goproxy v0.0.0-20230731152917-f99041a5c027/go.mod h1:Ro8st/ElPeALwNFlcTpWmkr6IoMFfkjXAvTHpevnDsM=
|
||||
github.com/elazarl/goproxy/ext v0.0.0-20190711103511-473e67f1d7d2/go.mod h1:gNh8nYJoAm43RfaxurUnxr+N1PwuFV3ZMl/efxlIlY8=
|
||||
github.com/elazarl/goproxy/ext v0.0.0-20220115173737-adb46da277ac h1:9yrT5tmn9Zc0ytWPASlaPwQfQMQYnRf0RSDe1XvHw0Q=
|
||||
github.com/elazarl/goproxy/ext v0.0.0-20220115173737-adb46da277ac/go.mod h1:gNh8nYJoAm43RfaxurUnxr+N1PwuFV3ZMl/efxlIlY8=
|
||||
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
|
||||
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
|
||||
github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
|
||||
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
|
||||
github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=
|
||||
github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM=
|
||||
github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU=
|
||||
github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs=
|
||||
github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw=
|
||||
github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=
|
||||
github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
|
||||
github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I=
|
||||
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
|
||||
github.com/getkin/kin-openapi v0.128.0 h1:jqq3D9vC9pPq1dGcOCv7yOp1DaEe7c/T1vzcLbITSp4=
|
||||
github.com/getkin/kin-openapi v0.128.0/go.mod h1:OZrfXzUfGrNbsKj+xmFBx6E5c6yH3At/tAKSc2UszXM=
|
||||
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
|
||||
github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
|
||||
github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=
|
||||
github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
|
||||
github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
|
||||
github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
|
||||
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
|
||||
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
|
||||
github.com/goccy/go-json v0.10.5 h1:Fq85nIqj+gXn/S5ahsiTlK3TmC85qgirsdTP/+DeaC4=
|
||||
github.com/goccy/go-json v0.10.5/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M=
|
||||
github.com/gogo/googleapis v1.4.1 h1:1Yx4Myt7BxzvUr5ldGSbwYiZG6t9wGBZ+8/fX3Wvtq0=
|
||||
github.com/gogo/googleapis v1.4.1/go.mod h1:2lpHqI5OcWCtVElxXnPt+s8oJvMpySlOyM6xDCrzib4=
|
||||
github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ=
|
||||
github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY=
|
||||
github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE=
|
||||
github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ=
|
||||
github.com/go-test/deep v1.0.8 h1:TDsG77qcSprGbC6vTN8OuXp5g+J+b5Pcguhf7Zt61VM=
|
||||
github.com/go-test/deep v1.0.8/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE=
|
||||
github.com/goccy/go-json v0.10.4 h1:JSwxQzIqKfmFX1swYPpUThQZp/Ka4wzJdK0LWVytLPM=
|
||||
github.com/goccy/go-json v0.10.4/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M=
|
||||
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
|
||||
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
|
||||
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
|
||||
@@ -70,47 +79,50 @@ github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaS
|
||||
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
|
||||
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
|
||||
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
|
||||
github.com/golang/snappy v1.0.0 h1:Oy607GVXHs7RtbggtPBnr2RmDArIsAefDwvrdWvRhGs=
|
||||
github.com/golang/snappy v1.0.0/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
|
||||
github.com/google/flatbuffers v25.12.19+incompatible h1:haMV2JRRJCe1998HeW/p0X9UaMTK6SDo0ffLn2+DbLs=
|
||||
github.com/google/flatbuffers v25.12.19+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8=
|
||||
github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM=
|
||||
github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
|
||||
github.com/google/flatbuffers v24.3.25+incompatible h1:CX395cjN9Kke9mmalRoL3d81AtFUxJM+yDthflgJGkI=
|
||||
github.com/google/flatbuffers v24.3.25+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8=
|
||||
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
|
||||
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
|
||||
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
|
||||
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
|
||||
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
|
||||
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/gopherjs/gopherjs v0.0.0-20181103185306-d547d1d9531e h1:JKmoR8x90Iww1ks85zJ1lfDGgIiMDuIptTOhJq+zKyg=
|
||||
github.com/gopherjs/gopherjs v0.0.0-20181103185306-d547d1d9531e/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
|
||||
github.com/grafana/grafana-plugin-sdk-go v0.292.0 h1:HaFIbBmPX9K+BVsVemid+poDEbja+HJ8VE+6tVnZKLU=
|
||||
github.com/grafana/grafana-plugin-sdk-go v0.292.0/go.mod h1:lnWyfzENuIU+N2EzivEe9YJob8AAqPl7HBMXMbPyv3k=
|
||||
github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY=
|
||||
github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ=
|
||||
github.com/grafana/grafana-plugin-sdk-go v0.260.3 h1:7ri52MhUMouQKf2q9z3RsxSX464FLD3mSJZCv65ux5g=
|
||||
github.com/grafana/grafana-plugin-sdk-go v0.260.3/go.mod h1:X+6ipUy022esjdomutNjHbH67CbJJzEhkrvvfMbvL8A=
|
||||
github.com/grafana/otel-profiling-go v0.5.1 h1:stVPKAFZSa7eGiqbYuG25VcqYksR6iWvF3YH66t4qL8=
|
||||
github.com/grafana/otel-profiling-go v0.5.1/go.mod h1:ftN/t5A/4gQI19/8MoWurBEtC6gFw8Dns1sJZ9W4Tls=
|
||||
github.com/grafana/pyroscope-go/godeltaprof v0.1.9 h1:c1Us8i6eSmkW+Ez05d3co8kasnuOY813tbMN8i/a3Og=
|
||||
github.com/grafana/pyroscope-go/godeltaprof v0.1.9/go.mod h1:2+l7K7twW49Ct4wFluZD3tZ6e0SjanjcUUBPVD/UuGU=
|
||||
github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.1.0 h1:QGLs/O40yoNK9vmy4rhUGBVyMf1lISBGtXRpsu/Qu/o=
|
||||
github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.1.0/go.mod h1:hM2alZsMUni80N33RBe6J0e423LB+odMj7d3EMP9l20=
|
||||
github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.3 h1:B+8ClL/kCQkRiU82d9xajRPKYMrB7E0MbtzWVi1K4ns=
|
||||
github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.3/go.mod h1:NbCUVmiS4foBGBHOYlCT25+YmGpJ32dZPi75pGEUpj4=
|
||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.28.0 h1:HWRh5R2+9EifMyIHV7ZV+MIZqgz+PMpZ14Jynv3O2Zs=
|
||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.28.0/go.mod h1:JfhWUomR1baixubs02l85lZYYOm7LV6om4ceouMv45c=
|
||||
github.com/grafana/pyroscope-go/godeltaprof v0.1.8 h1:iwOtYXeeVSAeYefJNaxDytgjKtUuKQbJqgAIjlnicKg=
|
||||
github.com/grafana/pyroscope-go/godeltaprof v0.1.8/go.mod h1:2+l7K7twW49Ct4wFluZD3tZ6e0SjanjcUUBPVD/UuGU=
|
||||
github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.0.1 h1:qnpSQwGEnkcRpTqNOIR6bJbR0gAorgP9CSALpRcKoAA=
|
||||
github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.0.1/go.mod h1:lXGCsh6c22WGtjr+qGHj1otzZpV/1kwTMAqkwZsnWRU=
|
||||
github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.1.0 h1:pRhl55Yx1eC7BZ1N+BBWwnKaMyD8uC+34TLdndZMAKk=
|
||||
github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.1.0/go.mod h1:XKMd7iuf/RGPSMJ/U4HP0zS2Z9Fh8Ps9a+6X26m/tmI=
|
||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.23.0 h1:ad0vkEBuk23VJzZR9nkLVG0YAoN9coASF1GusYX6AlU=
|
||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.23.0/go.mod h1:igFoXX2ELCW06bol23DWPB5BEWfZISOzSP5K2sbLea0=
|
||||
github.com/hashicorp/go-hclog v1.6.3 h1:Qr2kF+eVWjTiYmU7Y31tYlP1h0q/X3Nl3tPGdaB11/k=
|
||||
github.com/hashicorp/go-hclog v1.6.3/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M=
|
||||
github.com/hashicorp/go-plugin v1.7.0 h1:YghfQH/0QmPNc/AZMTFE3ac8fipZyZECHdDPshfk+mA=
|
||||
github.com/hashicorp/go-plugin v1.7.0/go.mod h1:BExt6KEaIYx804z8k4gRzRLEvxKVb+kn0NMcihqOqb8=
|
||||
github.com/hashicorp/yamux v0.1.2 h1:XtB8kyFOyHXYVFnwT5C3+Bdo8gArse7j2AQ0DA0Uey8=
|
||||
github.com/hashicorp/yamux v0.1.2/go.mod h1:C+zze2n6e/7wshOZep2A70/aQU6QBRWJO/G6FT1wIns=
|
||||
github.com/jaegertracing/jaeger-idl v0.6.0 h1:LOVQfVby9ywdMPI9n3hMwKbyLVV3BL1XH2QqsP5KTMk=
|
||||
github.com/jaegertracing/jaeger-idl v0.6.0/go.mod h1:mpW0lZfG907/+o5w5OlnNnig7nHJGT3SfKmRqC42HGQ=
|
||||
github.com/jhump/protoreflect v1.17.0 h1:qOEr613fac2lOuTgWN4tPAtLL7fUSbuJL5X5XumQh94=
|
||||
github.com/jhump/protoreflect v1.17.0/go.mod h1:h9+vUUL38jiBzck8ck+6G/aeMX8Z4QUY/NiJPwPNi+8=
|
||||
github.com/hashicorp/go-plugin v1.6.2 h1:zdGAEd0V1lCaU0u+MxWQhtSDQmahpkwOun8U8EiRVog=
|
||||
github.com/hashicorp/go-plugin v1.6.2/go.mod h1:CkgLQ5CZqNmdL9U9JzM532t8ZiYQ35+pj3b1FD37R0Q=
|
||||
github.com/hashicorp/yamux v0.1.1 h1:yrQxtgseBDrq9Y652vSRDvsKCJKOUD+GzTS4Y0Y8pvE=
|
||||
github.com/hashicorp/yamux v0.1.1/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ=
|
||||
github.com/invopop/yaml v0.3.1 h1:f0+ZpmhfBSS4MhG+4HYseMdJhoeeopbSKbq5Rpeelso=
|
||||
github.com/invopop/yaml v0.3.1/go.mod h1:PMOp3nn4/12yEZUFfmOuNHJsZToEEOwoWsT+D81KkeA=
|
||||
github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c=
|
||||
github.com/jhump/protoreflect v1.15.1/go.mod h1:jD/2GMKKE6OqX8qTjhADU1e6DShO+gavG9e0Q693nKo=
|
||||
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
|
||||
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
|
||||
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
|
||||
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
|
||||
github.com/jtolds/gls v4.2.1+incompatible h1:fSuqC+Gmlu6l/ZYAoZzx2pyucC8Xza35fpRVWLVmUEE=
|
||||
@@ -119,30 +131,33 @@ github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI
|
||||
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
||||
github.com/klauspost/asmfmt v1.3.2 h1:4Ri7ox3EwapiOjCki+hw14RyKk201CN4rzyCJRFLpK4=
|
||||
github.com/klauspost/asmfmt v1.3.2/go.mod h1:AG8TuvYojzulgDAMCnYn50l/5QV3Bs/tp6j0HLHbNSE=
|
||||
github.com/klauspost/compress v1.18.4 h1:RPhnKRAQ4Fh8zU2FY/6ZFDwTVTxgJ/EMydqSTzE9a2c=
|
||||
github.com/klauspost/compress v1.18.4/go.mod h1:R0h/fSBs8DE4ENlcrlib3PsXS61voFxhIs2DeRhCvJ4=
|
||||
github.com/klauspost/cpuid/v2 v2.3.0 h1:S4CRMLnYUhGeDFDqkGriYKdfoFlDnMtqTiI/sFzhA9Y=
|
||||
github.com/klauspost/cpuid/v2 v2.3.0/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0=
|
||||
github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc=
|
||||
github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0=
|
||||
github.com/klauspost/cpuid/v2 v2.2.9 h1:66ze0taIn2H33fBvCkXuv9BmCwDfafmiIVpKV9kKGuY=
|
||||
github.com/klauspost/cpuid/v2 v2.2.9/go.mod h1:rqkxqrZ1EhYM9G+hXH7YdowN5R5RGN6NK4QwQ3WMXF8=
|
||||
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
|
||||
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
|
||||
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
||||
github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
|
||||
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
|
||||
github.com/magefile/mage v1.17.1 h1:F1d2lnLSlbQDM0Plq6Ac4NtaHxkxTK8t5nrMY9SkoNA=
|
||||
github.com/magefile/mage v1.17.1/go.mod h1:Yj51kqllmsgFpvvSzgrZPK9WtluG3kUhFaBUVLo4feA=
|
||||
github.com/magefile/mage v1.15.0 h1:BvGheCMAsG3bWUDbZ8AyXXpCNwU9u5CB6sM+HNb9HYg=
|
||||
github.com/magefile/mage v1.15.0/go.mod h1:z5UZb/iS3GoOSn0JgWuiw7dxlurVYTu+/jHXqQg881A=
|
||||
github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
|
||||
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
|
||||
github.com/mattetti/filebuffer v1.0.1 h1:gG7pyfnSIZCxdoKq+cPa8T0hhYtD9NxCdI4D7PTjRLM=
|
||||
github.com/mattetti/filebuffer v1.0.1/go.mod h1:YdMURNDOttIiruleeVr6f56OrMc+MydEnTcXwtkxNVs=
|
||||
github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
|
||||
github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4=
|
||||
github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE=
|
||||
github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8=
|
||||
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
|
||||
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
|
||||
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
|
||||
github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
|
||||
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
|
||||
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
|
||||
github.com/mattn/go-runewidth v0.0.19 h1:v++JhqYnZuu5jSKrk9RbgF5v4CGUjqRfBm05byFGLdw=
|
||||
github.com/mattn/go-runewidth v0.0.19/go.mod h1:XBkDxAl56ILZc9knddidhrOlY5R/pDhgLpndooCuJAs=
|
||||
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
|
||||
github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA=
|
||||
github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
|
||||
github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0=
|
||||
github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
|
||||
github.com/minio/asm2plan9s v0.0.0-20200509001527-cdd76441f9d8 h1:AMFGa4R4MiIpspGNG7Z948v4n35fFGB3RR3G/ry4FWs=
|
||||
github.com/minio/asm2plan9s v0.0.0-20200509001527-cdd76441f9d8/go.mod h1:mC1jAcsrzbxHt8iiaC+zU4b1ylILSosueou12R++wfY=
|
||||
github.com/minio/c2goasm v0.0.0-20190812172519-36a3d3bbc4f3 h1:+n/aFZefKZp7spd8DFdX7uMikMLXX4oubIzJF4kv/wI=
|
||||
@@ -154,36 +169,32 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
|
||||
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
|
||||
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw=
|
||||
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8=
|
||||
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
|
||||
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
|
||||
github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA=
|
||||
github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU=
|
||||
github.com/olekukonko/cat v0.0.0-20250911104152-50322a0618f6 h1:zrbMGy9YXpIeTnGj4EljqMiZsIcE09mmF8XsD5AYOJc=
|
||||
github.com/olekukonko/cat v0.0.0-20250911104152-50322a0618f6/go.mod h1:rEKTHC9roVVicUIfZK7DYrdIoM0EOr8mK1Hj5s3JjH0=
|
||||
github.com/olekukonko/errors v1.2.0 h1:10Zcn4GeV59t/EGqJc8fUjtFT/FuUh5bTMzZ1XwmCRo=
|
||||
github.com/olekukonko/errors v1.2.0/go.mod h1:ppzxA5jBKcO1vIpCXQ9ZqgDh8iwODz6OXIGKU8r5m4Y=
|
||||
github.com/olekukonko/ll v0.1.6 h1:lGVTHO+Qc4Qm+fce/2h2m5y9LvqaW+DCN7xW9hsU3uA=
|
||||
github.com/olekukonko/ll v0.1.6/go.mod h1:NVUmjBb/aCtUpjKk75BhWrOlARz3dqsM+OtszpY4o88=
|
||||
github.com/olekukonko/tablewriter v1.1.4 h1:ORUMI3dXbMnRlRggJX3+q7OzQFDdvgbN9nVWj1drm6I=
|
||||
github.com/olekukonko/tablewriter v1.1.4/go.mod h1:+kedxuyTtgoZLwif3P1Em4hARJs+mVnzKxmsCL/C5RY=
|
||||
github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc=
|
||||
github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ=
|
||||
github.com/pierrec/lz4/v4 v4.1.25 h1:kocOqRffaIbU5djlIBr7Wh+cx82C0vtFb0fOurZHqD0=
|
||||
github.com/pierrec/lz4/v4 v4.1.25/go.mod h1:EoQMVJgeeEOMsCqCzqFm2O0cJvljX2nGZjcRIPL34O4=
|
||||
github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec=
|
||||
github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY=
|
||||
github.com/perimeterx/marshmallow v1.1.5 h1:a2LALqQ1BlHM8PZblsDdidgv1mWi1DgC2UmX50IvK2s=
|
||||
github.com/perimeterx/marshmallow v1.1.5/go.mod h1:dsXbUu8CRzfYP5a87xpp0xq9S3u0Vchtcl8we9tYaXw=
|
||||
github.com/pierrec/lz4/v4 v4.1.21 h1:yOVMLb6qSIDP67pl/5F7RepeKYu/VmTyEXvuMI5d9mQ=
|
||||
github.com/pierrec/lz4/v4 v4.1.21/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
|
||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/prometheus/client_golang v1.23.2 h1:Je96obch5RDVy3FDMndoUsjAhG5Edi49h0RJWRi/o0o=
|
||||
github.com/prometheus/client_golang v1.23.2/go.mod h1:Tb1a6LWHB3/SPIzCoaDXI4I8UHKeFTEQ1YCr+0Gyqmg=
|
||||
github.com/prometheus/client_golang v1.20.5 h1:cxppBPuYhUnsO6yo/aoRol4L7q7UFfdm+bR9r+8l63Y=
|
||||
github.com/prometheus/client_golang v1.20.5/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE=
|
||||
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
||||
github.com/prometheus/client_model v0.6.2 h1:oBsgwpGs7iVziMvrGhE53c/GrLUsZdHnqNwqPLxwZyk=
|
||||
github.com/prometheus/client_model v0.6.2/go.mod h1:y3m2F6Gdpfy6Ut/GBsUqTWZqCUvMVzSfMLjcu6wAwpE=
|
||||
github.com/prometheus/common v0.67.5 h1:pIgK94WWlQt1WLwAC5j2ynLaBRDiinoAb86HZHTUGI4=
|
||||
github.com/prometheus/common v0.67.5/go.mod h1:SjE/0MzDEEAyrdr5Gqc6G+sXI67maCxzaT3A2+HqjUw=
|
||||
github.com/prometheus/procfs v0.16.1 h1:hZ15bTNuirocR6u0JZ6BAHHmwS1p8B4P6MRqxtzMyRg=
|
||||
github.com/prometheus/procfs v0.16.1/go.mod h1:teAbpZRB1iIAJYREa1LsoWUXykVXA1KlTmWl8x/U+Is=
|
||||
github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ=
|
||||
github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc=
|
||||
github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E=
|
||||
github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY=
|
||||
github.com/prometheus/common v0.61.0 h1:3gv/GThfX0cV2lpO7gkTUwZru38mxevy90Bj8YFSRQQ=
|
||||
github.com/prometheus/common v0.61.0/go.mod h1:zr29OCN/2BsJRaFwG8QOBr41D6kkchKbpeNH7pAjb/s=
|
||||
github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc=
|
||||
github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk=
|
||||
github.com/rogpeppe/go-charset v0.0.0-20180617210344-2471d30d28b4/go.mod h1:qgYeAmZ5ZIpBWTGllZSQnw97Dj+woV0toclVaRGI8pc=
|
||||
github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII=
|
||||
github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o=
|
||||
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
|
||||
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
|
||||
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
|
||||
@@ -202,9 +213,11 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
|
||||
github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals=
|
||||
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
||||
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
|
||||
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
|
||||
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
|
||||
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
|
||||
github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0=
|
||||
github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY=
|
||||
github.com/unknwon/bra v0.0.0-20200517080246-1e3013ecaff8 h1:aVGB3YnaS/JNfOW3tiHIlmNmTDg618va+eT0mVomgyI=
|
||||
github.com/unknwon/bra v0.0.0-20200517080246-1e3013ecaff8/go.mod h1:fVle4kNr08ydeohzYafr20oZzbAkhQT39gKK/pFQ5M4=
|
||||
github.com/unknwon/com v1.0.1 h1:3d1LTxD+Lnf3soQiD4Cp/0BRB+Rsa/+RTvz8GMMzIXs=
|
||||
@@ -212,57 +225,51 @@ github.com/unknwon/com v1.0.1/go.mod h1:tOOxU81rwgoCLoOVVPHb6T/wt8HZygqH5id+GNnl
|
||||
github.com/unknwon/log v0.0.0-20150304194804-e617c87089d3 h1:4EYQaWAatQokdji3zqZloVIW/Ke1RQjYw2zHULyrHJg=
|
||||
github.com/unknwon/log v0.0.0-20150304194804-e617c87089d3/go.mod h1:1xEUf2abjfP92w2GZTV+GgaRxXErwRXcClbUwrNJffU=
|
||||
github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
|
||||
github.com/urfave/cli v1.22.17 h1:SYzXoiPfQjHBbkYxbew5prZHS1TOLT3ierW8SYLqtVQ=
|
||||
github.com/urfave/cli v1.22.17/go.mod h1:b0ht0aqgH/6pBYzzxURyrM4xXNgsoT/n2ZzwQiEhNVo=
|
||||
github.com/urfave/cli v1.22.16 h1:MH0k6uJxdwdeWQTwhSO42Pwr4YLrNLwBtg1MRgTqPdQ=
|
||||
github.com/urfave/cli v1.22.16/go.mod h1:EeJR6BKodywf4zciqrdw6hpCPk68JO9z5LazXZMn5Po=
|
||||
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
|
||||
github.com/zeebo/assert v1.3.0 h1:g7C04CbJuIDKNPFHmsk4hwZDO5O+kntRxzaUoNXj+IQ=
|
||||
github.com/zeebo/assert v1.3.0/go.mod h1:Pq9JiuJQpG8JLJdtkwrJESF0Foym2/D9XMU5ciN/wJ0=
|
||||
github.com/zeebo/xxh3 v1.1.0 h1:s7DLGDK45Dyfg7++yxI0khrfwq9661w9EN78eP/UZVs=
|
||||
github.com/zeebo/xxh3 v1.1.0/go.mod h1:IisAie1LELR4xhVinxWS5+zf1lA4p0MW4T+w+W07F5s=
|
||||
go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64=
|
||||
go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y=
|
||||
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.67.0 h1:yI1/OhfEPy7J9eoa6Sj051C7n5dvpj0QX8g4sRchg04=
|
||||
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.67.0/go.mod h1:NoUCKYWK+3ecatC4HjkRktREheMeEtrXoQxrqYFeHSc=
|
||||
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.67.0 h1:c9r/G1CSw4dPI1jaNNG9RnQP+q4SvZnHciDQJVIvchU=
|
||||
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.67.0/go.mod h1:gO9smoZe9KnZcJCqcB0lMmQ4Z5VEifYmjMTpnwtTSuQ=
|
||||
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.67.0 h1:OyrsyzuttWTSur2qN/Lm0m2a8yqyIjUVBZcxFPuXq2o=
|
||||
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.67.0/go.mod h1:C2NGBr+kAB4bk3xtMXfZ94gqFDtg/GkI7e9zqGh5Beg=
|
||||
go.opentelemetry.io/contrib/propagators/jaeger v1.42.0 h1:jP8unWI6q5kcb3gpGLjKDGaUa+JW+nHKWvpS/q+YuWA=
|
||||
go.opentelemetry.io/contrib/propagators/jaeger v1.42.0/go.mod h1:xd89e/pUyPatUP1C4z1UknD9jHptESO99tWyvd4mWD4=
|
||||
go.opentelemetry.io/contrib/samplers/jaegerremote v0.36.0 h1:h8kHGv9+VIiJbQ2Qx6BbORZwcvVnd0le/SFK8Vom0bA=
|
||||
go.opentelemetry.io/contrib/samplers/jaegerremote v0.36.0/go.mod h1:tjrgaYHDx+1CmTk5YzNAUCbLX1ZrjrsogXBQHaVf7rI=
|
||||
github.com/zeebo/xxh3 v1.0.2 h1:xZmwmqxHZA8AI603jOQ0tMqmBr9lPeFwGg6d+xy9DC0=
|
||||
github.com/zeebo/xxh3 v1.0.2/go.mod h1:5NWz9Sef7zIDm2JHfFlcQvNekmcEl9ekUZQQKCYaDcA=
|
||||
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.57.0 h1:qtFISDHKolvIxzSs0gIaiPUPR0Cucb0F2coHC7ZLdps=
|
||||
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.57.0/go.mod h1:Y+Pop1Q6hCOnETWTW4NROK/q1hv50hM7yDaUTjG8lp8=
|
||||
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.57.0 h1:7F3XCD6WYzDkwbi8I8N+oYJWquPVScnRosKGgqjsR8c=
|
||||
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.57.0/go.mod h1:Dk3C0BfIlZDZ5c6eVS7TYiH2vssuyUU3vUsgbrR+5V4=
|
||||
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.57.0 h1:DheMAlT6POBP+gh8RUH19EOTnQIor5QE0uSRPtzCpSw=
|
||||
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.57.0/go.mod h1:wZcGmeVO9nzP67aYSLDqXNWK87EZWhi7JWj1v7ZXf94=
|
||||
go.opentelemetry.io/contrib/propagators/jaeger v1.32.0 h1:K/fOyTMD6GELKTIJBaJ9k3ppF2Njt8MeUGBOwfaWXXA=
|
||||
go.opentelemetry.io/contrib/propagators/jaeger v1.32.0/go.mod h1:ISE6hda//MTWvtngG7p4et3OCngsrTVfl7c6DjN17f8=
|
||||
go.opentelemetry.io/contrib/samplers/jaegerremote v0.26.0 h1:/SKXyZLAnuj981HVc8G5ZylYK3qD2W6AYR6cJx5kIHw=
|
||||
go.opentelemetry.io/contrib/samplers/jaegerremote v0.26.0/go.mod h1:cOEzME0M2OKeHB45lJiOKfvUCdg/r75mf7YS5w0tbmE=
|
||||
go.opentelemetry.io/otel v1.21.0/go.mod h1:QZzNPQPm1zLX4gZK4cMi+71eaorMSGT3A4znnUvNNEo=
|
||||
go.opentelemetry.io/otel v1.43.0 h1:mYIM03dnh5zfN7HautFE4ieIig9amkNANT+xcVxAj9I=
|
||||
go.opentelemetry.io/otel v1.43.0/go.mod h1:JuG+u74mvjvcm8vj8pI5XiHy1zDeoCS2LB1spIq7Ay0=
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.43.0 h1:88Y4s2C8oTui1LGM6bTWkw0ICGcOLCAI5l6zsD1j20k=
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.43.0/go.mod h1:Vl1/iaggsuRlrHf/hfPJPvVag77kKyvrLeD10kpMl+A=
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.43.0 h1:RAE+JPfvEmvy+0LzyUA25/SGawPwIUbZ6u0Wug54sLc=
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.43.0/go.mod h1:AGmbycVGEsRx9mXMZ75CsOyhSP6MFIcj/6dnG+vhVjk=
|
||||
go.opentelemetry.io/otel v1.32.0 h1:WnBN+Xjcteh0zdk01SVqV55d/m62NJLJdIyb4y/WO5U=
|
||||
go.opentelemetry.io/otel v1.32.0/go.mod h1:00DCVSB0RQcnzlwyTfqtxSm+DRr9hpYrHjNGiBHVQIg=
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.32.0 h1:IJFEoHiytixx8cMiVAO+GmHR6Frwu+u5Ur8njpFO6Ac=
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.32.0/go.mod h1:3rHrKNtLIoS0oZwkY2vxi+oJcwFRWdtUyRII+so45p8=
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.32.0 h1:9kV11HXBHZAvuPUZxmMWrH8hZn/6UnHX4K0mu36vNsU=
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.32.0/go.mod h1:JyA0FHXe22E1NeNiHmVp7kFHglnexDQ7uRWDiiJ1hKQ=
|
||||
go.opentelemetry.io/otel/metric v1.21.0/go.mod h1:o1p3CA8nNHW8j5yuQLdc1eeqEaPfzug24uvsyIEJRWM=
|
||||
go.opentelemetry.io/otel/metric v1.43.0 h1:d7638QeInOnuwOONPp4JAOGfbCEpYb+K6DVWvdxGzgM=
|
||||
go.opentelemetry.io/otel/metric v1.43.0/go.mod h1:RDnPtIxvqlgO8GRW18W6Z/4P462ldprJtfxHxyKd2PY=
|
||||
go.opentelemetry.io/otel/metric v1.32.0 h1:xV2umtmNcThh2/a/aCP+h64Xx5wsj8qqnkYZktzNa0M=
|
||||
go.opentelemetry.io/otel/metric v1.32.0/go.mod h1:jH7CIbbK6SH2V2wE16W05BHCtIDzauciCRLoc/SyMv8=
|
||||
go.opentelemetry.io/otel/sdk v1.21.0/go.mod h1:Nna6Yv7PWTdgJHVRD9hIYywQBRx7pbox6nwBnZIxl/E=
|
||||
go.opentelemetry.io/otel/sdk v1.43.0 h1:pi5mE86i5rTeLXqoF/hhiBtUNcrAGHLKQdhg4h4V9Dg=
|
||||
go.opentelemetry.io/otel/sdk v1.43.0/go.mod h1:P+IkVU3iWukmiit/Yf9AWvpyRDlUeBaRg6Y+C58QHzg=
|
||||
go.opentelemetry.io/otel/sdk/metric v1.43.0 h1:S88dyqXjJkuBNLeMcVPRFXpRw2fuwdvfCGLEo89fDkw=
|
||||
go.opentelemetry.io/otel/sdk/metric v1.43.0/go.mod h1:C/RJtwSEJ5hzTiUz5pXF1kILHStzb9zFlIEe85bhj6A=
|
||||
go.opentelemetry.io/otel/sdk v1.32.0 h1:RNxepc9vK59A8XsgZQouW8ue8Gkb4jpWtJm9ge5lEG4=
|
||||
go.opentelemetry.io/otel/sdk v1.32.0/go.mod h1:LqgegDBjKMmb2GC6/PrTnteJG39I8/vJCAP9LlJXEjU=
|
||||
go.opentelemetry.io/otel/trace v1.21.0/go.mod h1:LGbsEB0f9LGjN+OZaQQ26sohbOmiMR+BaslueVtS/qQ=
|
||||
go.opentelemetry.io/otel/trace v1.43.0 h1:BkNrHpup+4k4w+ZZ86CZoHHEkohws8AY+WTX09nk+3A=
|
||||
go.opentelemetry.io/otel/trace v1.43.0/go.mod h1:/QJhyVBUUswCphDVxq+8mld+AvhXZLhe+8WVFxiFff0=
|
||||
go.opentelemetry.io/proto/otlp v1.10.0 h1:IQRWgT5srOCYfiWnpqUYz9CVmbO8bFmKcwYxpuCSL2g=
|
||||
go.opentelemetry.io/proto/otlp v1.10.0/go.mod h1:/CV4QoCR/S9yaPj8utp3lvQPoqMtxXdzn7ozvvozVqk=
|
||||
go.opentelemetry.io/otel/trace v1.32.0 h1:WIC9mYrXf8TmY/EXuULKc8hR17vE+Hjv2cssQDe03fM=
|
||||
go.opentelemetry.io/otel/trace v1.32.0/go.mod h1:+i4rkvCraA+tG6AzwloGaCtkx53Fa+L+V8e9a7YvhT8=
|
||||
go.opentelemetry.io/proto/otlp v1.3.1 h1:TrMUixzpM0yuc/znrFTP9MMRh8trP93mkCiDVeXrui0=
|
||||
go.opentelemetry.io/proto/otlp v1.3.1/go.mod h1:0X1WI4de4ZsLrrJNLAQbFeLCm3T7yBkR0XqQ7niQU+8=
|
||||
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
|
||||
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
|
||||
go.yaml.in/yaml/v2 v2.4.3 h1:6gvOSjQoTB3vt1l+CU+tSyi/HOjfOjRLJ4YwYZGwRO0=
|
||||
go.yaml.in/yaml/v2 v2.4.3/go.mod h1:zSxWcmIDjOzPXpjlTTbAsKokqkDNAVtZO0WOMiT90s8=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/exp v0.0.0-20260112195511-716be5621a96 h1:Z/6YuSHTLOHfNFdb8zVZomZr7cqNgTJvA8+Qz75D8gU=
|
||||
golang.org/x/exp v0.0.0-20260112195511-716be5621a96/go.mod h1:nzimsREAkjBCIEFtHiYkrJyT+2uy9YZJB7H1k68CXZU=
|
||||
golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 h1:e66Fs6Z+fZTbFBAxKfP3PALWBtpfqks2bwGcexMxgtk=
|
||||
golang.org/x/exp v0.0.0-20240909161429-701f63a606c0/go.mod h1:2TbTHSBQa924w8M6Xs1QcRcFwyucIwBGpK1p2f1YFFY=
|
||||
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
||||
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
|
||||
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||
@@ -271,8 +278,8 @@ golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzB
|
||||
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.33.0 h1:tHFzIWbBifEmbwtGz65eaWyGiGZatSrT9prnU8DbVL8=
|
||||
golang.org/x/mod v0.33.0/go.mod h1:swjeQEj+6r7fODbD2cqrnje9PnziFuw4bmLbBZFrQ5w=
|
||||
golang.org/x/mod v0.22.0 h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4=
|
||||
golang.org/x/mod v0.22.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY=
|
||||
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
@@ -282,8 +289,8 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL
|
||||
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
|
||||
golang.org/x/net v0.52.0 h1:He/TN1l0e4mmR3QqHMT2Xab3Aj3L9qjbhRm78/6jrW0=
|
||||
golang.org/x/net v0.52.0/go.mod h1:R1MAz7uMZxVMualyPXb+VaqGSa3LIaUqk0eEt3w36Sw=
|
||||
golang.org/x/net v0.32.0 h1:ZqPmj8Kzc+Y6e0+skZsuACbx+wzMgo5MQsJh9Qd6aYI=
|
||||
golang.org/x/net v0.32.0/go.mod h1:CwU0IoeOlnQQWJ6ioyFrfRuomB8GKF6KbYXZVyeXNfs=
|
||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
@@ -291,8 +298,8 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ
|
||||
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4=
|
||||
golang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0=
|
||||
golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ=
|
||||
golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
@@ -306,18 +313,17 @@ golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBc
|
||||
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.43.0 h1:Rlag2XtaFTxp19wS8MXlJwTvoh8ArU6ezoyFsMyCTNI=
|
||||
golang.org/x/sys v0.43.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
|
||||
golang.org/x/telemetry v0.0.0-20260209163413-e7419c687ee4 h1:bTLqdHv7xrGlFbvf5/TXNxy/iUwwdkjhqQTJDjW7aj0=
|
||||
golang.org/x/telemetry v0.0.0-20260209163413-e7419c687ee4/go.mod h1:g5NllXBEermZrmR51cJDQxmJUHUOfRAaNyWBM+R+548=
|
||||
golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA=
|
||||
golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.35.0 h1:JOVx6vVDFokkpaq1AEptVzLTpDe9KGpj5tR4/X+ybL8=
|
||||
golang.org/x/text v0.35.0/go.mod h1:khi/HExzZJ2pGnjenulevKNX1W67CUy0AsXcNubPGCA=
|
||||
golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo=
|
||||
golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
|
||||
@@ -328,16 +334,16 @@ golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapK
|
||||
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||
golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
|
||||
golang.org/x/tools v0.42.0 h1:uNgphsn75Tdz5Ji2q36v/nsFSfR/9BRFvqhGBaJGd5k=
|
||||
golang.org/x/tools v0.42.0/go.mod h1:Ma6lCIwGZvHK6XtgbswSoWroEkhugApmsXyrUmBhfr0=
|
||||
golang.org/x/tools v0.28.0 h1:WuB6qZ4RPCQo5aP3WdKZS7i595EdWqWR8vqJTlwTVK8=
|
||||
golang.org/x/tools v0.28.0/go.mod h1:dcIOrVd3mfQKTgrDVQHqCPMWy6lnhfhtX3hLXYVLfRw=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da h1:noIWHXmPHxILtqtCOPIhSt0ABwskkZKjD3bXGnZGpNY=
|
||||
golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90=
|
||||
gonum.org/v1/gonum v0.17.0 h1:VbpOemQlsSMrYmn7T2OUvQ4dqxQXU+ouZFQsZOx50z4=
|
||||
gonum.org/v1/gonum v0.17.0/go.mod h1:El3tOrEuMpv2UdMrbNlKEh9vd86bmQ6vqIcDwxEOc1E=
|
||||
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 h1:+cNy6SZtPcJQH3LJVLOSmiC7MMxXNOb3PU/VUEz+EhU=
|
||||
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90=
|
||||
gonum.org/v1/gonum v0.15.1 h1:FNy7N6OUZVUaWG9pTiD+jlhdQ3lMP+/LcTpJ6+a8sQ0=
|
||||
gonum.org/v1/gonum v0.15.1/go.mod h1:eZTZuRFrzu5pcyjN5wJhcIhnUdNijYxX1T2IcrOGY0o=
|
||||
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
|
||||
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
|
||||
@@ -350,8 +356,8 @@ google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyac
|
||||
google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
|
||||
google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
|
||||
google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM=
|
||||
google.golang.org/grpc v1.80.0 h1:Xr6m2WmWZLETvUNvIUmeD5OAagMw3FiKmMlTdViWsHM=
|
||||
google.golang.org/grpc v1.80.0/go.mod h1:ho/dLnxwi3EDJA4Zghp7k2Ec1+c2jqup0bFkw07bwF4=
|
||||
google.golang.org/grpc v1.68.1 h1:oI5oTa11+ng8r8XMMN7jAOmWfPZWbYpCFaMUTACxkM0=
|
||||
google.golang.org/grpc v1.68.1/go.mod h1:+q1XYFJjShcqn0QZHvCyeR4CXPA+llXIeUIfIe00waw=
|
||||
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
|
||||
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
|
||||
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
|
||||
@@ -364,8 +370,8 @@ google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlba
|
||||
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
||||
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||
google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||
google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE=
|
||||
google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=
|
||||
google.golang.org/protobuf v1.35.2 h1:8Ar7bF+apOIoThw1EdZl0p1oWvMqTHmpA2fRTyZO8io=
|
||||
google.golang.org/protobuf v1.35.2/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
|
||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
|
||||
|
||||
+885
-3901
File diff suppressed because it is too large.
Load diff
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "timely",
|
||||
"version": "2.2.6-SNAPSHOT",
|
||||
"version": "2.2.0",
|
||||
"scripts": {
|
||||
"build": "webpack -c ./.config/webpack/webpack.config.ts --env production",
|
||||
"dev": "webpack -w -c ./.config/webpack/webpack.config.ts --env development",
|
||||
@@ -67,9 +67,9 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@emotion/css": "11.10.6",
|
||||
"@grafana/data": "^13.0.1",
|
||||
"@grafana/runtime": "^13.0.1",
|
||||
"@grafana/schema": "^13.0.1",
|
||||
"@grafana/data": "^11.3.2",
|
||||
"@grafana/runtime": "^11.3.2",
|
||||
"@grafana/schema": "^11.3.2",
|
||||
"@grafana/ui": "^11.3.2",
|
||||
"dayjs": "^1.11.13",
|
||||
"react": "18.2.0",
|
||||
|
||||
@@ -8,8 +8,8 @@ import 'static/css/timely.css';
|
||||
import { loadPluginCss } from '@grafana/runtime';
|
||||
|
||||
loadPluginCss({
|
||||
dark: 'plugins/nsa-timely-datasource/styles/dark.css',
|
||||
light: 'plugins/nsa-timely-datasource/styles/light.css',
|
||||
dark: 'plugins/timely-datasource/styles/dark.css',
|
||||
light: 'plugins/timely-datasource/styles/light.css',
|
||||
});
|
||||
|
||||
export const plugin = new DataSourcePlugin<TimelyDataSource, TimelyQueryForm, TimelyDataSourceOptions>(TimelyDataSource)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"$schema": "https://raw.githubusercontent.com/grafana/grafana/main/docs/sources/developers/plugins/plugin.schema.json",
|
||||
"type": "datasource",
|
||||
"name": "Timely",
|
||||
"id": "nsa-timely-datasource",
|
||||
"id": "timely-datasource",
|
||||
"category": "tsdb",
|
||||
"metrics": true,
|
||||
"backend": true,
|
||||
|
||||
Binary file not shown.
@@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>collectd</groupId>
|
||||
<artifactId>collectd-api</artifactId>
|
||||
<version>5.7.1</version>
|
||||
</project>
|
||||
Executable
+14
@@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [[ `uname` == "Darwin" ]]; then
|
||||
THIS_SCRIPT=`python -c 'import os,sys; print os.path.realpath(sys.argv[1])' $0`
|
||||
else
|
||||
THIS_SCRIPT=`readlink -f $0`
|
||||
fi
|
||||
|
||||
THIS_DIR="${THIS_SCRIPT%/*}"
|
||||
BASE_DIR=$(cd $THIS_DIR/.. && pwd)
|
||||
BIN_DIR=${BASE_DIR}/bin
|
||||
|
||||
echo ${BIN_DIR}/timely-nsq-relay.sh
|
||||
${BIN_DIR}/timely-nsq-relay.sh
|
||||
Executable
+26
@@ -0,0 +1,26 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [[ `uname` == "Darwin" ]]; then
|
||||
THIS_SCRIPT=`python -c 'import os,sys; print os.path.realpath(sys.argv[1])' $0`
|
||||
else
|
||||
THIS_SCRIPT=`readlink -f $0`
|
||||
fi
|
||||
|
||||
THIS_DIR="${THIS_SCRIPT%/*}"
|
||||
BASE_DIR=$(cd $THIS_DIR/.. && pwd)
|
||||
BIN_DIR=${BASE_DIR}/bin
|
||||
|
||||
shutdown_pid() {
|
||||
PID=$1
|
||||
if [ "$PID" != "" ]; then
|
||||
kill -15 $PID > /dev/null 2>&1
|
||||
timeout $2 pidwait $PID
|
||||
kill -9 $PID > /dev/null 2>&1
|
||||
fi
|
||||
}
|
||||
|
||||
PID=`jps -m | grep -E 'timely-nsq-relay-.*-exec.jar' | awk '{print $1}'`
|
||||
if [ "$PID" != "" ]; then
|
||||
echo "stopping timely-nsq-relay [${PID}]"
|
||||
shutdown_pid ${PID} 60
|
||||
fi
|
||||
Executable
+2
@@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
|
||||
Executable
+49
@@ -0,0 +1,49 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [[ $(uname) == "Darwin" ]]; then
|
||||
THIS_SCRIPT=$(python -c 'import os,sys; print os.path.realpath(sys.argv[1])' "$0")
|
||||
else
|
||||
THIS_SCRIPT=$(readlink -f "$0")
|
||||
HW=`uname -m`
|
||||
OS_PATH=linux-${HW}
|
||||
fi
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
export INSTANCE="1"
|
||||
else
|
||||
export INSTANCE="$1"
|
||||
fi
|
||||
|
||||
PID=$(jps -m | grep -E 'timely-nsq-relay-.*-exec.jar' | awk '{print $1}')
|
||||
|
||||
if [ "$PID" == "" ]; then
|
||||
THIS_DIR="${THIS_SCRIPT%/*}"
|
||||
BASE_DIR=$(cd "$THIS_DIR"/.. && pwd)
|
||||
LIB_DIR="${BASE_DIR}/lib"
|
||||
BIN_DIR="${BASE_DIR}/bin"
|
||||
export CONF_DIR="${BASE_DIR}/conf"
|
||||
|
||||
set -a
|
||||
. "${BIN_DIR}/timely-nsq-relay-env.sh"
|
||||
set +a
|
||||
|
||||
# use either a value from timely-server-env.sh or the default
|
||||
export LOG_DIR="${TIMELY_LOG_DIR:-${BASE_DIR}/logs}"
|
||||
|
||||
if [[ ! -e ${LOG_DIR} ]]; then
|
||||
mkdir "${LOG_DIR}"
|
||||
fi
|
||||
|
||||
JVM_ARGS="-Xmx4G -Xms4G -XX:NewSize=1G -XX:MaxNewSize=1G"
|
||||
JVM_ARGS="${JVM_ARGS} -Dlogging.config=${CONF_DIR}/log4j2.yml"
|
||||
JVM_ARGS="${JVM_ARGS} -Dlog4j2.contextSelector=org.apache.logging.log4j.core.async.AsyncLoggerContextSelector"
|
||||
JVM_ARGS="${JVM_ARGS} -XX:+UseG1GC -XX:+UseStringDeduplication"
|
||||
JVM_ARGS="${JVM_ARGS} -Djava.net.preferIPv4Stack=true"
|
||||
JVM_ARGS="${JVM_ARGS} -XX:+UseNUMA"
|
||||
JVM_ARGS="${JVM_ARGS} -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:6005"
|
||||
|
||||
echo "${JAVA_HOME}/bin/java ${JVM_ARGS} -jar ${BIN_DIR}/timely-nsq-relay*-exec.jar"
|
||||
nohup "${JAVA_HOME}"/bin/java ${JVM_ARGS} -jar "${BIN_DIR}"/timely-nsq-relay-*-exec.jar >> "${LOG_DIR}/timely-nsq-relay.out" 2>&1 &
|
||||
else
|
||||
echo "timely-nsq-relay already running with pid ${PID}"
|
||||
fi
|
||||
@@ -0,0 +1,36 @@
|
||||
Configuration:
|
||||
status: warn
|
||||
monitorInterval: 60
|
||||
|
||||
Properties:
|
||||
Property:
|
||||
- name: logDir
|
||||
value: ${env:LOG_DIR}
|
||||
- name: PID
|
||||
value: "????"
|
||||
- name: LOG_PATTERN
|
||||
value: "%d{ISO8601} %-5p [%-20.20t] [%-40.40c{1.}] %m%n%wEx"
|
||||
|
||||
Appenders:
|
||||
RollingFile:
|
||||
- name: File
|
||||
fileName: "${sys:logDir}/timely-nsq-relay.log"
|
||||
filePattern: "${sys:logDir}/timely-nsq-relay.log.%d{yyyy-MM-dd}-%i.gz"
|
||||
append: true
|
||||
bufferedIO: true
|
||||
bufferSize: 8192
|
||||
Policies:
|
||||
TimeBasedTriggeringPolicy:
|
||||
interval: 1
|
||||
SizeBasedTriggeringPolicy:
|
||||
size: 250MB
|
||||
DefaultRolloverStrategy:
|
||||
max: 10
|
||||
PatternLayout:
|
||||
pattern: "${LOG_PATTERN}"
|
||||
|
||||
Loggers:
|
||||
Root:
|
||||
level: info
|
||||
AppenderRef:
|
||||
- ref: File
|
||||
@@ -0,0 +1,26 @@
|
||||
timely:
|
||||
nsq:
|
||||
lookupd-http-address:
|
||||
- localhost:4161
|
||||
lookup-interval-secs: 2
|
||||
max-lookup-failures-before-error: 10
|
||||
topic: metrics
|
||||
channel: Timely#ephemeral
|
||||
max-in-flight: 1000
|
||||
max-delivery-attempts: 5
|
||||
message-handler-threads: 4
|
||||
message-handler-queue-size: 1000
|
||||
|
||||
client:
|
||||
host: localhost
|
||||
tcp-port: 4242
|
||||
time-to-live-ms: -1
|
||||
max-latency-ms: 5000
|
||||
writes-to-buffer: -1
|
||||
relay-handler-threads: 4
|
||||
|
||||
logging:
|
||||
level:
|
||||
ROOT: info
|
||||
timely: trace
|
||||
com.sproutsocial.nsq: trace
|
||||
@@ -0,0 +1,181 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>timely</groupId>
|
||||
<artifactId>timely</artifactId>
|
||||
<version>2.1.6-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>timely-nsq-relay</artifactId>
|
||||
<description>Timely Nsq Relay</description>
|
||||
<properties>
|
||||
<start-class>timely.nsq.TimelyNsqRelay</start-class>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.sproutsocial</groupId>
|
||||
<artifactId>nsq-j</artifactId>
|
||||
<version>1.4.9</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.jcip</groupId>
|
||||
<artifactId>jcip-annotations</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
<artifactId>log4j-1.2-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-webflux</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-log4j2</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-reactor-netty</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-security</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-undertow</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-validation</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-context</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-bootstrap</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>timely</groupId>
|
||||
<artifactId>timely-client</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>timely</groupId>
|
||||
<artifactId>timely-common</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.lmax</groupId>
|
||||
<artifactId>disruptor</artifactId>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>assemble</id>
|
||||
<goals>
|
||||
<goal>single</goal>
|
||||
</goals>
|
||||
<phase>package</phase>
|
||||
<configuration>
|
||||
<descriptors>
|
||||
<descriptor>src/main/dist/assembly.xml</descriptor>
|
||||
</descriptors>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>copy-dependencies</id>
|
||||
<goals>
|
||||
<goal>copy-dependencies</goal>
|
||||
</goals>
|
||||
<phase>prepare-package</phase>
|
||||
<configuration>
|
||||
<excludeArtifactIds>junit</excludeArtifactIds>
|
||||
<outputDirectory>${project.build.directory}/lib</outputDirectory>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>unpack-native</id>
|
||||
<goals>
|
||||
<goal>unpack</goal>
|
||||
</goals>
|
||||
<phase>process-test-classes</phase>
|
||||
<configuration>
|
||||
<artifactItems>
|
||||
<artifactItem>
|
||||
<groupId>io.netty</groupId>
|
||||
<artifactId>netty-tcnative-boringssl-static</artifactId>
|
||||
<version>${version.netty-tcnative}</version>
|
||||
<type>jar</type>
|
||||
<overWrite>false</overWrite>
|
||||
<outputDirectory>${project.build.directory}/native</outputDirectory>
|
||||
<includes>**/*.so</includes>
|
||||
</artifactItem>
|
||||
</artifactItems>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>3.1.2</version>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifest>
|
||||
<!--suppress UnresolvedMavenProperty, MavenModelInspection -->
|
||||
<mainClass>${start-class}</mainClass>
|
||||
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
|
||||
</manifest>
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>exec-maven-plugin</artifactId>
|
||||
<version>1.6.0</version>
|
||||
<configuration>
|
||||
<!--suppress UnresolvedMavenProperty, MavenModelInspection -->
|
||||
<mainClass>${start-class}</mainClass>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
Vendored
+40
@@ -0,0 +1,40 @@
|
||||
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd">
|
||||
<id>dist</id>
|
||||
<formats>
|
||||
<format>tar.gz</format>
|
||||
</formats>
|
||||
<fileSets>
|
||||
<fileSet>
|
||||
<directory>${project.basedir}</directory>
|
||||
<outputDirectory></outputDirectory>
|
||||
<includes>
|
||||
<include>README*</include>
|
||||
<include>LICENSE*</include>
|
||||
<include>NOTICE*</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
<fileSet>
|
||||
<directory>${project.build.directory}</directory>
|
||||
<outputDirectory>bin</outputDirectory>
|
||||
<includes>
|
||||
<include>timely-nsq-*-exec.jar</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
<fileSet>
|
||||
<directory>${project.basedir}/bin</directory>
|
||||
<outputDirectory>bin</outputDirectory>
|
||||
<includes>
|
||||
<include>**/*</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
<fileSet>
|
||||
<directory>${project.basedir}/conf</directory>
|
||||
<outputDirectory>conf</outputDirectory>
|
||||
<includes>
|
||||
<include>*</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
</fileSets>
|
||||
</assembly>
|
||||
@@ -0,0 +1,29 @@
|
||||
package timely.nsq;
|
||||
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import com.sproutsocial.nsq.MessageDataHandler;
|
||||
|
||||
public class TimelyNsqMessageDataHandler implements MessageDataHandler {
|
||||
|
||||
private final LinkedBlockingQueue<String> messageQueue;
|
||||
|
||||
public TimelyNsqMessageDataHandler(LinkedBlockingQueue<String> messageQueue) {
|
||||
this.messageQueue = messageQueue;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void accept(byte[] data) {
|
||||
String message = new String(data, Charset.defaultCharset());
|
||||
try {
|
||||
// use a timeout to allow for delays in the reading threads / garbage collection
|
||||
if (!messageQueue.offer(message, 5, TimeUnit.SECONDS)) {
|
||||
throw new RuntimeException(getClass().getSimpleName() + " queue full, size=" + messageQueue.size());
|
||||
}
|
||||
} catch (InterruptedException e) {
|
||||
throw new RuntimeException(getClass().getSimpleName() + " queue full, size=" + messageQueue.size());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package timely.nsq;
|
||||
|
||||
import org.springframework.boot.WebApplicationType;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.autoconfigure.web.servlet.error.ErrorMvcAutoConfiguration;
|
||||
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||
|
||||
@SpringBootApplication(scanBasePackages = {"timely.nsq"}, exclude = {ErrorMvcAutoConfiguration.class})
|
||||
public class TimelyNsqRelay {
|
||||
|
||||
public static void main(String[] args) {
|
||||
new SpringApplicationBuilder(TimelyNsqRelay.class).main(TimelyNsqRelay.class).web(WebApplicationType.NONE).run(args);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,163 @@
|
||||
package timely.nsq;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.Future;
|
||||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
import java.util.concurrent.ThreadFactory;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import com.google.common.util.concurrent.ThreadFactoryBuilder;
|
||||
|
||||
import timely.client.tcp.TcpClient;
|
||||
import timely.model.Metric;
|
||||
import timely.model.parse.MetricParser;
|
||||
import timely.nsq.config.TimelyClientProperties;
|
||||
|
||||
public class TimelyNsqRelayHandler {
|
||||
private static final Logger log = LoggerFactory.getLogger(TimelyNsqRelayHandler.class);
|
||||
private final TimelyClientProperties timelyClientProperties;
|
||||
private final LinkedBlockingQueue<String> messageQueue;
|
||||
private final ExecutorService relayExecutor;
|
||||
private final List<Future> relayRunnableFutures = new ArrayList<>();
|
||||
|
||||
private final ThreadLocal<TcpClient> tcpClient;
|
||||
private final Map<String,TcpClient> tcpClientMap = Collections.synchronizedMap(new HashMap<>());
|
||||
|
||||
public TimelyNsqRelayHandler(TimelyClientProperties timelyClientProperties, LinkedBlockingQueue<String> messageQueue) {
|
||||
this.timelyClientProperties = timelyClientProperties;
|
||||
this.messageQueue = messageQueue;
|
||||
ThreadFactory threadFactory = new ThreadFactoryBuilder().setNameFormat("relay-handler-%d").build();
|
||||
this.relayExecutor = Executors.newFixedThreadPool(timelyClientProperties.getRelayHandlerTheads(), threadFactory);
|
||||
|
||||
this.tcpClient = new ThreadLocal<>() {
|
||||
@Override
|
||||
protected TcpClient initialValue() {
|
||||
TcpClient client = new TcpClient(timelyClientProperties.getHost(), timelyClientProperties.getTcpPort(),
|
||||
timelyClientProperties.getWritesToBuffer(), timelyClientProperties.getMaxLatencyMs());
|
||||
tcpClientMap.put(Thread.currentThread().getName(), client);
|
||||
return client;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TcpClient get() {
|
||||
TcpClient client = super.get();
|
||||
long now = System.currentTimeMillis();
|
||||
long clientTimeToLive = timelyClientProperties.getTimeToLiveMs();
|
||||
if (null != client && (clientTimeToLive > -1) && (now > client.getConnectTime() + clientTimeToLive)) {
|
||||
try {
|
||||
client.close();
|
||||
} catch (Exception e) {
|
||||
log.error("Failed to close client:" + e.getMessage(), e);
|
||||
}
|
||||
client = new TcpClient(timelyClientProperties.getHost(), timelyClientProperties.getTcpPort(), -1);
|
||||
set(client);
|
||||
tcpClientMap.put(Thread.currentThread().getName(), client);
|
||||
}
|
||||
return client;
|
||||
}
|
||||
};
|
||||
|
||||
for (int i = 0; i < timelyClientProperties.getRelayHandlerTheads(); i++) {
|
||||
relayRunnableFutures.add(this.relayExecutor.submit(new RelayRunnable()));
|
||||
}
|
||||
}
|
||||
|
||||
public void shutdown() {
|
||||
this.relayExecutor.shutdown();
|
||||
this.relayRunnableFutures.forEach(f -> {
|
||||
try {
|
||||
f.get(10, TimeUnit.SECONDS);
|
||||
} catch (Exception e) {
|
||||
f.cancel(true);
|
||||
}
|
||||
});
|
||||
synchronized (this.tcpClientMap) {
|
||||
for (Map.Entry<String,TcpClient> entry : this.tcpClientMap.entrySet()) {
|
||||
TcpClient client = entry.getValue();
|
||||
try {
|
||||
log.info("Closing timely client for thread: " + entry.getKey());
|
||||
client.close();
|
||||
} catch (Exception e) {
|
||||
log.error("Failed to close client for thread: " + entry.getKey() + ": " + e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private String toTcpFormat(String metricMessage) {
|
||||
MetricParser metricParser = new MetricParser();
|
||||
Metric metric = metricParser.parse(metricMessage);
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("put ");
|
||||
sb.append(metric.getName());
|
||||
sb.append(" ");
|
||||
sb.append(metric.getValue().getTimestamp());
|
||||
sb.append(" ");
|
||||
sb.append(metric.getValue().getMeasure());
|
||||
metric.getTags().stream().forEach(tag -> sb.append(" ").append(tag.getKey()).append("=").append(tag.getValue()));
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
private class RelayRunnable implements Runnable {
|
||||
|
||||
private boolean shutdown = false;
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
while (!shutdown) {
|
||||
TcpClient client = tcpClient.get();
|
||||
// try to avoid polling the queue if the client is not connected
|
||||
if (client.isConnected()) {
|
||||
try {
|
||||
String metricMessage = messageQueue.poll(1, TimeUnit.SECONDS);
|
||||
String metricString = null;
|
||||
if (metricMessage != null) {
|
||||
try {
|
||||
metricString = toTcpFormat(metricMessage);
|
||||
} catch (Exception e) {
|
||||
log.error("Failed to parse metric: ", metricMessage);
|
||||
}
|
||||
}
|
||||
while (!shutdown && metricString != null) {
|
||||
try {
|
||||
if (client.isConnected()) {
|
||||
log.trace("Writing metric:{} queueSize:{}", metricMessage, messageQueue.size());
|
||||
client.write(metricString + "\n");
|
||||
metricString = null;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
sleep(1000);
|
||||
}
|
||||
}
|
||||
} catch (InterruptedException e) {
|
||||
sleep(100);
|
||||
}
|
||||
} else {
|
||||
log.trace("Timely client not connected");
|
||||
sleep(1000);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void sleep(long millis) {
|
||||
try {
|
||||
Thread.sleep(millis);
|
||||
} catch (InterruptedException e) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void shutdown() {
|
||||
shutdown = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package timely.nsq;
|
||||
|
||||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
|
||||
import javax.annotation.PreDestroy;
|
||||
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import com.sproutsocial.nsq.Client;
|
||||
import com.sproutsocial.nsq.Config;
|
||||
import com.sproutsocial.nsq.MessageDataHandler;
|
||||
import com.sproutsocial.nsq.Subscriber;
|
||||
import com.sproutsocial.nsq.SubscriptionId;
|
||||
|
||||
import timely.nsq.config.NsqProperties;
|
||||
import timely.nsq.config.TimelyClientProperties;
|
||||
|
||||
@EnableScheduling
|
||||
@Component
|
||||
@EnableConfigurationProperties(TimelyClientProperties.class)
|
||||
public class TimelyNsqSubscriber extends Subscriber {
|
||||
|
||||
private final LinkedBlockingQueue<String> metricQueue;
|
||||
private final TimelyNsqRelayHandler relayHandler;
|
||||
private final SubscriptionId subscriptionId;
|
||||
|
||||
public TimelyNsqSubscriber(Client nsqClient, NsqProperties nsqProperties, TimelyClientProperties timelyClientProperties) {
|
||||
super(nsqClient, nsqProperties.getLookupIntervalSecs(), nsqProperties.getMaxLookupFailuresBeforeError(),
|
||||
nsqProperties.getLookupdHttpAddress().toArray(new String[0]));
|
||||
setDefaultMaxInFlight(nsqProperties.getMaxInFlight());
|
||||
setMaxAttempts(nsqProperties.getMaxDeliveryAttempts());
|
||||
Config config = new Config();
|
||||
config.setUserAgent(TimelyNsqSubscriber.class.getSimpleName());
|
||||
setConfig(config);
|
||||
this.metricQueue = new LinkedBlockingQueue<>(nsqProperties.getMessageHandlerQueueSize());
|
||||
MessageDataHandler messageDataHandler = new TimelyNsqMessageDataHandler(this.metricQueue);
|
||||
this.relayHandler = new TimelyNsqRelayHandler(timelyClientProperties, this.metricQueue);
|
||||
this.subscriptionId = subscribe(nsqProperties.getTopic(), nsqProperties.getChannel(), messageDataHandler);
|
||||
}
|
||||
|
||||
@PreDestroy
|
||||
public void shutdown() {
|
||||
unsubscribe(this.subscriptionId);
|
||||
this.relayHandler.shutdown();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package timely.nsq.config;
|
||||
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.ThreadFactory;
|
||||
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import com.google.common.util.concurrent.ThreadFactoryBuilder;
|
||||
import com.sproutsocial.nsq.Client;
|
||||
|
||||
@Configuration
|
||||
@EnableConfigurationProperties(NsqProperties.class)
|
||||
public class NsqConfiguration {
|
||||
|
||||
@Bean
|
||||
public Client nsqClient(NsqProperties nsqProperties) {
|
||||
Client client = new Client();
|
||||
ThreadFactory threadFactory = new ThreadFactoryBuilder().setNameFormat("message-handler-%d").build();
|
||||
client.setExecutor(Executors.newFixedThreadPool(nsqProperties.getMessageHandlerThreads(), threadFactory));
|
||||
return client;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
package timely.nsq.config;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
@Validated
|
||||
@ConfigurationProperties(prefix = "timely.nsq")
|
||||
public class NsqProperties {
|
||||
@NotNull
|
||||
private List<String> lookupdHttpAddress;
|
||||
private Integer lookupIntervalSecs = 2;
|
||||
private Integer maxLookupFailuresBeforeError = 10;
|
||||
private String topic;
|
||||
private String channel;
|
||||
private Integer maxInFlight = 1000;
|
||||
private Integer maxDeliveryAttempts = 5;
|
||||
private Integer messageHandlerThreads = 20;
|
||||
private Integer messageHandlerQueueSize = 1000;
|
||||
|
||||
public void setLookupdHttpAddress(List<String> lookupdHttpAddress) {
|
||||
this.lookupdHttpAddress = lookupdHttpAddress;
|
||||
}
|
||||
|
||||
public List<String> getLookupdHttpAddress() {
|
||||
return lookupdHttpAddress;
|
||||
}
|
||||
|
||||
public void setLookupIntervalSecs(Integer lookupIntervalSecs) {
|
||||
this.lookupIntervalSecs = lookupIntervalSecs;
|
||||
}
|
||||
|
||||
public Integer getLookupIntervalSecs() {
|
||||
return lookupIntervalSecs;
|
||||
}
|
||||
|
||||
public void setMaxLookupFailuresBeforeError(Integer maxLookupFailuresBeforeError) {
|
||||
this.maxLookupFailuresBeforeError = maxLookupFailuresBeforeError;
|
||||
}
|
||||
|
||||
public Integer getMaxLookupFailuresBeforeError() {
|
||||
return maxLookupFailuresBeforeError;
|
||||
}
|
||||
|
||||
public void setMaxInFlight(Integer maxInFlight) {
|
||||
this.maxInFlight = maxInFlight;
|
||||
}
|
||||
|
||||
public Integer getMaxInFlight() {
|
||||
return maxInFlight;
|
||||
}
|
||||
|
||||
public void setMaxDeliveryAttempts(Integer maxDeliveryAttempts) {
|
||||
this.maxDeliveryAttempts = maxDeliveryAttempts;
|
||||
}
|
||||
|
||||
public Integer getMaxDeliveryAttempts() {
|
||||
return maxDeliveryAttempts;
|
||||
}
|
||||
|
||||
public void setTopic(String topic) {
|
||||
this.topic = topic;
|
||||
}
|
||||
|
||||
public String getTopic() {
|
||||
return topic;
|
||||
}
|
||||
|
||||
public void setChannel(String channel) {
|
||||
this.channel = channel;
|
||||
}
|
||||
|
||||
public String getChannel() {
|
||||
return channel;
|
||||
}
|
||||
|
||||
public void setMessageHandlerThreads(Integer messageHandlerThreads) {
|
||||
this.messageHandlerThreads = messageHandlerThreads;
|
||||
}
|
||||
|
||||
public Integer getMessageHandlerThreads() {
|
||||
return messageHandlerThreads;
|
||||
}
|
||||
|
||||
public void setMessageHandlerQueueSize(Integer messageHandlerQueueSize) {
|
||||
this.messageHandlerQueueSize = messageHandlerQueueSize;
|
||||
}
|
||||
|
||||
public Integer getMessageHandlerQueueSize() {
|
||||
return messageHandlerQueueSize;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package timely.nsq.config;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
@Validated
|
||||
@ConfigurationProperties(prefix = "timely.client")
|
||||
public class TimelyClientProperties {
|
||||
@NotBlank
|
||||
private String host;
|
||||
@NotNull
|
||||
private Integer tcpPort;
|
||||
private Long timeToLiveMs;
|
||||
private Long maxLatencyMs;
|
||||
private Integer writesToBuffer = -1;
|
||||
private Integer relayHandlerTheads = 4;
|
||||
|
||||
public void setHost(String host) {
|
||||
this.host = host;
|
||||
}
|
||||
|
||||
public String getHost() {
|
||||
return host;
|
||||
}
|
||||
|
||||
public void setTcpPort(Integer tcpPort) {
|
||||
this.tcpPort = tcpPort;
|
||||
}
|
||||
|
||||
public Integer getTcpPort() {
|
||||
return tcpPort;
|
||||
}
|
||||
|
||||
public void setTimeToLiveMs(Long timeToLiveMs) {
|
||||
this.timeToLiveMs = timeToLiveMs;
|
||||
}
|
||||
|
||||
public Long getTimeToLiveMs() {
|
||||
return timeToLiveMs;
|
||||
}
|
||||
|
||||
public void setMaxLatencyMs(Long maxLatencyMs) {
|
||||
this.maxLatencyMs = maxLatencyMs;
|
||||
}
|
||||
|
||||
public Long getMaxLatencyMs() {
|
||||
return maxLatencyMs;
|
||||
}
|
||||
|
||||
public void setWritesToBuffer(Integer writesToBuffer) {
|
||||
this.writesToBuffer = writesToBuffer;
|
||||
}
|
||||
|
||||
public Integer getWritesToBuffer() {
|
||||
return writesToBuffer;
|
||||
}
|
||||
|
||||
public void setRelayHandlerTheads(Integer relayHandlerTheads) {
|
||||
this.relayHandlerTheads = relayHandlerTheads;
|
||||
}
|
||||
|
||||
public Integer getRelayHandlerTheads() {
|
||||
return relayHandlerTheads;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
spring:
|
||||
application:
|
||||
name: timely-nsq-relay
|
||||
config:
|
||||
name: timely-nsq-relay
|
||||
location: ${CONF_DIR:}/
|
||||
@@ -3,7 +3,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>timely</groupId>
|
||||
<artifactId>timely</artifactId>
|
||||
<version>2.2.6-SNAPSHOT</version>
|
||||
<version>2.1.6-SNAPSHOT</version>
|
||||
<packaging>pom</packaging>
|
||||
<name>Timely</name>
|
||||
<description>A secure and scalable time series database based on Apache Accumulo</description>
|
||||
@@ -17,6 +17,7 @@
|
||||
<module>common</module>
|
||||
<module>test</module>
|
||||
<module>client</module>
|
||||
<module>nsq-relay</module>
|
||||
<module>server</module>
|
||||
<module>balancer</module>
|
||||
<module>grafana</module>
|
||||
@@ -33,10 +34,10 @@
|
||||
</issueManagement>
|
||||
<properties>
|
||||
<assembly.tarLongFileMode>posix</assembly.tarLongFileMode>
|
||||
<collectd-api-jar>/usr/share/collectd/java/collectd-api.jar</collectd-api-jar>
|
||||
<docker.image.prefix>timely/</docker.image.prefix>
|
||||
<java.version>11</java.version>
|
||||
<maven.compiler.source>${java.version}</maven.compiler.source>
|
||||
<maven.compiler.target>${java.version}</maven.compiler.target>
|
||||
<maven.compiler.source>11</maven.compiler.source>
|
||||
<maven.compiler.target>11</maven.compiler.target>
|
||||
<!-- Configure the os-maven-plugin extension to expand the classifier on -->
|
||||
<!-- Fedora-"like" systems. -->
|
||||
<os.detection.classifierWithLikes>fedora</os.detection.classifierWithLikes>
|
||||
@@ -44,37 +45,38 @@
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<spotbugs.excludes.file>${project.basedir}/src/main/spotbugs/excludes.xml</spotbugs.excludes.file>
|
||||
<surefire.forkCount>1C</surefire.forkCount>
|
||||
<version.accumulo>2.1.5</version.accumulo>
|
||||
<version.accumulo>2.1.2</version.accumulo>
|
||||
<version.caffeine>3.1.8</version.caffeine>
|
||||
<version.classgraph>4.8.184</version.classgraph>
|
||||
<version.classgraph>4.8.165</version.classgraph>
|
||||
<version.collectd>5.7.1</version.collectd>
|
||||
<version.commons-collections4>4.4</version.commons-collections4>
|
||||
<version.commons-lang>2.6</version.commons-lang>
|
||||
<version.commons-lang3>3.20.0</version.commons-lang3>
|
||||
<version.commons-logging>1.3.6</version.commons-logging>
|
||||
<version.commons-pool2>2.13.1</version.commons-pool2>
|
||||
<version.commons-text>1.15.0</version.commons-text>
|
||||
<version.commons-lang3>3.14.0</version.commons-lang3>
|
||||
<version.commons-logging>1.3.0</version.commons-logging>
|
||||
<version.commons-pool2>2.12.0</version.commons-pool2>
|
||||
<version.commons-text>1.11.0</version.commons-text>
|
||||
<version.compression.gorilla>2.1.1</version.compression.gorilla>
|
||||
<version.curator>5.9.0</version.curator>
|
||||
<version.datawave-in-memory-accumulo>4.0.6</version.datawave-in-memory-accumulo>
|
||||
<version.curator>5.5.0</version.curator>
|
||||
<version.datawave-in-memory-accumulo>3.0.1</version.datawave-in-memory-accumulo>
|
||||
<version.disruptor>3.4.4</version.disruptor>
|
||||
<version.easymock>5.6.0</version.easymock>
|
||||
<version.easymock>4.0.2</version.easymock>
|
||||
<version.eclipse-lifecycle>1.0.0</version.eclipse-lifecycle>
|
||||
<version.fast-classpath-scanner>3.1.13</version.fast-classpath-scanner>
|
||||
<version.flink>1.1.4</version.flink>
|
||||
<version.google-flatbuffers>23.5.26</version.google-flatbuffers>
|
||||
<version.guava>33.6.0-jre</version.guava>
|
||||
<version.guava>33.0.0-jre</version.guava>
|
||||
<version.hadoop>3.3.6</version.hadoop>
|
||||
<version.httpcomponents>4.5.14</version.httpcomponents>
|
||||
<version.jackson>2.14.3</version.jackson>
|
||||
<version.jacoco>0.8.14</version.jacoco>
|
||||
<version.jackson>2.16.1</version.jackson>
|
||||
<version.jacoco>0.8.11</version.jacoco>
|
||||
<version.jakarta.websocket-api>1.1.2</version.jakarta.websocket-api>
|
||||
<version.javacsv>2.0</version.javacsv>
|
||||
<version.javassist>3.31.0-GA</version.javassist>
|
||||
<version.javassist>3.30.2-GA</version.javassist>
|
||||
<version.jcip-annotations>1.0</version.jcip-annotations>
|
||||
<version.jjwt>0.12.7</version.jjwt>
|
||||
<version.jsoup>1.22.2</version.jsoup>
|
||||
<version.jjwt>0.12.3</version.jjwt>
|
||||
<version.jsoup>1.17.2</version.jsoup>
|
||||
<version.junit>4.13.2</version.junit>
|
||||
<version.log4j2>2.26.1</version.log4j2>
|
||||
<version.log4j2>2.22.1</version.log4j2>
|
||||
<version.maven-assembly-plugin>3.6.0</version.maven-assembly-plugin>
|
||||
<version.maven-build-helper-plugin>3.5.0</version.maven-build-helper-plugin>
|
||||
<version.maven-buildnumber-plugin>1.4</version.maven-buildnumber-plugin>
|
||||
@@ -90,17 +92,17 @@
|
||||
<version.maven-shade-plugin>3.5.1</version.maven-shade-plugin>
|
||||
<version.maven-spotbugs-plugin>4.7.3.0</version.maven-spotbugs-plugin>
|
||||
<version.maven-surefire-plugin>3.2.5</version.maven-surefire-plugin>
|
||||
<version.micrometer>1.16.5</version.micrometer>
|
||||
<version.netty>4.1.133.Final</version.netty>
|
||||
<version.netty-tcnative>2.0.77.Final</version.netty-tcnative>
|
||||
<version.micrometer>1.12.2</version.micrometer>
|
||||
<version.netty>4.1.106.Final</version.netty>
|
||||
<version.netty-tcnative>2.0.61.Final</version.netty-tcnative>
|
||||
<version.powermock>1.6.4</version.powermock>
|
||||
<version.reactor-netty>1.1.15</version.reactor-netty>
|
||||
<version.slf4j>2.0.17</version.slf4j>
|
||||
<version.snakeyaml>1.33</version.snakeyaml>
|
||||
<version.slf4j>1.7.36</version.slf4j>
|
||||
<version.snakeyaml>2.2</version.snakeyaml>
|
||||
<version.spring-boot>2.7.18</version.spring-boot>
|
||||
<version.spring-cloud>3.1.8</version.spring-cloud>
|
||||
<version.spring-webflux>5.3.39</version.spring-webflux>
|
||||
<version.tyrus>1.22</version.tyrus>
|
||||
<version.spring-webflux>5.3.31</version.spring-webflux>
|
||||
<version.tyrus>1.15</version.tyrus>
|
||||
</properties>
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
@@ -126,11 +128,6 @@
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>collectd</groupId>
|
||||
<artifactId>collectd-api</artifactId>
|
||||
<version>${version.collectd}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-annotations</artifactId>
|
||||
@@ -682,6 +679,13 @@
|
||||
<artifactId>timely-test</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>collectd</groupId>
|
||||
<artifactId>collectd-api</artifactId>
|
||||
<version>${version.collectd}</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${collectd-api-jar}</systemPath>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.lmax</groupId>
|
||||
<artifactId>disruptor</artifactId>
|
||||
@@ -700,12 +704,6 @@
|
||||
<version>${version.junit}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.jcip</groupId>
|
||||
<artifactId>jcip-annotations</artifactId>
|
||||
<version>${version.jcip-annotations}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.easymock</groupId>
|
||||
<artifactId>easymock</artifactId>
|
||||
@@ -933,10 +931,6 @@
|
||||
</includes>
|
||||
<groups>timely.test.IntegrationTest</groups>
|
||||
<redirectTestOutputToFile>true</redirectTestOutputToFile>
|
||||
<systemProperties>
|
||||
<log4j.configuration>file:${project.build.testOutputDirectory}/log4j.yml</log4j.configuration>
|
||||
<java.io.tmpdir>${project.build.directory}</java.io.tmpdir>
|
||||
</systemProperties>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
@@ -989,10 +983,6 @@
|
||||
<runOrder>random</runOrder>
|
||||
<excludedGroups>timely.test.IntegrationTest</excludedGroups>
|
||||
<redirectTestOutputToFile>true</redirectTestOutputToFile>
|
||||
<systemProperties>
|
||||
<log4j.configuration>file:${project.build.testOutputDirectory}/log4j.yml</log4j.configuration>
|
||||
<java.io.tmpdir>${project.build.directory}</java.io.tmpdir>
|
||||
</systemProperties>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
@@ -1099,29 +1089,6 @@
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-install-plugin</artifactId>
|
||||
<version>3.1.4</version>
|
||||
<inherited>false</inherited>
|
||||
<configuration>
|
||||
<file>${project.basedir}/lib/collectd-api-${version.collectd}.jar</file>
|
||||
<pomFile>${project.basedir}/lib/collectd-api-${version.collectd}.pom</pomFile>
|
||||
<groupId>collectd</groupId>
|
||||
<artifactId>collectd-api</artifactId>
|
||||
<version>${version.collectd}</version>
|
||||
<packaging>jar</packaging>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>collectd-api-jar</id>
|
||||
<goals>
|
||||
<goal>install-file</goal>
|
||||
</goals>
|
||||
<phase>validate</phase>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>buildnumber-maven-plugin</artifactId>
|
||||
@@ -1334,8 +1301,19 @@
|
||||
<profile>
|
||||
<id>collectd</id>
|
||||
<modules>
|
||||
<module>collectd</module>
|
||||
<module>collectd-timely-plugin</module>
|
||||
<module>collectd-nsq-plugin</module>
|
||||
<module>collectd-plugin-parent</module>
|
||||
</modules>
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>timely</groupId>
|
||||
<artifactId>collectd-plugin-parent</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>add-spotbugs-excludes</id>
|
||||
|
||||
@@ -11,9 +11,6 @@ WEBSOCKET_BASE_PORT=4244
|
||||
UDP_BASE_PORT=4245
|
||||
AGE_OFF_DAYS=7
|
||||
|
||||
FILTERED_METRICS_FILE="${CONF_DIR}/filteredMetrics.txt"
|
||||
FILTERED_TAGS_FILE="${CONF_DIR}/filteredTags.txt"
|
||||
|
||||
HOST_IP=0.0.0.0
|
||||
HOST=$(hostname -s)
|
||||
|
||||
|
||||
@@ -9,8 +9,6 @@ timely:
|
||||
metric-age-off-hours:
|
||||
default: 26
|
||||
metrics-report-ignored-tags:
|
||||
filtered-metrics-file: ${FILTERED_METRICS_FILE}
|
||||
filtered-tags-file: ${FILTERED_TAGS_FILE}
|
||||
default-visibility:
|
||||
zookeeper:
|
||||
servers: ${ACCUMULO_ZOOKEEPERS}
|
||||
|
||||
+1
-5
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>timely</groupId>
|
||||
<artifactId>timely</artifactId>
|
||||
<version>2.2.6-SNAPSHOT</version>
|
||||
<version>2.1.6-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>timely-server</artifactId>
|
||||
<description>Timely Server</description>
|
||||
@@ -68,10 +68,6 @@
|
||||
<groupId>io.micrometer</groupId>
|
||||
<artifactId>micrometer-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.netty</groupId>
|
||||
<artifactId>netty-transport-classes-epoll</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.projectreactor.netty</groupId>
|
||||
<artifactId>reactor-netty</artifactId>
|
||||
|
||||
Vendored
+7
@@ -67,5 +67,12 @@
|
||||
<include>*</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
<fileSet>
|
||||
<directory>${project.basedir}/src/main/resources/webapp</directory>
|
||||
<outputDirectory>bin/webapp</outputDirectory>
|
||||
<includes>
|
||||
<include>*</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
</fileSets>
|
||||
</assembly>
|
||||
Loaded 100 of 134 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user