forked from woggioni/rbcs
removed telemetry switch from configuration
This commit is contained in:
@@ -5,7 +5,6 @@ The root element that contains all server configuration.
|
|||||||
|
|
||||||
**Attributes:**
|
**Attributes:**
|
||||||
- `path` (optional): URI path prefix for cache requests. Example: if set to "cache", requests would be made to "http://www.example.com/cache/KEY"
|
- `path` (optional): URI path prefix for cache requests. Example: if set to "cache", requests would be made to "http://www.example.com/cache/KEY"
|
||||||
- `enable-telemetry` (optional): If set to "true" it will enable opentelemetry integration (you will need to make sure the `rbcs-server-otel` has been unpacked in the `plugins` folder)
|
|
||||||
|
|
||||||
#### Child Elements
|
#### Child Elements
|
||||||
|
|
||||||
@@ -140,7 +139,7 @@ Configures TLS encryption.
|
|||||||
<rbcs:server xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"
|
<rbcs:server xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xmlns:rbcs="urn:net.woggioni.rbcs.server"
|
xmlns:rbcs="urn:net.woggioni.rbcs.server"
|
||||||
xs:schemaLocation="urn:net.woggioni.rbcs.server jpms://net.woggioni.rbcs.server/net/woggioni/rbcs/server/schema/rbcs-server.xsd"
|
xs:schemaLocation="urn:net.woggioni.rbcs.server jpms://net.woggioni.rbcs.server/net/woggioni/rbcs/server/schema/rbcs-server.xsd"
|
||||||
path="/my/custom/path" enable-telemetry="true"
|
path="/my/custom/path"
|
||||||
>
|
>
|
||||||
<bind host="0.0.0.0" port="8080" incoming-connections-backlog-size="1024" proxy-protocol="true">
|
<bind host="0.0.0.0" port="8080" incoming-connections-backlog-size="1024" proxy-protocol="true">
|
||||||
<trusted-proxies>
|
<trusted-proxies>
|
||||||
|
|||||||
@@ -7,7 +7,8 @@ FROM base-release AS release-vanilla
|
|||||||
ADD rbcs-cli-envelope-*.jar rbcs.jar
|
ADD rbcs-cli-envelope-*.jar rbcs.jar
|
||||||
ADD logback.xml /etc/rbcs/logback.xml
|
ADD logback.xml /etc/rbcs/logback.xml
|
||||||
ENV RBCS_CONFIGURATION_DIR="/etc/rbcs"
|
ENV RBCS_CONFIGURATION_DIR="/etc/rbcs"
|
||||||
ENTRYPOINT ["java", "-Dlogback.configurationFile=/etc/rbcs/logback.xml", "-XX:MaxRAMPercentage=70", "-XX:GCTimeRatio=24", "-XX:+UseZGC", "-jar", "/var/lib/rbcs/rbcs.jar"]
|
ENV JDK_JAVA_OPTIONS=-Dlogback.configurationFile=/etc/rbcs/logback.xml\ -XX:MaxRAMPercentage=70\ -XX:GCTimeRatio=24\ -XX:+UseZGC
|
||||||
|
ENTRYPOINT ["java", "-jar", "/var/lib/rbcs/rbcs.jar"]
|
||||||
|
|
||||||
FROM base-release AS release-memcache
|
FROM base-release AS release-memcache
|
||||||
ADD --chown=rbcs:rbcs rbcs-cli-envelope-*.jar rbcs.jar
|
ADD --chown=rbcs:rbcs rbcs-cli-envelope-*.jar rbcs.jar
|
||||||
@@ -16,8 +17,7 @@ WORKDIR /var/lib/rbcs/plugins
|
|||||||
RUN --mount=type=bind,source=.,target=/build/distributions tar -xf /build/distributions/rbcs-server-memcache*.tar
|
RUN --mount=type=bind,source=.,target=/build/distributions tar -xf /build/distributions/rbcs-server-memcache*.tar
|
||||||
WORKDIR /var/lib/rbcs
|
WORKDIR /var/lib/rbcs
|
||||||
ADD logback.xml /etc/rbcs/logback.xml
|
ADD logback.xml /etc/rbcs/logback.xml
|
||||||
ENV RBCS_CONFIGURATION_DIR="/etc/rbcs"
|
ENTRYPOINT ["java", "-jar", "/var/lib/rbcs/rbcs.jar"]
|
||||||
ENTRYPOINT ["java", "-Dlogback.configurationFile=/etc/rbcs/logback.xml", "-XX:MaxRAMPercentage=70", "-XX:GCTimeRatio=24", "-XX:+UseZGC", "-jar", "/var/lib/rbcs/rbcs.jar"]
|
|
||||||
|
|
||||||
FROM base-release AS release-redis
|
FROM base-release AS release-redis
|
||||||
ADD --chown=rbcs:rbcs rbcs-cli-envelope-*.jar rbcs.jar
|
ADD --chown=rbcs:rbcs rbcs-cli-envelope-*.jar rbcs.jar
|
||||||
@@ -26,8 +26,7 @@ WORKDIR /var/lib/rbcs/plugins
|
|||||||
RUN --mount=type=bind,source=.,target=/build/distributions tar -xf /build/distributions/rbcs-server-redis*.tar
|
RUN --mount=type=bind,source=.,target=/build/distributions tar -xf /build/distributions/rbcs-server-redis*.tar
|
||||||
WORKDIR /var/lib/rbcs
|
WORKDIR /var/lib/rbcs
|
||||||
ADD logback.xml /etc/rbcs/logback.xml
|
ADD logback.xml /etc/rbcs/logback.xml
|
||||||
ENV RBCS_CONFIGURATION_DIR="/etc/rbcs"
|
ENTRYPOINT ["java", "-jar", "/var/lib/rbcs/rbcs.jar"]
|
||||||
ENTRYPOINT ["java", "-Dlogback.configurationFile=/etc/rbcs/logback.xml", "-XX:MaxRAMPercentage=70", "-XX:GCTimeRatio=24", "-XX:+UseZGC", "-jar", "/var/lib/rbcs/rbcs.jar"]
|
|
||||||
|
|
||||||
FROM base-release AS release-full
|
FROM base-release AS release-full
|
||||||
ADD --chown=rbcs:rbcs rbcs-cli-envelope-*.jar rbcs.jar
|
ADD --chown=rbcs:rbcs rbcs-cli-envelope-*.jar rbcs.jar
|
||||||
@@ -38,8 +37,8 @@ RUN --mount=type=bind,source=.,target=/build/distributions tar -xf /build/distri
|
|||||||
RUN --mount=type=bind,source=.,target=/build/distributions tar -xf /build/distributions/rbcs-server-otel*.tar
|
RUN --mount=type=bind,source=.,target=/build/distributions tar -xf /build/distributions/rbcs-server-otel*.tar
|
||||||
WORKDIR /var/lib/rbcs
|
WORKDIR /var/lib/rbcs
|
||||||
ADD logback.xml /etc/rbcs/logback.xml
|
ADD logback.xml /etc/rbcs/logback.xml
|
||||||
ENV RBCS_CONFIGURATION_DIR="/etc/rbcs"
|
ENV OTEL_SDK_DISABLED="true"
|
||||||
ENTRYPOINT ["java", "-Dlogback.configurationFile=/etc/rbcs/logback.xml", "-XX:MaxRAMPercentage=70", "-XX:GCTimeRatio=24", "-XX:+UseZGC", "-jar", "/var/lib/rbcs/rbcs.jar"]
|
ENTRYPOINT ["java", "-jar", "/var/lib/rbcs/rbcs.jar"]
|
||||||
|
|
||||||
FROM busybox:musl AS base-native
|
FROM busybox:musl AS base-native
|
||||||
RUN mkdir -p /var/lib/rbcs /var/tmp/rbcs /etc/rbcs
|
RUN mkdir -p /var/lib/rbcs /var/tmp/rbcs /etc/rbcs
|
||||||
@@ -66,5 +65,5 @@ USER rbcs
|
|||||||
WORKDIR /var/lib/rbcs
|
WORKDIR /var/lib/rbcs
|
||||||
ADD logback.xml /etc/rbcs/logback.xml
|
ADD logback.xml /etc/rbcs/logback.xml
|
||||||
ENV RBCS_CONFIGURATION_DIR="/etc/rbcs"
|
ENV RBCS_CONFIGURATION_DIR="/etc/rbcs"
|
||||||
ENV JAVA_OPTS=-XX:-UseJVMCICompiler\ -Dlogback.configurationFile=/etc/rbcs/logback.xml\ -XX:MaxRAMPercentage=70\ -XX:GCTimeRatio=24\ -XX:+UseZGC
|
ENV JDK_JAVA_OPTIONS=-XX:-UseJVMCICompiler\ -Dlogback.configurationFile=/etc/rbcs/logback.xml\ -XX:MaxRAMPercentage=70\ -XX:GCTimeRatio=24\ -XX:+UseZGC
|
||||||
ENTRYPOINT ["/usr/local/bin/rbcs-cli"]
|
ENTRYPOINT ["/usr/local/bin/rbcs-cli"]
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ public class Configuration {
|
|||||||
String serverPath;
|
String serverPath;
|
||||||
boolean proxyProtocolEnabled;
|
boolean proxyProtocolEnabled;
|
||||||
List<Cidr> trustedProxyIPs;
|
List<Cidr> trustedProxyIPs;
|
||||||
boolean enableTelemetry;
|
|
||||||
int incomingConnectionsBacklogSize;
|
int incomingConnectionsBacklogSize;
|
||||||
@NonNull
|
@NonNull
|
||||||
EventExecutor eventExecutor;
|
EventExecutor eventExecutor;
|
||||||
@@ -151,7 +150,6 @@ public class Configuration {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static Configuration of(
|
public static Configuration of(
|
||||||
boolean enableTelemetry,
|
|
||||||
String host,
|
String host,
|
||||||
int port,
|
int port,
|
||||||
boolean proxyProtocolEnabled,
|
boolean proxyProtocolEnabled,
|
||||||
@@ -173,7 +171,6 @@ public class Configuration {
|
|||||||
serverPath != null && !serverPath.isEmpty() && !serverPath.equals("/") ? serverPath : null,
|
serverPath != null && !serverPath.isEmpty() && !serverPath.equals("/") ? serverPath : null,
|
||||||
proxyProtocolEnabled,
|
proxyProtocolEnabled,
|
||||||
trustedProxyIPs,
|
trustedProxyIPs,
|
||||||
enableTelemetry,
|
|
||||||
incomingConnectionsBacklogSize,
|
incomingConnectionsBacklogSize,
|
||||||
eventExecutor,
|
eventExecutor,
|
||||||
rateLimiter,
|
rateLimiter,
|
||||||
|
|||||||
@@ -123,7 +123,6 @@ object GraalNativeImageConfiguration {
|
|||||||
null,
|
null,
|
||||||
false,
|
false,
|
||||||
emptyList(),
|
emptyList(),
|
||||||
false,
|
|
||||||
100,
|
100,
|
||||||
Configuration.EventExecutor(true),
|
Configuration.EventExecutor(true),
|
||||||
Configuration.RateLimiter(
|
Configuration.RateLimiter(
|
||||||
|
|||||||
@@ -14,18 +14,6 @@ class OtelController : TelemetryController {
|
|||||||
|
|
||||||
private val log = createLogger<OtelController>()
|
private val log = createLogger<OtelController>()
|
||||||
|
|
||||||
private val appenderAvailable: Boolean by lazy {
|
|
||||||
runCatching {
|
|
||||||
Class.forName("io.opentelemetry.instrumentation.logback.appender.v1_0.OpenTelemetryAppender")
|
|
||||||
}.fold(
|
|
||||||
onSuccess = { true },
|
|
||||||
onFailure = {
|
|
||||||
log.info { "OpenTelemetry logback appender not on classpath" }
|
|
||||||
false
|
|
||||||
},
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun initialize() {
|
override fun initialize() {
|
||||||
log.info { "Initializing OpenTelemetry SDK with auto-configuration" }
|
log.info { "Initializing OpenTelemetry SDK with auto-configuration" }
|
||||||
|
|
||||||
@@ -35,14 +23,12 @@ class OtelController : TelemetryController {
|
|||||||
.openTelemetrySdk
|
.openTelemetrySdk
|
||||||
RuntimeTelemetry.create(sdk)
|
RuntimeTelemetry.create(sdk)
|
||||||
|
|
||||||
if (appenderAvailable) {
|
runCatching {
|
||||||
runCatching {
|
OpenTelemetryAppender.install(sdk)
|
||||||
OpenTelemetryAppender.install(sdk)
|
log.info { "OpenTelemetry logback appender installed" }
|
||||||
log.info { "OpenTelemetry logback appender installed" }
|
}.onFailure { ex ->
|
||||||
}.onFailure { ex ->
|
val msg = ex.localizedMessage ?: ex.javaClass.name
|
||||||
val msg = ex.localizedMessage ?: ex.javaClass.name
|
log.info { "Failed to install OpenTelemetry logback appender: $msg" }
|
||||||
log.info { "Failed to install OpenTelemetry logback appender: $msg" }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
log.info { "OpenTelemetry SDK initialized successfully" }
|
log.info { "OpenTelemetry SDK initialized successfully" }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -415,12 +415,10 @@ class RemoteBuildCacheServer(private val cfg: Configuration) {
|
|||||||
maxChunkSize = cfg.connection.chunkSize
|
maxChunkSize = cfg.connection.chunkSize
|
||||||
}
|
}
|
||||||
pipeline.addLast(HttpServerCodec(httpDecoderConfig))
|
pipeline.addLast(HttpServerCodec(httpDecoderConfig))
|
||||||
if(cfg.isEnableTelemetry) {
|
loadService(TelemetryController::class.java)
|
||||||
loadService(TelemetryController::class.java)
|
.firstOrNull()
|
||||||
.firstOrNull()
|
?.createHandler()
|
||||||
?.createHandler()
|
?.let { pipeline.addLast(it) }
|
||||||
?.let { pipeline.addLast(it) }
|
|
||||||
}
|
|
||||||
pipeline.addLast(ReadTriggerDuplexHandler.NAME, ReadTriggerDuplexHandler())
|
pipeline.addLast(ReadTriggerDuplexHandler.NAME, ReadTriggerDuplexHandler())
|
||||||
pipeline.addLast(MaxRequestSizeHandler.NAME, MaxRequestSizeHandler(cfg.connection.maxRequestSize))
|
pipeline.addLast(MaxRequestSizeHandler.NAME, MaxRequestSizeHandler(cfg.connection.maxRequestSize))
|
||||||
pipeline.addLast(HttpChunkContentCompressor(1024))
|
pipeline.addLast(HttpChunkContentCompressor(1024))
|
||||||
|
|||||||
@@ -46,8 +46,6 @@ object Parser {
|
|||||||
var groups = emptyMap<String, Group>()
|
var groups = emptyMap<String, Group>()
|
||||||
var tls: Tls? = null
|
var tls: Tls? = null
|
||||||
val serverPath = root.renderAttribute("path")
|
val serverPath = root.renderAttribute("path")
|
||||||
var enableTelemetry = root.renderAttribute("enable-telemetry")
|
|
||||||
?.let(String::toBoolean) ?: false
|
|
||||||
var incomingConnectionsBacklogSize = 1024
|
var incomingConnectionsBacklogSize = 1024
|
||||||
var authentication: Authentication? = null
|
var authentication: Authentication? = null
|
||||||
for (child in root.asIterable()) {
|
for (child in root.asIterable()) {
|
||||||
@@ -235,7 +233,6 @@ object Parser {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return Configuration.of(
|
return Configuration.of(
|
||||||
enableTelemetry,
|
|
||||||
host,
|
host,
|
||||||
port,
|
port,
|
||||||
proxyProtocolEnabled,
|
proxyProtocolEnabled,
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ object Serializer {
|
|||||||
?.let { serverPath ->
|
?.let { serverPath ->
|
||||||
attr("path", serverPath)
|
attr("path", serverPath)
|
||||||
}
|
}
|
||||||
attr("enable-telemetry", conf.isEnableTelemetry.toString())
|
|
||||||
node("bind") {
|
node("bind") {
|
||||||
attr("host", conf.host)
|
attr("host", conf.host)
|
||||||
attr("port", conf.port.toString())
|
attr("port", conf.port.toString())
|
||||||
|
|||||||
@@ -2,8 +2,7 @@
|
|||||||
<rbcs:server
|
<rbcs:server
|
||||||
xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"
|
xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xmlns:rbcs="urn:net.woggioni.rbcs.server"
|
xmlns:rbcs="urn:net.woggioni.rbcs.server"
|
||||||
xs:schemaLocation="urn:net.woggioni.rbcs.server jpms://net.woggioni.rbcs.server/net/woggioni/rbcs/server/schema/rbcs-server.xsd"
|
xs:schemaLocation="urn:net.woggioni.rbcs.server jpms://net.woggioni.rbcs.server/net/woggioni/rbcs/server/schema/rbcs-server.xsd">
|
||||||
enable-telemetry="false">
|
|
||||||
<bind host="127.0.0.1" port="8080" incoming-connections-backlog-size="1024"/>
|
<bind host="127.0.0.1" port="8080" incoming-connections-backlog-size="1024"/>
|
||||||
<cache xs:type="rbcs:fileSystemCacheType" path="${sys:java.io.tmpdir}/rbcs" max-age="P7D"/>
|
<cache xs:type="rbcs:fileSystemCacheType" path="${sys:java.io.tmpdir}/rbcs" max-age="P7D"/>
|
||||||
</rbcs:server>
|
</rbcs:server>
|
||||||
@@ -59,14 +59,6 @@
|
|||||||
</xs:documentation>
|
</xs:documentation>
|
||||||
</xs:annotation>
|
</xs:annotation>
|
||||||
</xs:attribute>
|
</xs:attribute>
|
||||||
<xs:attribute name="enable-telemetry" type="xs:boolean" use="optional" default="false">
|
|
||||||
<xs:annotation>
|
|
||||||
<xs:documentation>
|
|
||||||
Enable OpenTelemetry distributed tracing for the server.
|
|
||||||
Even when enabled, telemetry only activates if OpenTelemetry classes are present on the classpath.
|
|
||||||
</xs:documentation>
|
|
||||||
</xs:annotation>
|
|
||||||
</xs:attribute>
|
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
|
|
||||||
<xs:complexType name="bindType">
|
<xs:complexType name="bindType">
|
||||||
|
|||||||
@@ -32,7 +32,6 @@ abstract class AbstractBasicAuthServerTest : AbstractServerTest() {
|
|||||||
override fun setUp() {
|
override fun setUp() {
|
||||||
this.cacheDir = testDir.resolve("cache")
|
this.cacheDir = testDir.resolve("cache")
|
||||||
cfg = Configuration.of(
|
cfg = Configuration.of(
|
||||||
false,
|
|
||||||
"127.0.0.1",
|
"127.0.0.1",
|
||||||
getFreePort(),
|
getFreePort(),
|
||||||
false,
|
false,
|
||||||
|
|||||||
@@ -143,7 +143,6 @@ abstract class AbstractTlsServerTest : AbstractServerTest() {
|
|||||||
serverPath,
|
serverPath,
|
||||||
false,
|
false,
|
||||||
emptyList(),
|
emptyList(),
|
||||||
false,
|
|
||||||
100,
|
100,
|
||||||
Configuration.EventExecutor(false),
|
Configuration.EventExecutor(false),
|
||||||
Configuration.RateLimiter(true, 0x100000, 50),
|
Configuration.RateLimiter(true, 0x100000, 50),
|
||||||
|
|||||||
@@ -37,7 +37,6 @@ class NoAuthServerTest : AbstractServerTest() {
|
|||||||
serverPath,
|
serverPath,
|
||||||
false,
|
false,
|
||||||
emptyList(),
|
emptyList(),
|
||||||
false,
|
|
||||||
100,
|
100,
|
||||||
Configuration.EventExecutor(false),
|
Configuration.EventExecutor(false),
|
||||||
Configuration.RateLimiter(true, 0x100000, 50),
|
Configuration.RateLimiter(true, 0x100000, 50),
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<rbcs:server xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"
|
<rbcs:server xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xmlns:rbcs="urn:net.woggioni.rbcs.server"
|
xmlns:rbcs="urn:net.woggioni.rbcs.server"
|
||||||
xs:schemaLocation="urn:net.woggioni.rbcs.server jpms://net.woggioni.rbcs.server/net/woggioni/rbcs/server/schema/rbcs-server.xsd"
|
xs:schemaLocation="urn:net.woggioni.rbcs.server jpms://net.woggioni.rbcs.server/net/woggioni/rbcs/server/schema/rbcs-server.xsd"
|
||||||
enable-telemetry="true" path="/my/custom/path">
|
path="/my/custom/path">
|
||||||
<bind host="127.0.0.1" port="11443" incoming-connections-backlog-size="22" proxy-protocol="true">
|
<bind host="127.0.0.1" port="11443" incoming-connections-backlog-size="22" proxy-protocol="true">
|
||||||
<trusted-proxies>
|
<trusted-proxies>
|
||||||
<allow cidr="192.168.0.11/32"/>
|
<allow cidr="192.168.0.11/32"/>
|
||||||
|
|||||||
Reference in New Issue
Block a user