From b2a69ca34611b47a2ed5f63ce550a5fc8060816c Mon Sep 17 00:00:00 2001 From: Paul Ambrose Date: Thu, 3 Sep 2020 21:35:17 -0700 Subject: [PATCH] 1.8.5 * Make cioTimeoutSecs an agent property --- Makefile | 2 +- README.md | 14 +- bin/docker-agent.sh | 2 +- bin/docker-proxy.sh | 2 +- build.gradle | 2 +- etc/compose/proxy.yml | 2 +- etc/config/config.conf | 10 +- examples/simple.conf | 4 +- .../java/io/prometheus/common/ConfigVals.java | 682 +++++++++--------- src/main/kotlin/io/prometheus/Agent.kt | 2 +- src/main/kotlin/io/prometheus/Proxy.kt | 2 +- .../io/prometheus/agent/AgentHttpService.kt | 3 +- .../io/prometheus/agent/AgentOptions.kt | 3 + .../io/prometheus/agent/AgentPathManager.kt | 6 +- .../io/prometheus/proxy/ProxyOptions.kt | 3 + 15 files changed, 375 insertions(+), 364 deletions(-) diff --git a/Makefile b/Makefile index 70f0d01a..ac5a909d 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -VERSION=1.8.4 +VERSION=1.8.5 default: compile diff --git a/README.md b/README.md index d531850e..2cf296cd 100644 --- a/README.md +++ b/README.md @@ -97,8 +97,8 @@ scrape_configs: The docker images are available via: ```bash -docker pull pambrose/prometheus-proxy:1.8.4 -docker pull pambrose/prometheus-agent:1.8.4 +docker pull pambrose/prometheus-proxy:1.8.5 +docker pull pambrose/prometheus-agent:1.8.5 ``` Start a proxy container with: @@ -107,7 +107,7 @@ Start a proxy container with: docker run --rm -p 8082:8082 -p 8092:8092 -p 50051:50051 -p 8080:8080 \ --env ADMIN_ENABLED=true \ --env METRICS_ENABLED=true \ - pambrose/prometheus-proxy:1.8.4 + pambrose/prometheus-proxy:1.8.5 ``` Start an agent container with: @@ -115,7 +115,7 @@ Start an agent container with: ```bash docker run --rm -p 8083:8083 -p 8093:8093 \ --env AGENT_CONFIG='https://raw.githubusercontent.com/pambrose/prometheus-proxy/master/examples/simple.conf' \ - pambrose/prometheus-agent:1.8.4 + pambrose/prometheus-agent:1.8.5 ``` Using the config file [simple.conf](https://raw.githubusercontent.com/pambrose/prometheus-proxy/master/examples/simple.conf), @@ -131,7 +131,7 @@ is in your current directory, run an agent container with: docker run --rm -p 8083:8083 -p 8093:8093 \ --mount type=bind,source="$(pwd)"/prom-agent.conf,target=/app/prom-agent.conf \ --env AGENT_CONFIG=prom-agent.conf \ - pambrose/prometheus-agent:1.8.4 + pambrose/prometheus-agent:1.8.5 ``` **Note:** The `WORKDIR` of the proxy and agent images is `/app`, so make sure @@ -252,7 +252,7 @@ docker run --rm -p 8082:8082 -p 8092:8092 -p 50440:50440 -p 8080:8080 \ --env PROXY_CONFIG=tls-no-mutual-auth.conf \ --env ADMIN_ENABLED=true \ --env METRICS_ENABLED=true \ - pambrose/prometheus-proxy:1.8.4 + pambrose/prometheus-proxy:1.8.5 docker run --rm -p 8083:8083 -p 8093:8093 \ --mount type=bind,source="$(pwd)"/testing/certs,target=/app/testing/certs \ @@ -260,7 +260,7 @@ docker run --rm -p 8083:8083 -p 8093:8093 \ --env AGENT_CONFIG=tls-no-mutual-auth.conf \ --env PROXY_HOSTNAME=mymachine.lan:50440 \ --name docker-agent \ - pambrose/prometheus-agent:1.8.4 + pambrose/prometheus-agent:1.8.5 ``` **Note:** The `WORKDIR` of the proxy and agent images is `/app`, so make sure diff --git a/bin/docker-agent.sh b/bin/docker-agent.sh index 829680e9..8d9c1331 100755 --- a/bin/docker-agent.sh +++ b/bin/docker-agent.sh @@ -3,4 +3,4 @@ docker run --rm -p 8083:8083 -p 8093:8093 \ --env AGENT_CONFIG='https://raw.githubusercontent.com/pambrose/prometheus-proxy/master/examples/simple.conf' \ --env PROXY_HOSTNAME=mymachine.lan \ - pambrose/prometheus-agent:1.8.4 + pambrose/prometheus-agent:1.8.5 diff --git a/bin/docker-proxy.sh b/bin/docker-proxy.sh index 62b6bb53..5131bd30 100755 --- a/bin/docker-proxy.sh +++ b/bin/docker-proxy.sh @@ -2,4 +2,4 @@ docker run --rm -p 8082:8082 -p 8092:8092 -p 50051:50051 -p 8080:8080 \ --env PROXY_CONFIG='https://raw.githubusercontent.com/pambrose/prometheus-proxy/master/examples/simple.conf' \ - pambrose/prometheus-proxy:1.8.4 + pambrose/prometheus-proxy:1.8.5 diff --git a/build.gradle b/build.gradle index 8d9a9050..7c3b66d6 100644 --- a/build.gradle +++ b/build.gradle @@ -11,7 +11,7 @@ plugins { } group = 'io.prometheus' -version = '1.8.4' +version = '1.8.5' sourceCompatibility = 1.8 targetCompatibility = 1.8 diff --git a/etc/compose/proxy.yml b/etc/compose/proxy.yml index 8db75137..a66e5d79 100644 --- a/etc/compose/proxy.yml +++ b/etc/compose/proxy.yml @@ -1,6 +1,6 @@ prometheus-proxy: autoredeploy: true - image: 'pambrose/prometheus-proxy:1.8.4' + image: 'pambrose/prometheus-proxy:1.8.5' ports: - '8080:8080' - '8082:8082' diff --git a/etc/config/config.conf b/etc/config/config.conf index be0c08c3..f1c7cfc7 100644 --- a/etc/config/config.conf +++ b/etc/config/config.conf @@ -51,7 +51,7 @@ proxy { maxAgentInactivitySecs = 15 // Seconds of inactivity before agent is evicted in seconds staleAgentCheckPauseSecs = 10 // Pause interval for agent cleanup in seconds - scrapeRequestTimeoutSecs = 60 // Timeout for scrape requests in seconds + scrapeRequestTimeoutSecs = 90 // Timeout for scrape requests in seconds scrapeRequestCheckMillis = 500 // Pause time between checks for scrape request timeout in millis scrapeRequestBacklogUnhealthySize = 25 // Threshold for returning an unhealthy healthcheck scrapeRequestMapUnhealthySize = 25 // Threshold for returning an unhealthy healthcheck @@ -125,7 +125,7 @@ agent { } } - pathConfigs: [ // List of path configs registered with a Proxy + pathConfigs: [ // List of path configs registered with a Proxy { name: String // Endpint name path: String // Path used by the proxy @@ -134,11 +134,13 @@ agent { ] internal { - reconnectPauseSecs = 3 // Pause interval between connect attempts + cioTimeoutSecs = 90 // CIO engine request timeout in seconds + + reconnectPauseSecs = 3 // Pause interval between connect attempts in seconds heartbeatEnabled = true heartbeatCheckPauseMillis = 500 // Pause interval when checking for inactivity - heartbeatMaxInactivitySecs = 5 // Max inactivity before hearbeat sent + heartbeatMaxInactivitySecs = 5 // Max inactivity before hearbeat sent in seconds scrapeRequestBacklogUnhealthySize = 25 // Threshold for returning an unhealthy healthcheck diff --git a/examples/simple.conf b/examples/simple.conf index 09883e2e..90352019 100644 --- a/examples/simple.conf +++ b/examples/simple.conf @@ -18,13 +18,13 @@ agent { name: "Proxy metrics" path: proxy_metrics url: "http://localhost:8082/metrics" - url: "http://"${?HOSTNAME}":8082/metrics" + //url: "http://"${?HOSTNAME}":8082/metrics" } { name: "Agent metrics" path: agent_metrics url: "http://localhost:8083/metrics" - url: "http://"${?HOSTNAME}":8083/metrics" + //url: "http://"${?HOSTNAME}":8083/metrics" } ] } \ No newline at end of file diff --git a/src/main/java/io/prometheus/common/ConfigVals.java b/src/main/java/io/prometheus/common/ConfigVals.java index f802ab1d..07afe0ae 100644 --- a/src/main/java/io/prometheus/common/ConfigVals.java +++ b/src/main/java/io/prometheus/common/ConfigVals.java @@ -1,378 +1,380 @@ -// generated by tscfg 0.9.98 on Tue Sep 01 09:26:03 PDT 2020 +// generated by tscfg 0.9.98 on Thu Sep 03 21:26:51 PDT 2020 // source: etc/config/config.conf package io.prometheus.common; public class ConfigVals { - public final ConfigVals.Agent agent; - public final ConfigVals.Proxy2 proxy; - - public ConfigVals(com.typesafe.config.Config c) { - final $TsCfgValidator $tsCfgValidator = new $TsCfgValidator(); - final java.lang.String parentPath = ""; - this.agent = c.hasPathOrNull("agent") ? new ConfigVals.Agent(c.getConfig("agent"), parentPath + "agent.", $tsCfgValidator) : new ConfigVals.Agent(com.typesafe.config.ConfigFactory.parseString("agent{}"), parentPath + "agent.", $tsCfgValidator); - this.proxy = c.hasPathOrNull("proxy") ? new ConfigVals.Proxy2(c.getConfig("proxy"), parentPath + "proxy.", $tsCfgValidator) : new ConfigVals.Proxy2(com.typesafe.config.ConfigFactory.parseString("proxy{}"), parentPath + "proxy.", $tsCfgValidator); - $tsCfgValidator.validate(); + public final ConfigVals.Agent agent; + public final ConfigVals.Proxy2 proxy; + + public ConfigVals(com.typesafe.config.Config c) { + final $TsCfgValidator $tsCfgValidator = new $TsCfgValidator(); + final java.lang.String parentPath = ""; + this.agent = c.hasPathOrNull("agent") ? new ConfigVals.Agent(c.getConfig("agent"), parentPath + "agent.", $tsCfgValidator) : new ConfigVals.Agent(com.typesafe.config.ConfigFactory.parseString("agent{}"), parentPath + "agent.", $tsCfgValidator); + this.proxy = c.hasPathOrNull("proxy") ? new ConfigVals.Proxy2(c.getConfig("proxy"), parentPath + "proxy.", $tsCfgValidator) : new ConfigVals.Proxy2(com.typesafe.config.ConfigFactory.parseString("proxy{}"), parentPath + "proxy.", $tsCfgValidator); + $tsCfgValidator.validate(); + } + + public static class Agent { + public final Agent.Admin admin; + public final int chunkContentSizeKbs; + public final boolean consolidated; + public final Agent.Internal internal; + public final Agent.Metrics metrics; + public final int minGzipSizeBytes; + public final java.lang.String name; + public final java.util.List pathConfigs; + public final Agent.Proxy proxy; + public final int scrapeTimeoutSecs; + public final Agent.Tls tls; + + public Agent(com.typesafe.config.Config c, java.lang.String parentPath, $TsCfgValidator $tsCfgValidator) { + this.admin = c.hasPathOrNull("admin") ? new Agent.Admin(c.getConfig("admin"), parentPath + "admin.", $tsCfgValidator) : new Agent.Admin(com.typesafe.config.ConfigFactory.parseString("admin{}"), parentPath + "admin.", $tsCfgValidator); + this.chunkContentSizeKbs = c.hasPathOrNull("chunkContentSizeKbs") ? c.getInt("chunkContentSizeKbs") : 32; + this.consolidated = c.hasPathOrNull("consolidated") && c.getBoolean("consolidated"); + this.internal = c.hasPathOrNull("internal") ? new Agent.Internal(c.getConfig("internal"), parentPath + "internal.", $tsCfgValidator) : new Agent.Internal(com.typesafe.config.ConfigFactory.parseString("internal{}"), parentPath + "internal.", $tsCfgValidator); + this.metrics = c.hasPathOrNull("metrics") ? new Agent.Metrics(c.getConfig("metrics"), parentPath + "metrics.", $tsCfgValidator) : new Agent.Metrics(com.typesafe.config.ConfigFactory.parseString("metrics{}"), parentPath + "metrics.", $tsCfgValidator); + this.minGzipSizeBytes = c.hasPathOrNull("minGzipSizeBytes") ? c.getInt("minGzipSizeBytes") : 512; + this.name = c.hasPathOrNull("name") ? c.getString("name") : ""; + this.pathConfigs = $_LAgent_PathConfigs$Elm(c.getList("pathConfigs"), parentPath, $tsCfgValidator); + this.proxy = c.hasPathOrNull("proxy") ? new Agent.Proxy(c.getConfig("proxy"), parentPath + "proxy.", $tsCfgValidator) : new Agent.Proxy(com.typesafe.config.ConfigFactory.parseString("proxy{}"), parentPath + "proxy.", $tsCfgValidator); + this.scrapeTimeoutSecs = c.hasPathOrNull("scrapeTimeoutSecs") ? c.getInt("scrapeTimeoutSecs") : 15; + this.tls = c.hasPathOrNull("tls") ? new Agent.Tls(c.getConfig("tls"), parentPath + "tls.", $tsCfgValidator) : new Agent.Tls(com.typesafe.config.ConfigFactory.parseString("tls{}"), parentPath + "tls.", $tsCfgValidator); } - public static class Agent { - public final Agent.Admin admin; - public final int chunkContentSizeKbs; - public final boolean consolidated; - public final Agent.Internal internal; - public final Agent.Metrics metrics; - public final int minGzipSizeBytes; - public final java.lang.String name; - public final java.util.List pathConfigs; - public final Agent.Proxy proxy; - public final int scrapeTimeoutSecs; - public final Agent.Tls tls; - - public Agent(com.typesafe.config.Config c, java.lang.String parentPath, $TsCfgValidator $tsCfgValidator) { - this.admin = c.hasPathOrNull("admin") ? new Agent.Admin(c.getConfig("admin"), parentPath + "admin.", $tsCfgValidator) : new Agent.Admin(com.typesafe.config.ConfigFactory.parseString("admin{}"), parentPath + "admin.", $tsCfgValidator); - this.chunkContentSizeKbs = c.hasPathOrNull("chunkContentSizeKbs") ? c.getInt("chunkContentSizeKbs") : 32; - this.consolidated = c.hasPathOrNull("consolidated") && c.getBoolean("consolidated"); - this.internal = c.hasPathOrNull("internal") ? new Agent.Internal(c.getConfig("internal"), parentPath + "internal.", $tsCfgValidator) : new Agent.Internal(com.typesafe.config.ConfigFactory.parseString("internal{}"), parentPath + "internal.", $tsCfgValidator); - this.metrics = c.hasPathOrNull("metrics") ? new Agent.Metrics(c.getConfig("metrics"), parentPath + "metrics.", $tsCfgValidator) : new Agent.Metrics(com.typesafe.config.ConfigFactory.parseString("metrics{}"), parentPath + "metrics.", $tsCfgValidator); - this.minGzipSizeBytes = c.hasPathOrNull("minGzipSizeBytes") ? c.getInt("minGzipSizeBytes") : 512; - this.name = c.hasPathOrNull("name") ? c.getString("name") : ""; - this.pathConfigs = $_LAgent_PathConfigs$Elm(c.getList("pathConfigs"), parentPath, $tsCfgValidator); - this.proxy = c.hasPathOrNull("proxy") ? new Agent.Proxy(c.getConfig("proxy"), parentPath + "proxy.", $tsCfgValidator) : new Agent.Proxy(com.typesafe.config.ConfigFactory.parseString("proxy{}"), parentPath + "proxy.", $tsCfgValidator); - this.scrapeTimeoutSecs = c.hasPathOrNull("scrapeTimeoutSecs") ? c.getInt("scrapeTimeoutSecs") : 15; - this.tls = c.hasPathOrNull("tls") ? new Agent.Tls(c.getConfig("tls"), parentPath + "tls.", $tsCfgValidator) : new Agent.Tls(com.typesafe.config.ConfigFactory.parseString("tls{}"), parentPath + "tls.", $tsCfgValidator); - } + private static java.util.List $_LAgent_PathConfigs$Elm(com.typesafe.config.ConfigList cl, java.lang.String parentPath, $TsCfgValidator $tsCfgValidator) { + java.util.ArrayList al = new java.util.ArrayList<>(); + for (com.typesafe.config.ConfigValue cv : cl) { + al.add(new Agent.PathConfigs$Elm(((com.typesafe.config.ConfigObject) cv).toConfig(), parentPath, $tsCfgValidator)); + } + return java.util.Collections.unmodifiableList(al); + } - private static java.util.List $_LAgent_PathConfigs$Elm(com.typesafe.config.ConfigList cl, java.lang.String parentPath, $TsCfgValidator $tsCfgValidator) { - java.util.ArrayList al = new java.util.ArrayList<>(); - for (com.typesafe.config.ConfigValue cv : cl) { - al.add(new Agent.PathConfigs$Elm(((com.typesafe.config.ConfigObject) cv).toConfig(), parentPath, $tsCfgValidator)); - } - return java.util.Collections.unmodifiableList(al); - } + public static class Admin { + public final boolean debugEnabled; + public final boolean enabled; + public final java.lang.String healthCheckPath; + public final java.lang.String pingPath; + public final int port; + public final java.lang.String threadDumpPath; + public final java.lang.String versionPath; + + public Admin(com.typesafe.config.Config c, java.lang.String parentPath, $TsCfgValidator $tsCfgValidator) { + this.debugEnabled = c.hasPathOrNull("debugEnabled") && c.getBoolean("debugEnabled"); + this.enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"); + this.healthCheckPath = c.hasPathOrNull("healthCheckPath") ? c.getString("healthCheckPath") : "healthcheck"; + this.pingPath = c.hasPathOrNull("pingPath") ? c.getString("pingPath") : "ping"; + this.port = c.hasPathOrNull("port") ? c.getInt("port") : 8093; + this.threadDumpPath = c.hasPathOrNull("threadDumpPath") ? c.getString("threadDumpPath") : "threaddump"; + this.versionPath = c.hasPathOrNull("versionPath") ? c.getString("versionPath") : "version"; + } + } - public static class Admin { - public final boolean debugEnabled; - public final boolean enabled; - public final java.lang.String healthCheckPath; - public final java.lang.String pingPath; - public final int port; - public final java.lang.String threadDumpPath; - public final java.lang.String versionPath; - - public Admin(com.typesafe.config.Config c, java.lang.String parentPath, $TsCfgValidator $tsCfgValidator) { - this.debugEnabled = c.hasPathOrNull("debugEnabled") && c.getBoolean("debugEnabled"); - this.enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"); - this.healthCheckPath = c.hasPathOrNull("healthCheckPath") ? c.getString("healthCheckPath") : "healthcheck"; - this.pingPath = c.hasPathOrNull("pingPath") ? c.getString("pingPath") : "ping"; - this.port = c.hasPathOrNull("port") ? c.getInt("port") : 8093; - this.threadDumpPath = c.hasPathOrNull("threadDumpPath") ? c.getString("threadDumpPath") : "threaddump"; - this.versionPath = c.hasPathOrNull("versionPath") ? c.getString("versionPath") : "version"; - } + public static class Internal { + public final int cioTimeoutSecs; + public final int heartbeatCheckPauseMillis; + public final boolean heartbeatEnabled; + public final int heartbeatMaxInactivitySecs; + public final int reconnectPauseSecs; + public final int scrapeRequestBacklogUnhealthySize; + public final Internal.Zipkin zipkin; + + public Internal(com.typesafe.config.Config c, java.lang.String parentPath, $TsCfgValidator $tsCfgValidator) { + this.cioTimeoutSecs = c.hasPathOrNull("cioTimeoutSecs") ? c.getInt("cioTimeoutSecs") : 90; + this.heartbeatCheckPauseMillis = c.hasPathOrNull("heartbeatCheckPauseMillis") ? c.getInt("heartbeatCheckPauseMillis") : 500; + this.heartbeatEnabled = !c.hasPathOrNull("heartbeatEnabled") || c.getBoolean("heartbeatEnabled"); + this.heartbeatMaxInactivitySecs = c.hasPathOrNull("heartbeatMaxInactivitySecs") ? c.getInt("heartbeatMaxInactivitySecs") : 5; + this.reconnectPauseSecs = c.hasPathOrNull("reconnectPauseSecs") ? c.getInt("reconnectPauseSecs") : 3; + this.scrapeRequestBacklogUnhealthySize = c.hasPathOrNull("scrapeRequestBacklogUnhealthySize") ? c.getInt("scrapeRequestBacklogUnhealthySize") : 25; + this.zipkin = c.hasPathOrNull("zipkin") ? new Internal.Zipkin(c.getConfig("zipkin"), parentPath + "zipkin.", $tsCfgValidator) : new Internal.Zipkin(com.typesafe.config.ConfigFactory.parseString("zipkin{}"), parentPath + "zipkin.", $tsCfgValidator); + } + + public static class Zipkin { + public final boolean enabled; + public final boolean grpcReportingEnabled; + public final java.lang.String hostname; + public final java.lang.String path; + public final int port; + public final java.lang.String serviceName; + + public Zipkin(com.typesafe.config.Config c, java.lang.String parentPath, $TsCfgValidator $tsCfgValidator) { + this.enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"); + this.grpcReportingEnabled = c.hasPathOrNull("grpcReportingEnabled") && c.getBoolean("grpcReportingEnabled"); + this.hostname = c.hasPathOrNull("hostname") ? c.getString("hostname") : "localhost"; + this.path = c.hasPathOrNull("path") ? c.getString("path") : "api/v2/spans"; + this.port = c.hasPathOrNull("port") ? c.getInt("port") : 9411; + this.serviceName = c.hasPathOrNull("serviceName") ? c.getString("serviceName") : "prometheus-agent"; } + } + } - public static class Internal { - public final int heartbeatCheckPauseMillis; - public final boolean heartbeatEnabled; - public final int heartbeatMaxInactivitySecs; - public final int reconnectPauseSecs; - public final int scrapeRequestBacklogUnhealthySize; - public final Internal.Zipkin zipkin; - - public Internal(com.typesafe.config.Config c, java.lang.String parentPath, $TsCfgValidator $tsCfgValidator) { - this.heartbeatCheckPauseMillis = c.hasPathOrNull("heartbeatCheckPauseMillis") ? c.getInt("heartbeatCheckPauseMillis") : 500; - this.heartbeatEnabled = !c.hasPathOrNull("heartbeatEnabled") || c.getBoolean("heartbeatEnabled"); - this.heartbeatMaxInactivitySecs = c.hasPathOrNull("heartbeatMaxInactivitySecs") ? c.getInt("heartbeatMaxInactivitySecs") : 5; - this.reconnectPauseSecs = c.hasPathOrNull("reconnectPauseSecs") ? c.getInt("reconnectPauseSecs") : 3; - this.scrapeRequestBacklogUnhealthySize = c.hasPathOrNull("scrapeRequestBacklogUnhealthySize") ? c.getInt("scrapeRequestBacklogUnhealthySize") : 25; - this.zipkin = c.hasPathOrNull("zipkin") ? new Internal.Zipkin(c.getConfig("zipkin"), parentPath + "zipkin.", $tsCfgValidator) : new Internal.Zipkin(com.typesafe.config.ConfigFactory.parseString("zipkin{}"), parentPath + "zipkin.", $tsCfgValidator); - } - - public static class Zipkin { - public final boolean enabled; - public final boolean grpcReportingEnabled; - public final java.lang.String hostname; - public final java.lang.String path; - public final int port; - public final java.lang.String serviceName; - - public Zipkin(com.typesafe.config.Config c, java.lang.String parentPath, $TsCfgValidator $tsCfgValidator) { - this.enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"); - this.grpcReportingEnabled = c.hasPathOrNull("grpcReportingEnabled") && c.getBoolean("grpcReportingEnabled"); - this.hostname = c.hasPathOrNull("hostname") ? c.getString("hostname") : "localhost"; - this.path = c.hasPathOrNull("path") ? c.getString("path") : "api/v2/spans"; - this.port = c.hasPathOrNull("port") ? c.getInt("port") : 9411; - this.serviceName = c.hasPathOrNull("serviceName") ? c.getString("serviceName") : "prometheus-agent"; - } - } + public static class Metrics { + public final boolean classLoadingExportsEnabled; + public final boolean enabled; + public final boolean garbageCollectorExportsEnabled; + public final Metrics.Grpc grpc; + public final boolean memoryPoolsExportsEnabled; + public final java.lang.String path; + public final int port; + public final boolean standardExportsEnabled; + public final boolean threadExportsEnabled; + public final boolean versionInfoExportsEnabled; + + public Metrics(com.typesafe.config.Config c, java.lang.String parentPath, $TsCfgValidator $tsCfgValidator) { + this.classLoadingExportsEnabled = c.hasPathOrNull("classLoadingExportsEnabled") && c.getBoolean("classLoadingExportsEnabled"); + this.enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"); + this.garbageCollectorExportsEnabled = c.hasPathOrNull("garbageCollectorExportsEnabled") && c.getBoolean("garbageCollectorExportsEnabled"); + this.grpc = c.hasPathOrNull("grpc") ? new Metrics.Grpc(c.getConfig("grpc"), parentPath + "grpc.", $tsCfgValidator) : new Metrics.Grpc(com.typesafe.config.ConfigFactory.parseString("grpc{}"), parentPath + "grpc.", $tsCfgValidator); + this.memoryPoolsExportsEnabled = c.hasPathOrNull("memoryPoolsExportsEnabled") && c.getBoolean("memoryPoolsExportsEnabled"); + this.path = c.hasPathOrNull("path") ? c.getString("path") : "metrics"; + this.port = c.hasPathOrNull("port") ? c.getInt("port") : 8083; + this.standardExportsEnabled = c.hasPathOrNull("standardExportsEnabled") && c.getBoolean("standardExportsEnabled"); + this.threadExportsEnabled = c.hasPathOrNull("threadExportsEnabled") && c.getBoolean("threadExportsEnabled"); + this.versionInfoExportsEnabled = c.hasPathOrNull("versionInfoExportsEnabled") && c.getBoolean("versionInfoExportsEnabled"); + } + + public static class Grpc { + public final boolean allMetricsReported; + public final boolean metricsEnabled; + + public Grpc(com.typesafe.config.Config c, java.lang.String parentPath, $TsCfgValidator $tsCfgValidator) { + this.allMetricsReported = c.hasPathOrNull("allMetricsReported") && c.getBoolean("allMetricsReported"); + this.metricsEnabled = c.hasPathOrNull("metricsEnabled") && c.getBoolean("metricsEnabled"); } + } + } - public static class Metrics { - public final boolean classLoadingExportsEnabled; - public final boolean enabled; - public final boolean garbageCollectorExportsEnabled; - public final Metrics.Grpc grpc; - public final boolean memoryPoolsExportsEnabled; - public final java.lang.String path; - public final int port; - public final boolean standardExportsEnabled; - public final boolean threadExportsEnabled; - public final boolean versionInfoExportsEnabled; - - public Metrics(com.typesafe.config.Config c, java.lang.String parentPath, $TsCfgValidator $tsCfgValidator) { - this.classLoadingExportsEnabled = c.hasPathOrNull("classLoadingExportsEnabled") && c.getBoolean("classLoadingExportsEnabled"); - this.enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"); - this.garbageCollectorExportsEnabled = c.hasPathOrNull("garbageCollectorExportsEnabled") && c.getBoolean("garbageCollectorExportsEnabled"); - this.grpc = c.hasPathOrNull("grpc") ? new Metrics.Grpc(c.getConfig("grpc"), parentPath + "grpc.", $tsCfgValidator) : new Metrics.Grpc(com.typesafe.config.ConfigFactory.parseString("grpc{}"), parentPath + "grpc.", $tsCfgValidator); - this.memoryPoolsExportsEnabled = c.hasPathOrNull("memoryPoolsExportsEnabled") && c.getBoolean("memoryPoolsExportsEnabled"); - this.path = c.hasPathOrNull("path") ? c.getString("path") : "metrics"; - this.port = c.hasPathOrNull("port") ? c.getInt("port") : 8083; - this.standardExportsEnabled = c.hasPathOrNull("standardExportsEnabled") && c.getBoolean("standardExportsEnabled"); - this.threadExportsEnabled = c.hasPathOrNull("threadExportsEnabled") && c.getBoolean("threadExportsEnabled"); - this.versionInfoExportsEnabled = c.hasPathOrNull("versionInfoExportsEnabled") && c.getBoolean("versionInfoExportsEnabled"); - } - - public static class Grpc { - public final boolean allMetricsReported; - public final boolean metricsEnabled; - - public Grpc(com.typesafe.config.Config c, java.lang.String parentPath, $TsCfgValidator $tsCfgValidator) { - this.allMetricsReported = c.hasPathOrNull("allMetricsReported") && c.getBoolean("allMetricsReported"); - this.metricsEnabled = c.hasPathOrNull("metricsEnabled") && c.getBoolean("metricsEnabled"); - } - } + public static class PathConfigs$Elm { + public final java.lang.String name; + public final java.lang.String path; + public final java.lang.String url; + + public PathConfigs$Elm(com.typesafe.config.Config c, java.lang.String parentPath, $TsCfgValidator $tsCfgValidator) { + this.name = $_reqStr(parentPath, c, "name", $tsCfgValidator); + this.path = $_reqStr(parentPath, c, "path", $tsCfgValidator); + this.url = $_reqStr(parentPath, c, "url", $tsCfgValidator); + } + + private static java.lang.String $_reqStr(java.lang.String parentPath, com.typesafe.config.Config c, java.lang.String path, $TsCfgValidator $tsCfgValidator) { + if (c == null) return null; + try { + return c.getString(path); + } catch (com.typesafe.config.ConfigException e) { + $tsCfgValidator.addBadPath(parentPath + path, e); + return null; } + } - public static class PathConfigs$Elm { - public final java.lang.String name; - public final java.lang.String path; - public final java.lang.String url; - - public PathConfigs$Elm(com.typesafe.config.Config c, java.lang.String parentPath, $TsCfgValidator $tsCfgValidator) { - this.name = $_reqStr(parentPath, c, "name", $tsCfgValidator); - this.path = $_reqStr(parentPath, c, "path", $tsCfgValidator); - this.url = $_reqStr(parentPath, c, "url", $tsCfgValidator); - } - - private static java.lang.String $_reqStr(java.lang.String parentPath, com.typesafe.config.Config c, java.lang.String path, $TsCfgValidator $tsCfgValidator) { - if (c == null) return null; - try { - return c.getString(path); - } catch (com.typesafe.config.ConfigException e) { - $tsCfgValidator.addBadPath(parentPath + path, e); - return null; - } - } - - } + } - public static class Proxy { - public final java.lang.String hostname; - public final int port; + public static class Proxy { + public final java.lang.String hostname; + public final int port; - public Proxy(com.typesafe.config.Config c, java.lang.String parentPath, $TsCfgValidator $tsCfgValidator) { - this.hostname = c.hasPathOrNull("hostname") ? c.getString("hostname") : "localhost"; - this.port = c.hasPathOrNull("port") ? c.getInt("port") : 50051; - } - } + public Proxy(com.typesafe.config.Config c, java.lang.String parentPath, $TsCfgValidator $tsCfgValidator) { + this.hostname = c.hasPathOrNull("hostname") ? c.getString("hostname") : "localhost"; + this.port = c.hasPathOrNull("port") ? c.getInt("port") : 50051; + } + } - public static class Tls { - public final java.lang.String certChainFilePath; - public final java.lang.String overrideAuthority; - public final java.lang.String privateKeyFilePath; - public final java.lang.String trustCertCollectionFilePath; - - public Tls(com.typesafe.config.Config c, java.lang.String parentPath, $TsCfgValidator $tsCfgValidator) { - this.certChainFilePath = c.hasPathOrNull("certChainFilePath") ? c.getString("certChainFilePath") : ""; - this.overrideAuthority = c.hasPathOrNull("overrideAuthority") ? c.getString("overrideAuthority") : ""; - this.privateKeyFilePath = c.hasPathOrNull("privateKeyFilePath") ? c.getString("privateKeyFilePath") : ""; - this.trustCertCollectionFilePath = c.hasPathOrNull("trustCertCollectionFilePath") ? c.getString("trustCertCollectionFilePath") : ""; - } - } + public static class Tls { + public final java.lang.String certChainFilePath; + public final java.lang.String overrideAuthority; + public final java.lang.String privateKeyFilePath; + public final java.lang.String trustCertCollectionFilePath; + + public Tls(com.typesafe.config.Config c, java.lang.String parentPath, $TsCfgValidator $tsCfgValidator) { + this.certChainFilePath = c.hasPathOrNull("certChainFilePath") ? c.getString("certChainFilePath") : ""; + this.overrideAuthority = c.hasPathOrNull("overrideAuthority") ? c.getString("overrideAuthority") : ""; + this.privateKeyFilePath = c.hasPathOrNull("privateKeyFilePath") ? c.getString("privateKeyFilePath") : ""; + this.trustCertCollectionFilePath = c.hasPathOrNull("trustCertCollectionFilePath") ? c.getString("trustCertCollectionFilePath") : ""; + } + } + } + + public static class Proxy2 { + public final Proxy2.Admin2 admin; + public final Proxy2.Agent2 agent; + public final Proxy2.Http http; + public final Proxy2.Internal2 internal; + public final Proxy2.Metrics2 metrics; + public final Proxy2.Tls2 tls; + + public Proxy2(com.typesafe.config.Config c, java.lang.String parentPath, $TsCfgValidator $tsCfgValidator) { + this.admin = c.hasPathOrNull("admin") ? new Proxy2.Admin2(c.getConfig("admin"), parentPath + "admin.", $tsCfgValidator) : new Proxy2.Admin2(com.typesafe.config.ConfigFactory.parseString("admin{}"), parentPath + "admin.", $tsCfgValidator); + this.agent = c.hasPathOrNull("agent") ? new Proxy2.Agent2(c.getConfig("agent"), parentPath + "agent.", $tsCfgValidator) : new Proxy2.Agent2(com.typesafe.config.ConfigFactory.parseString("agent{}"), parentPath + "agent.", $tsCfgValidator); + this.http = c.hasPathOrNull("http") ? new Proxy2.Http(c.getConfig("http"), parentPath + "http.", $tsCfgValidator) : new Proxy2.Http(com.typesafe.config.ConfigFactory.parseString("http{}"), parentPath + "http.", $tsCfgValidator); + this.internal = c.hasPathOrNull("internal") ? new Proxy2.Internal2(c.getConfig("internal"), parentPath + "internal.", $tsCfgValidator) : new Proxy2.Internal2(com.typesafe.config.ConfigFactory.parseString("internal{}"), parentPath + "internal.", $tsCfgValidator); + this.metrics = c.hasPathOrNull("metrics") ? new Proxy2.Metrics2(c.getConfig("metrics"), parentPath + "metrics.", $tsCfgValidator) : new Proxy2.Metrics2(com.typesafe.config.ConfigFactory.parseString("metrics{}"), parentPath + "metrics.", $tsCfgValidator); + this.tls = c.hasPathOrNull("tls") ? new Proxy2.Tls2(c.getConfig("tls"), parentPath + "tls.", $tsCfgValidator) : new Proxy2.Tls2(com.typesafe.config.ConfigFactory.parseString("tls{}"), parentPath + "tls.", $tsCfgValidator); } - public static class Proxy2 { - public final Proxy2.Admin2 admin; - public final Proxy2.Agent2 agent; - public final Proxy2.Http http; - public final Proxy2.Internal2 internal; - public final Proxy2.Metrics2 metrics; - public final Proxy2.Tls2 tls; - - public Proxy2(com.typesafe.config.Config c, java.lang.String parentPath, $TsCfgValidator $tsCfgValidator) { - this.admin = c.hasPathOrNull("admin") ? new Proxy2.Admin2(c.getConfig("admin"), parentPath + "admin.", $tsCfgValidator) : new Proxy2.Admin2(com.typesafe.config.ConfigFactory.parseString("admin{}"), parentPath + "admin.", $tsCfgValidator); - this.agent = c.hasPathOrNull("agent") ? new Proxy2.Agent2(c.getConfig("agent"), parentPath + "agent.", $tsCfgValidator) : new Proxy2.Agent2(com.typesafe.config.ConfigFactory.parseString("agent{}"), parentPath + "agent.", $tsCfgValidator); - this.http = c.hasPathOrNull("http") ? new Proxy2.Http(c.getConfig("http"), parentPath + "http.", $tsCfgValidator) : new Proxy2.Http(com.typesafe.config.ConfigFactory.parseString("http{}"), parentPath + "http.", $tsCfgValidator); - this.internal = c.hasPathOrNull("internal") ? new Proxy2.Internal2(c.getConfig("internal"), parentPath + "internal.", $tsCfgValidator) : new Proxy2.Internal2(com.typesafe.config.ConfigFactory.parseString("internal{}"), parentPath + "internal.", $tsCfgValidator); - this.metrics = c.hasPathOrNull("metrics") ? new Proxy2.Metrics2(c.getConfig("metrics"), parentPath + "metrics.", $tsCfgValidator) : new Proxy2.Metrics2(com.typesafe.config.ConfigFactory.parseString("metrics{}"), parentPath + "metrics.", $tsCfgValidator); - this.tls = c.hasPathOrNull("tls") ? new Proxy2.Tls2(c.getConfig("tls"), parentPath + "tls.", $tsCfgValidator) : new Proxy2.Tls2(com.typesafe.config.ConfigFactory.parseString("tls{}"), parentPath + "tls.", $tsCfgValidator); - } + public static class Admin2 { + public final boolean debugEnabled; + public final boolean enabled; + public final java.lang.String healthCheckPath; + public final java.lang.String pingPath; + public final int port; + public final int recentRequestsQueueSize; + public final java.lang.String threadDumpPath; + public final java.lang.String versionPath; + + public Admin2(com.typesafe.config.Config c, java.lang.String parentPath, $TsCfgValidator $tsCfgValidator) { + this.debugEnabled = c.hasPathOrNull("debugEnabled") && c.getBoolean("debugEnabled"); + this.enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"); + this.healthCheckPath = c.hasPathOrNull("healthCheckPath") ? c.getString("healthCheckPath") : "healthcheck"; + this.pingPath = c.hasPathOrNull("pingPath") ? c.getString("pingPath") : "ping"; + this.port = c.hasPathOrNull("port") ? c.getInt("port") : 8092; + this.recentRequestsQueueSize = c.hasPathOrNull("recentRequestsQueueSize") ? c.getInt("recentRequestsQueueSize") : 50; + this.threadDumpPath = c.hasPathOrNull("threadDumpPath") ? c.getString("threadDumpPath") : "threaddump"; + this.versionPath = c.hasPathOrNull("versionPath") ? c.getString("versionPath") : "version"; + } + } - public static class Admin2 { - public final boolean debugEnabled; - public final boolean enabled; - public final java.lang.String healthCheckPath; - public final java.lang.String pingPath; - public final int port; - public final int recentRequestsQueueSize; - public final java.lang.String threadDumpPath; - public final java.lang.String versionPath; - - public Admin2(com.typesafe.config.Config c, java.lang.String parentPath, $TsCfgValidator $tsCfgValidator) { - this.debugEnabled = c.hasPathOrNull("debugEnabled") && c.getBoolean("debugEnabled"); - this.enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"); - this.healthCheckPath = c.hasPathOrNull("healthCheckPath") ? c.getString("healthCheckPath") : "healthcheck"; - this.pingPath = c.hasPathOrNull("pingPath") ? c.getString("pingPath") : "ping"; - this.port = c.hasPathOrNull("port") ? c.getInt("port") : 8092; - this.recentRequestsQueueSize = c.hasPathOrNull("recentRequestsQueueSize") ? c.getInt("recentRequestsQueueSize") : 50; - this.threadDumpPath = c.hasPathOrNull("threadDumpPath") ? c.getString("threadDumpPath") : "threaddump"; - this.versionPath = c.hasPathOrNull("versionPath") ? c.getString("versionPath") : "version"; - } - } + public static class Agent2 { + public final int port; - public static class Agent2 { - public final int port; + public Agent2(com.typesafe.config.Config c, java.lang.String parentPath, $TsCfgValidator $tsCfgValidator) { + this.port = c.hasPathOrNull("port") ? c.getInt("port") : 50051; + } + } - public Agent2(com.typesafe.config.Config c, java.lang.String parentPath, $TsCfgValidator $tsCfgValidator) { - this.port = c.hasPathOrNull("port") ? c.getInt("port") : 50051; - } - } + public static class Http { + public final int idleTimeoutSecs; + public final int maxThreads; + public final int minThreads; + public final int port; + public final boolean requestLoggingEnabled; + + public Http(com.typesafe.config.Config c, java.lang.String parentPath, $TsCfgValidator $tsCfgValidator) { + this.idleTimeoutSecs = c.hasPathOrNull("idleTimeoutSecs") ? c.getInt("idleTimeoutSecs") : 45; + this.maxThreads = c.hasPathOrNull("maxThreads") ? c.getInt("maxThreads") : -1; + this.minThreads = c.hasPathOrNull("minThreads") ? c.getInt("minThreads") : -1; + this.port = c.hasPathOrNull("port") ? c.getInt("port") : 8080; + this.requestLoggingEnabled = !c.hasPathOrNull("requestLoggingEnabled") || c.getBoolean("requestLoggingEnabled"); + } + } - public static class Http { - public final int idleTimeoutSecs; - public final int maxThreads; - public final int minThreads; - public final int port; - public final boolean requestLoggingEnabled; - - public Http(com.typesafe.config.Config c, java.lang.String parentPath, $TsCfgValidator $tsCfgValidator) { - this.idleTimeoutSecs = c.hasPathOrNull("idleTimeoutSecs") ? c.getInt("idleTimeoutSecs") : 45; - this.maxThreads = c.hasPathOrNull("maxThreads") ? c.getInt("maxThreads") : -1; - this.minThreads = c.hasPathOrNull("minThreads") ? c.getInt("minThreads") : -1; - this.port = c.hasPathOrNull("port") ? c.getInt("port") : 8080; - this.requestLoggingEnabled = !c.hasPathOrNull("requestLoggingEnabled") || c.getBoolean("requestLoggingEnabled"); - } + public static class Internal2 { + public final Internal2.Blitz blitz; + public final int chunkContextMapUnhealthySize; + public final int maxAgentInactivitySecs; + public final int scrapeRequestBacklogUnhealthySize; + public final int scrapeRequestCheckMillis; + public final int scrapeRequestMapUnhealthySize; + public final int scrapeRequestTimeoutSecs; + public final boolean staleAgentCheckEnabled; + public final int staleAgentCheckPauseSecs; + public final Internal2.Zipkin2 zipkin; + + public Internal2(com.typesafe.config.Config c, java.lang.String parentPath, $TsCfgValidator $tsCfgValidator) { + this.blitz = c.hasPathOrNull("blitz") ? new Internal2.Blitz(c.getConfig("blitz"), parentPath + "blitz.", $tsCfgValidator) : new Internal2.Blitz(com.typesafe.config.ConfigFactory.parseString("blitz{}"), parentPath + "blitz.", $tsCfgValidator); + this.chunkContextMapUnhealthySize = c.hasPathOrNull("chunkContextMapUnhealthySize") ? c.getInt("chunkContextMapUnhealthySize") : 25; + this.maxAgentInactivitySecs = c.hasPathOrNull("maxAgentInactivitySecs") ? c.getInt("maxAgentInactivitySecs") : 15; + this.scrapeRequestBacklogUnhealthySize = c.hasPathOrNull("scrapeRequestBacklogUnhealthySize") ? c.getInt("scrapeRequestBacklogUnhealthySize") : 25; + this.scrapeRequestCheckMillis = c.hasPathOrNull("scrapeRequestCheckMillis") ? c.getInt("scrapeRequestCheckMillis") : 500; + this.scrapeRequestMapUnhealthySize = c.hasPathOrNull("scrapeRequestMapUnhealthySize") ? c.getInt("scrapeRequestMapUnhealthySize") : 25; + this.scrapeRequestTimeoutSecs = c.hasPathOrNull("scrapeRequestTimeoutSecs") ? c.getInt("scrapeRequestTimeoutSecs") : 90; + this.staleAgentCheckEnabled = !c.hasPathOrNull("staleAgentCheckEnabled") || c.getBoolean("staleAgentCheckEnabled"); + this.staleAgentCheckPauseSecs = c.hasPathOrNull("staleAgentCheckPauseSecs") ? c.getInt("staleAgentCheckPauseSecs") : 10; + this.zipkin = c.hasPathOrNull("zipkin") ? new Internal2.Zipkin2(c.getConfig("zipkin"), parentPath + "zipkin.", $tsCfgValidator) : new Internal2.Zipkin2(com.typesafe.config.ConfigFactory.parseString("zipkin{}"), parentPath + "zipkin.", $tsCfgValidator); + } + + public static class Blitz { + public final boolean enabled; + public final java.lang.String path; + + public Blitz(com.typesafe.config.Config c, java.lang.String parentPath, $TsCfgValidator $tsCfgValidator) { + this.enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"); + this.path = c.hasPathOrNull("path") ? c.getString("path") : "mu-dd4bffbb-ff2e9926-5a80952c-1c6cb64d.txt"; } - - public static class Internal2 { - public final Internal2.Blitz blitz; - public final int chunkContextMapUnhealthySize; - public final int maxAgentInactivitySecs; - public final int scrapeRequestBacklogUnhealthySize; - public final int scrapeRequestCheckMillis; - public final int scrapeRequestMapUnhealthySize; - public final int scrapeRequestTimeoutSecs; - public final boolean staleAgentCheckEnabled; - public final int staleAgentCheckPauseSecs; - public final Internal2.Zipkin2 zipkin; - - public Internal2(com.typesafe.config.Config c, java.lang.String parentPath, $TsCfgValidator $tsCfgValidator) { - this.blitz = c.hasPathOrNull("blitz") ? new Internal2.Blitz(c.getConfig("blitz"), parentPath + "blitz.", $tsCfgValidator) : new Internal2.Blitz(com.typesafe.config.ConfigFactory.parseString("blitz{}"), parentPath + "blitz.", $tsCfgValidator); - this.chunkContextMapUnhealthySize = c.hasPathOrNull("chunkContextMapUnhealthySize") ? c.getInt("chunkContextMapUnhealthySize") : 25; - this.maxAgentInactivitySecs = c.hasPathOrNull("maxAgentInactivitySecs") ? c.getInt("maxAgentInactivitySecs") : 15; - this.scrapeRequestBacklogUnhealthySize = c.hasPathOrNull("scrapeRequestBacklogUnhealthySize") ? c.getInt("scrapeRequestBacklogUnhealthySize") : 25; - this.scrapeRequestCheckMillis = c.hasPathOrNull("scrapeRequestCheckMillis") ? c.getInt("scrapeRequestCheckMillis") : 500; - this.scrapeRequestMapUnhealthySize = c.hasPathOrNull("scrapeRequestMapUnhealthySize") ? c.getInt("scrapeRequestMapUnhealthySize") : 25; - this.scrapeRequestTimeoutSecs = c.hasPathOrNull("scrapeRequestTimeoutSecs") ? c.getInt("scrapeRequestTimeoutSecs") : 60; - this.staleAgentCheckEnabled = !c.hasPathOrNull("staleAgentCheckEnabled") || c.getBoolean("staleAgentCheckEnabled"); - this.staleAgentCheckPauseSecs = c.hasPathOrNull("staleAgentCheckPauseSecs") ? c.getInt("staleAgentCheckPauseSecs") : 10; - this.zipkin = c.hasPathOrNull("zipkin") ? new Internal2.Zipkin2(c.getConfig("zipkin"), parentPath + "zipkin.", $tsCfgValidator) : new Internal2.Zipkin2(com.typesafe.config.ConfigFactory.parseString("zipkin{}"), parentPath + "zipkin.", $tsCfgValidator); - } - - public static class Blitz { - public final boolean enabled; - public final java.lang.String path; - - public Blitz(com.typesafe.config.Config c, java.lang.String parentPath, $TsCfgValidator $tsCfgValidator) { - this.enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"); - this.path = c.hasPathOrNull("path") ? c.getString("path") : "mu-dd4bffbb-ff2e9926-5a80952c-1c6cb64d.txt"; - } - } - - public static class Zipkin2 { - public final boolean enabled; - public final boolean grpcReportingEnabled; - public final java.lang.String hostname; - public final java.lang.String path; - public final int port; - public final java.lang.String serviceName; - - public Zipkin2(com.typesafe.config.Config c, java.lang.String parentPath, $TsCfgValidator $tsCfgValidator) { - this.enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"); - this.grpcReportingEnabled = c.hasPathOrNull("grpcReportingEnabled") && c.getBoolean("grpcReportingEnabled"); - this.hostname = c.hasPathOrNull("hostname") ? c.getString("hostname") : "localhost"; - this.path = c.hasPathOrNull("path") ? c.getString("path") : "api/v2/spans"; - this.port = c.hasPathOrNull("port") ? c.getInt("port") : 9411; - this.serviceName = c.hasPathOrNull("serviceName") ? c.getString("serviceName") : "prometheus-proxy"; - } - } + } + + public static class Zipkin2 { + public final boolean enabled; + public final boolean grpcReportingEnabled; + public final java.lang.String hostname; + public final java.lang.String path; + public final int port; + public final java.lang.String serviceName; + + public Zipkin2(com.typesafe.config.Config c, java.lang.String parentPath, $TsCfgValidator $tsCfgValidator) { + this.enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"); + this.grpcReportingEnabled = c.hasPathOrNull("grpcReportingEnabled") && c.getBoolean("grpcReportingEnabled"); + this.hostname = c.hasPathOrNull("hostname") ? c.getString("hostname") : "localhost"; + this.path = c.hasPathOrNull("path") ? c.getString("path") : "api/v2/spans"; + this.port = c.hasPathOrNull("port") ? c.getInt("port") : 9411; + this.serviceName = c.hasPathOrNull("serviceName") ? c.getString("serviceName") : "prometheus-proxy"; } + } + } - public static class Metrics2 { - public final boolean classLoadingExportsEnabled; - public final boolean enabled; - public final boolean garbageCollectorExportsEnabled; - public final Metrics2.Grpc2 grpc; - public final boolean memoryPoolsExportsEnabled; - public final java.lang.String path; - public final int port; - public final boolean standardExportsEnabled; - public final boolean threadExportsEnabled; - public final boolean versionInfoExportsEnabled; - - public Metrics2(com.typesafe.config.Config c, java.lang.String parentPath, $TsCfgValidator $tsCfgValidator) { - this.classLoadingExportsEnabled = c.hasPathOrNull("classLoadingExportsEnabled") && c.getBoolean("classLoadingExportsEnabled"); - this.enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"); - this.garbageCollectorExportsEnabled = c.hasPathOrNull("garbageCollectorExportsEnabled") && c.getBoolean("garbageCollectorExportsEnabled"); - this.grpc = c.hasPathOrNull("grpc") ? new Metrics2.Grpc2(c.getConfig("grpc"), parentPath + "grpc.", $tsCfgValidator) : new Metrics2.Grpc2(com.typesafe.config.ConfigFactory.parseString("grpc{}"), parentPath + "grpc.", $tsCfgValidator); - this.memoryPoolsExportsEnabled = c.hasPathOrNull("memoryPoolsExportsEnabled") && c.getBoolean("memoryPoolsExportsEnabled"); - this.path = c.hasPathOrNull("path") ? c.getString("path") : "metrics"; - this.port = c.hasPathOrNull("port") ? c.getInt("port") : 8082; - this.standardExportsEnabled = c.hasPathOrNull("standardExportsEnabled") && c.getBoolean("standardExportsEnabled"); - this.threadExportsEnabled = c.hasPathOrNull("threadExportsEnabled") && c.getBoolean("threadExportsEnabled"); - this.versionInfoExportsEnabled = c.hasPathOrNull("versionInfoExportsEnabled") && c.getBoolean("versionInfoExportsEnabled"); - } - - public static class Grpc2 { - public final boolean allMetricsReported; - public final boolean metricsEnabled; - - public Grpc2(com.typesafe.config.Config c, java.lang.String parentPath, $TsCfgValidator $tsCfgValidator) { - this.allMetricsReported = c.hasPathOrNull("allMetricsReported") && c.getBoolean("allMetricsReported"); - this.metricsEnabled = c.hasPathOrNull("metricsEnabled") && c.getBoolean("metricsEnabled"); - } - } + public static class Metrics2 { + public final boolean classLoadingExportsEnabled; + public final boolean enabled; + public final boolean garbageCollectorExportsEnabled; + public final Metrics2.Grpc2 grpc; + public final boolean memoryPoolsExportsEnabled; + public final java.lang.String path; + public final int port; + public final boolean standardExportsEnabled; + public final boolean threadExportsEnabled; + public final boolean versionInfoExportsEnabled; + + public Metrics2(com.typesafe.config.Config c, java.lang.String parentPath, $TsCfgValidator $tsCfgValidator) { + this.classLoadingExportsEnabled = c.hasPathOrNull("classLoadingExportsEnabled") && c.getBoolean("classLoadingExportsEnabled"); + this.enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"); + this.garbageCollectorExportsEnabled = c.hasPathOrNull("garbageCollectorExportsEnabled") && c.getBoolean("garbageCollectorExportsEnabled"); + this.grpc = c.hasPathOrNull("grpc") ? new Metrics2.Grpc2(c.getConfig("grpc"), parentPath + "grpc.", $tsCfgValidator) : new Metrics2.Grpc2(com.typesafe.config.ConfigFactory.parseString("grpc{}"), parentPath + "grpc.", $tsCfgValidator); + this.memoryPoolsExportsEnabled = c.hasPathOrNull("memoryPoolsExportsEnabled") && c.getBoolean("memoryPoolsExportsEnabled"); + this.path = c.hasPathOrNull("path") ? c.getString("path") : "metrics"; + this.port = c.hasPathOrNull("port") ? c.getInt("port") : 8082; + this.standardExportsEnabled = c.hasPathOrNull("standardExportsEnabled") && c.getBoolean("standardExportsEnabled"); + this.threadExportsEnabled = c.hasPathOrNull("threadExportsEnabled") && c.getBoolean("threadExportsEnabled"); + this.versionInfoExportsEnabled = c.hasPathOrNull("versionInfoExportsEnabled") && c.getBoolean("versionInfoExportsEnabled"); + } + + public static class Grpc2 { + public final boolean allMetricsReported; + public final boolean metricsEnabled; + + public Grpc2(com.typesafe.config.Config c, java.lang.String parentPath, $TsCfgValidator $tsCfgValidator) { + this.allMetricsReported = c.hasPathOrNull("allMetricsReported") && c.getBoolean("allMetricsReported"); + this.metricsEnabled = c.hasPathOrNull("metricsEnabled") && c.getBoolean("metricsEnabled"); } + } + } - public static class Tls2 { - public final java.lang.String certChainFilePath; - public final java.lang.String privateKeyFilePath; - public final java.lang.String trustCertCollectionFilePath; + public static class Tls2 { + public final java.lang.String certChainFilePath; + public final java.lang.String privateKeyFilePath; + public final java.lang.String trustCertCollectionFilePath; - public Tls2(com.typesafe.config.Config c, java.lang.String parentPath, $TsCfgValidator $tsCfgValidator) { - this.certChainFilePath = c.hasPathOrNull("certChainFilePath") ? c.getString("certChainFilePath") : ""; - this.privateKeyFilePath = c.hasPathOrNull("privateKeyFilePath") ? c.getString("privateKeyFilePath") : ""; - this.trustCertCollectionFilePath = c.hasPathOrNull("trustCertCollectionFilePath") ? c.getString("trustCertCollectionFilePath") : ""; - } - } + public Tls2(com.typesafe.config.Config c, java.lang.String parentPath, $TsCfgValidator $tsCfgValidator) { + this.certChainFilePath = c.hasPathOrNull("certChainFilePath") ? c.getString("certChainFilePath") : ""; + this.privateKeyFilePath = c.hasPathOrNull("privateKeyFilePath") ? c.getString("privateKeyFilePath") : ""; + this.trustCertCollectionFilePath = c.hasPathOrNull("trustCertCollectionFilePath") ? c.getString("trustCertCollectionFilePath") : ""; + } } + } - private static final class $TsCfgValidator { - private final java.util.List badPaths = new java.util.ArrayList<>(); + private static final class $TsCfgValidator { + private final java.util.List badPaths = new java.util.ArrayList<>(); - void addBadPath(java.lang.String path, com.typesafe.config.ConfigException e) { - badPaths.add("'" + path + "': " + e.getClass().getName() + "(" + e.getMessage() + ")"); - } + void addBadPath(java.lang.String path, com.typesafe.config.ConfigException e) { + badPaths.add("'" + path + "': " + e.getClass().getName() + "(" + e.getMessage() + ")"); + } - void validate() { - if (!badPaths.isEmpty()) { - java.lang.StringBuilder sb = new java.lang.StringBuilder("Invalid configuration:"); - for (java.lang.String path : badPaths) { - sb.append("\n ").append(path); - } - throw new com.typesafe.config.ConfigException(sb.toString()) { - }; - } + void validate() { + if (!badPaths.isEmpty()) { + java.lang.StringBuilder sb = new java.lang.StringBuilder("Invalid configuration:"); + for (java.lang.String path : badPaths) { + sb.append("\n ").append(path); } + throw new com.typesafe.config.ConfigException(sb.toString()) { + }; + } } + } } diff --git a/src/main/kotlin/io/prometheus/Agent.kt b/src/main/kotlin/io/prometheus/Agent.kt index ecf077cb..182a7ac0 100644 --- a/src/main/kotlin/io/prometheus/Agent.kt +++ b/src/main/kotlin/io/prometheus/Agent.kt @@ -50,7 +50,7 @@ import kotlin.time.TimeSource.Monotonic import kotlin.time.milliseconds import kotlin.time.seconds -@Version(version = "1.8.4", date = "9/3/20") +@Version(version = "1.8.5", date = "9/3/20") class Agent(val options: AgentOptions, inProcessServerName: String = "", testMode: Boolean = false, diff --git a/src/main/kotlin/io/prometheus/Proxy.kt b/src/main/kotlin/io/prometheus/Proxy.kt index fb349146..0b4845ec 100644 --- a/src/main/kotlin/io/prometheus/Proxy.kt +++ b/src/main/kotlin/io/prometheus/Proxy.kt @@ -45,7 +45,7 @@ import java.time.LocalDateTime import java.time.format.DateTimeFormatter import kotlin.time.milliseconds -@Version(version = "1.8.4", date = "9/3/20") +@Version(version = "1.8.5", date = "9/3/20") class Proxy(val options: ProxyOptions, proxyHttpPort: Int = options.proxyHttpPort, inProcessServerName: String = "", diff --git a/src/main/kotlin/io/prometheus/agent/AgentHttpService.kt b/src/main/kotlin/io/prometheus/agent/AgentHttpService.kt index 0ef91c45..c4a2abe3 100644 --- a/src/main/kotlin/io/prometheus/agent/AgentHttpService.kt +++ b/src/main/kotlin/io/prometheus/agent/AgentHttpService.kt @@ -71,7 +71,8 @@ internal class AgentHttpService(val agent: Agent) { // Content is fetched here try { - CIO.create { requestTimeout = 90.seconds.toLongMilliseconds() } + val timeout = agent.configVals.agent.internal.cioTimeoutSecs.seconds + CIO.create { requestTimeout = timeout.toLongMilliseconds() } .use { engine -> HttpClient(engine) { install(HttpTimeout) } .use { client -> diff --git a/src/main/kotlin/io/prometheus/agent/AgentOptions.kt b/src/main/kotlin/io/prometheus/agent/AgentOptions.kt index e069ed23..d95ccf24 100644 --- a/src/main/kotlin/io/prometheus/agent/AgentOptions.kt +++ b/src/main/kotlin/io/prometheus/agent/AgentOptions.kt @@ -117,6 +117,9 @@ class AgentOptions(argv: Array, exitOnMissingConfig: Boolean) : assignCertChainFilePath(agentConfigVals.tls.certChainFilePath) assignPrivateKeyFilePath(agentConfigVals.tls.privateKeyFilePath) assignTrustCertCollectionFilePath(agentConfigVals.tls.trustCertCollectionFilePath) + + logger.info { "agent.internal.cioTimeoutSecs: ${agentConfigVals.internal.cioTimeoutSecs.seconds}" } + logger.info { "agent.scrapeTimeoutSecs: ${agentConfigVals.scrapeTimeoutSecs.seconds}" } } } diff --git a/src/main/kotlin/io/prometheus/agent/AgentPathManager.kt b/src/main/kotlin/io/prometheus/agent/AgentPathManager.kt index 3f914c7c..150c42d3 100644 --- a/src/main/kotlin/io/prometheus/agent/AgentPathManager.kt +++ b/src/main/kotlin/io/prometheus/agent/AgentPathManager.kt @@ -45,12 +45,12 @@ internal class AgentPathManager(private val agent: Agent) { URL to it.url ) } - .onEach { logger.info { "Proxy path /${it["path"]} will be assigned to ${it["url"]}" } } + .onEach { logger.info { "Proxy path /${it[PATH]} will be assigned to ${it[URL]}" } } suspend fun registerPaths() = pathConfigs.forEach { - val path = it["path"] - val url = it["url"] + val path = it[PATH] + val url = it[URL] if (path.isNotNull() && url.isNotNull()) registerPath(path, url) else diff --git a/src/main/kotlin/io/prometheus/proxy/ProxyOptions.kt b/src/main/kotlin/io/prometheus/proxy/ProxyOptions.kt index 930d8a9f..6b9b604d 100644 --- a/src/main/kotlin/io/prometheus/proxy/ProxyOptions.kt +++ b/src/main/kotlin/io/prometheus/proxy/ProxyOptions.kt @@ -23,6 +23,7 @@ import com.google.common.collect.Iterables import io.prometheus.Proxy import io.prometheus.common.BaseOptions import io.prometheus.common.EnvVars.* +import kotlin.time.seconds class ProxyOptions(argv: Array) : BaseOptions(Proxy::class.java.simpleName, argv, PROXY_CONFIG.name) { @@ -61,6 +62,8 @@ class ProxyOptions(argv: Array) : BaseOptions(Proxy::class.java.simpleNa assignCertChainFilePath(proxyConfigVals.tls.certChainFilePath) assignPrivateKeyFilePath(proxyConfigVals.tls.privateKeyFilePath) assignTrustCertCollectionFilePath(proxyConfigVals.tls.trustCertCollectionFilePath) + + logger.info { "proxy.internal.scrapeRequestTimeoutSecs: ${proxyConfigVals.internal.scrapeRequestTimeoutSecs.seconds}" } } } } \ No newline at end of file