diff --git a/Makefile b/Makefile index 02b74946..41d05d04 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -VERSION=1.15.0 +VERSION=1.16.0 default: versioncheck @@ -27,7 +27,8 @@ config: distro: clean compile jars -PLATFORMS := linux/amd64,linux/arm64/v8,linux/s390x,linux/ppc64le +#PLATFORMS := linux/amd64,linux/arm64/v8,linux/s390x,linux/ppc64le +PLATFORMS := linux/amd64,linux/arm64/v8,linux/s390x IMAGE_PREFIX := pambrose/prometheus docker-push: @@ -67,4 +68,4 @@ refresh: ./gradlew --refresh-dependencies upgrade-wrapper: - ./gradlew wrapper --gradle-version=7.6 --distribution-type=bin \ No newline at end of file + ./gradlew wrapper --gradle-version=8.0.2 --distribution-type=bin \ No newline at end of file diff --git a/README.md b/README.md index aa2d0b50..1f72195d 100644 --- a/README.md +++ b/README.md @@ -112,8 +112,8 @@ scrape_configs: The docker images are available via: ```bash -docker pull pambrose/prometheus-proxy:1.15.0 -docker pull pambrose/prometheus-agent:1.15.0 +docker pull pambrose/prometheus-proxy:1.16.0 +docker pull pambrose/prometheus-agent:1.16.0 ``` Start a proxy container with: @@ -122,7 +122,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.15.0 + pambrose/prometheus-proxy:1.16.0 ``` Start an agent container with: @@ -130,7 +130,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.15.0 + pambrose/prometheus-agent:1.16.0 ``` Using the config @@ -148,7 +148,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.15.0 + pambrose/prometheus-agent:1.16.0 ``` **Note:** The `WORKDIR` of the proxy and agent images is `/app`, so make sure to use `/app` as the base directory in the @@ -296,7 +296,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.15.0 + pambrose/prometheus-proxy:1.16.0 docker run --rm -p 8083:8083 -p 8093:8093 \ --mount type=bind,source="$(pwd)"/testing/certs,target=/app/testing/certs \ @@ -304,7 +304,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.15.0 + pambrose/prometheus-agent:1.16.0 ``` **Note:** The `WORKDIR` of the proxy and agent images is `/app`, so make sure to use `/app` as the base directory in the diff --git a/bin/docker-agent.sh b/bin/docker-agent.sh index 8ddf411e..a790c9a0 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.15.0 + pambrose/prometheus-agent:1.16.0 diff --git a/bin/docker-proxy.sh b/bin/docker-proxy.sh index adf302de..19fc6489 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.15.0 + pambrose/prometheus-proxy:1.16.0 diff --git a/build.gradle b/build.gradle index d4f49203..91cdde72 100644 --- a/build.gradle +++ b/build.gradle @@ -2,11 +2,11 @@ plugins { id 'idea' id 'java' id 'maven-publish' - id 'org.jetbrains.kotlin.jvm' version '1.7.21' + id 'org.jetbrains.kotlin.jvm' version '1.8.20' id 'com.google.protobuf' version '0.8.18' // Keep in sync with grpc - id 'org.jmailen.kotlinter' version "3.12.0" - id "com.github.ben-manes.versions" version '0.44.0' - id 'com.github.johnrengelman.shadow' version '7.1.2' + id 'org.jmailen.kotlinter' version "3.13.0" + id "com.github.ben-manes.versions" version '0.46.0' + id 'com.github.johnrengelman.shadow' version '8.1.1' id 'com.github.gmazzo.buildconfig' version '3.1.0' id 'org.jetbrains.kotlinx.kover' version '0.6.1' // Turn these off until jacoco fixes their kotlin 1.5.0 SMAP issue @@ -15,7 +15,7 @@ plugins { } group = 'io.prometheus' -version = '1.15.0' +version = '1.16.0' sourceCompatibility = 11 targetCompatibility = 11 @@ -25,7 +25,7 @@ buildConfig { buildConfigField('String', 'APP_NAME', "\"${project.name}\"") buildConfigField('String', 'APP_VERSION', "\"${project.version}\"") - buildConfigField('String', 'APP_RELEASE_DATE', "\"12/14/22\"") + buildConfigField('String', 'APP_RELEASE_DATE', "\"04/11/2023\"") } repositories { @@ -144,15 +144,15 @@ configurations.all { //startScripts.enabled = false task sourcesJar(type: Jar, dependsOn: classes) { - classifier = 'sources' from sourceSets.main.allSource + archiveClassifier = 'sources' } // This is to fix a bizarre gradle error related to duplicate Agent.toString() methods project.getTasks().getByName("jar").setProperty("duplicatesStrategy", DuplicatesStrategy.INCLUDE); task javadocJar(type: Jar, dependsOn: javadoc) { - classifier = 'javadoc' + archiveClassifier = 'javadoc' from javadoc.destinationDir } diff --git a/etc/compose/proxy.yml b/etc/compose/proxy.yml index c2204069..64f8fa60 100644 --- a/etc/compose/proxy.yml +++ b/etc/compose/proxy.yml @@ -1,6 +1,6 @@ prometheus-proxy: autoredeploy: true - image: 'pambrose/prometheus-proxy:1.15.0' + image: 'pambrose/prometheus-proxy:1.16.0' ports: - '8080:8080' - '8082:8082' diff --git a/gradle.properties b/gradle.properties index 0c5efe9d..aeb67a94 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,24 +6,24 @@ org.gradle.parallel=true org.gradle.caching=true org.gradle.jvmargs=-Xmx2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 annotation_version=1.3.2 -dropwizard_version=4.2.13 +dropwizard_version=4.2.18 gengrpc_version=1.3.0 -grpc_version=1.51.1 +grpc_version=1.54.0 jcommander_version=1.82 -jetty_version=10.0.13 -junit_version=5.9.1 +jetty_version=10.0.14 +junit_version=5.9.2 kluent_version=1.72 -kotlin_version=1.7.21 -ktor_version=2.2.1 -logback_version=1.4.5 -logging_version=3.0.4 +kotlin_version=1.8.20 +ktor_version=2.2.4 +logback_version=1.4.6 +logging_version=4.0.0-beta-2 # Keep in sync with grpc -tcnative_version=2.0.54.Final +tcnative_version=2.0.59.Final prometheus_version=0.16.0 # Keep in sync with grpc protoc_version=3.21.7 -serialization_version=1.4.1 -slf4j_version=2.0.6 +serialization_version=1.5.0 +slf4j_version=2.0.7 typesafe_version=1.4.2 -utils_version=1.32.0 -zipkin_version=5.14.1 \ No newline at end of file +utils_version=1.35.0 +zipkin_version=5.15.0 \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 249e5832..943f0cbf 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 070cb702..bdc9a83b 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip +networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index a69d9cb6..65dcd68d 100755 --- a/gradlew +++ b/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -80,10 +80,10 @@ do esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' @@ -143,12 +143,16 @@ fi if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac case $MAX_FD in #( '' | soft) :;; #( *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac diff --git a/gradlew.bat b/gradlew.bat index f127cfd4..93e3f59f 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -26,6 +26,7 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% diff --git a/src/main/java/io/prometheus/common/ConfigVals.java b/src/main/java/io/prometheus/common/ConfigVals.java index be536256..d803d384 100644 --- a/src/main/java/io/prometheus/common/ConfigVals.java +++ b/src/main/java/io/prometheus/common/ConfigVals.java @@ -1,3 +1,19 @@ +/* + * Copyright © 2023 Paul Ambrose (pambrose@mac.com) + * + * Licensed 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. + */ + // generated by tscfg 0.9.997 on Mon Nov 28 23:31:57 PST 2022 // source: etc/config/config.conf @@ -6,6 +22,7 @@ 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 = ""; @@ -29,6 +46,7 @@ public static class Agent { public final int scrapeTimeoutSecs; public final Agent.Tls tls; public final boolean transportFilterDisabled; + 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; @@ -90,6 +108,7 @@ public static class Internal { 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; @@ -130,6 +149,7 @@ public static class Metrics { public final boolean standardExportsEnabled; public final boolean threadExportsEnabled; public final boolean versionInfoExportsEnabled; + public static class Grpc { public final boolean allMetricsReported; public final boolean metricsEnabled; @@ -164,6 +184,7 @@ public static class PathConfigs$Elm { 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 { @@ -210,6 +231,7 @@ public static class Proxy2 { public final Proxy2.Service service; public final Proxy2.Tls2 tls; public final boolean transportFilterDisabled; + 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); @@ -278,6 +300,7 @@ public static class Internal2 { 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; @@ -331,6 +354,7 @@ public static class Metrics2 { public final boolean standardExportsEnabled; public final boolean threadExportsEnabled; public final boolean versionInfoExportsEnabled; + public static class Grpc2 { public final boolean allMetricsReported; public final boolean metricsEnabled; @@ -357,6 +381,7 @@ public Metrics2(com.typesafe.config.Config c, java.lang.String parentPath, $TsCf public static class Service { public final Service.Discovery discovery; + public Service(com.typesafe.config.Config c, java.lang.String parentPath, $TsCfgValidator $tsCfgValidator) { this.discovery = c.hasPathOrNull("discovery") ? new Service.Discovery(c.getConfig("discovery"), parentPath + "discovery.", $tsCfgValidator) : new Service.Discovery(com.typesafe.config.ConfigFactory.parseString("discovery{}"), parentPath + "discovery.", $tsCfgValidator); } diff --git a/src/main/kotlin/io/prometheus/Agent.kt b/src/main/kotlin/io/prometheus/Agent.kt index 0527a1de..4b048201 100644 --- a/src/main/kotlin/io/prometheus/Agent.kt +++ b/src/main/kotlin/io/prometheus/Agent.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2020 Paul Ambrose (pambrose@mac.com) + * Copyright © 2023 Paul Ambrose (pambrose@mac.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -54,7 +54,7 @@ import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.coroutineScope import kotlinx.coroutines.launch import kotlinx.coroutines.runBlocking -import mu.KLogging +import mu.two.KLogging import java.util.concurrent.CountDownLatch import java.util.concurrent.TimeUnit.MILLISECONDS import java.util.concurrent.atomic.AtomicInteger diff --git a/src/main/kotlin/io/prometheus/Proxy.kt b/src/main/kotlin/io/prometheus/Proxy.kt index a2d1a876..ca66660c 100644 --- a/src/main/kotlin/io/prometheus/Proxy.kt +++ b/src/main/kotlin/io/prometheus/Proxy.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2020 Paul Ambrose (pambrose@mac.com) + * Copyright © 2023 Paul Ambrose (pambrose@mac.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -47,7 +47,7 @@ import io.prometheus.proxy.ProxyOptions import io.prometheus.proxy.ProxyPathManager import io.prometheus.proxy.ScrapeRequestManager import kotlinx.coroutines.runBlocking -import mu.KLogging +import mu.two.KLogging import java.time.LocalDateTime import java.time.format.DateTimeFormatter import kotlin.time.Duration.Companion.milliseconds diff --git a/src/main/kotlin/io/prometheus/agent/AgentClientInterceptor.kt b/src/main/kotlin/io/prometheus/agent/AgentClientInterceptor.kt index 47edfce9..b972e45a 100644 --- a/src/main/kotlin/io/prometheus/agent/AgentClientInterceptor.kt +++ b/src/main/kotlin/io/prometheus/agent/AgentClientInterceptor.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2020 Paul Ambrose (pambrose@mac.com) + * Copyright © 2023 Paul Ambrose (pambrose@mac.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,7 +29,7 @@ import io.grpc.MethodDescriptor import io.prometheus.Agent import io.prometheus.common.GrpcObjects.EMPTY_AGENT_ID_MSG import io.prometheus.proxy.ProxyServerInterceptor.Companion.META_AGENT_ID_KEY -import mu.KLogging +import mu.two.KLogging internal class AgentClientInterceptor(private val agent: Agent) : ClientInterceptor { diff --git a/src/main/kotlin/io/prometheus/agent/AgentConnectionContext.kt b/src/main/kotlin/io/prometheus/agent/AgentConnectionContext.kt index 6905fd51..d194cbe9 100644 --- a/src/main/kotlin/io/prometheus/agent/AgentConnectionContext.kt +++ b/src/main/kotlin/io/prometheus/agent/AgentConnectionContext.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2020 Paul Ambrose (pambrose@mac.com) + * Copyright © 2023 Paul Ambrose (pambrose@mac.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,7 +19,7 @@ package io.prometheus.agent import com.github.pambrose.common.delegate.AtomicDelegates.atomicBoolean -import io.ktor.utils.io.core.Closeable +import io.ktor.utils.io.core.* import io.prometheus.common.ScrapeRequestAction import io.prometheus.common.ScrapeResults import kotlinx.coroutines.channels.Channel diff --git a/src/main/kotlin/io/prometheus/agent/AgentGrpcService.kt b/src/main/kotlin/io/prometheus/agent/AgentGrpcService.kt index 34df0d51..73d78528 100644 --- a/src/main/kotlin/io/prometheus/agent/AgentGrpcService.kt +++ b/src/main/kotlin/io/prometheus/agent/AgentGrpcService.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2020 Paul Ambrose (pambrose@mac.com) + * Copyright © 2023 Paul Ambrose (pambrose@mac.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -53,7 +53,7 @@ import kotlinx.coroutines.coroutineScope import kotlinx.coroutines.flow.consumeAsFlow import kotlinx.coroutines.launch import kotlinx.coroutines.runBlocking -import mu.KLogging +import mu.two.KLogging import java.io.ByteArrayInputStream import java.util.concurrent.CountDownLatch import java.util.zip.CRC32 diff --git a/src/main/kotlin/io/prometheus/agent/AgentHttpService.kt b/src/main/kotlin/io/prometheus/agent/AgentHttpService.kt index 9eaa8a30..4be907c5 100644 --- a/src/main/kotlin/io/prometheus/agent/AgentHttpService.kt +++ b/src/main/kotlin/io/prometheus/agent/AgentHttpService.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2020 Paul Ambrose (pambrose@mac.com) + * Copyright © 2023 Paul Ambrose (pambrose@mac.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,7 +38,7 @@ import io.prometheus.Agent import io.prometheus.common.ScrapeResults import io.prometheus.grpc.ScrapeRequest import kotlinx.coroutines.TimeoutCancellationException -import mu.KLogging +import mu.two.KLogging import java.io.IOException import java.net.URLDecoder import java.net.http.HttpConnectTimeoutException diff --git a/src/main/kotlin/io/prometheus/agent/AgentMetrics.kt b/src/main/kotlin/io/prometheus/agent/AgentMetrics.kt index 9507072e..0d9e22fc 100644 --- a/src/main/kotlin/io/prometheus/agent/AgentMetrics.kt +++ b/src/main/kotlin/io/prometheus/agent/AgentMetrics.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2020 Paul Ambrose (pambrose@mac.com) + * Copyright © 2023 Paul Ambrose (pambrose@mac.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/kotlin/io/prometheus/agent/AgentOptions.kt b/src/main/kotlin/io/prometheus/agent/AgentOptions.kt index bcce54f8..fe599e94 100644 --- a/src/main/kotlin/io/prometheus/agent/AgentOptions.kt +++ b/src/main/kotlin/io/prometheus/agent/AgentOptions.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2020 Paul Ambrose (pambrose@mac.com) + * Copyright © 2023 Paul Ambrose (pambrose@mac.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,7 +22,7 @@ import com.beust.jcommander.Parameter import io.prometheus.Agent import io.prometheus.common.BaseOptions import io.prometheus.common.EnvVars.* -import mu.KLogging +import mu.two.KLogging import kotlin.time.Duration.Companion.seconds class AgentOptions(argv: Array, exitOnMissingConfig: Boolean) : diff --git a/src/main/kotlin/io/prometheus/agent/AgentPathManager.kt b/src/main/kotlin/io/prometheus/agent/AgentPathManager.kt index f2a6cb35..49268a67 100644 --- a/src/main/kotlin/io/prometheus/agent/AgentPathManager.kt +++ b/src/main/kotlin/io/prometheus/agent/AgentPathManager.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2020 Paul Ambrose (pambrose@mac.com) + * Copyright © 2023 Paul Ambrose (pambrose@mac.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,7 +23,7 @@ import com.github.pambrose.common.util.isNull import com.google.common.collect.Maps.newConcurrentMap import io.prometheus.Agent import io.prometheus.common.GrpcObjects.EMPTY_PATH_MSG -import mu.KLogging +import mu.two.KLogging internal class AgentPathManager(private val agent: Agent) { diff --git a/src/main/kotlin/io/prometheus/agent/EmbeddedAgentInfo.kt b/src/main/kotlin/io/prometheus/agent/EmbeddedAgentInfo.kt index b2d26f4e..cbf11401 100644 --- a/src/main/kotlin/io/prometheus/agent/EmbeddedAgentInfo.kt +++ b/src/main/kotlin/io/prometheus/agent/EmbeddedAgentInfo.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2020 Paul Ambrose (pambrose@mac.com) + * Copyright © 2023 Paul Ambrose (pambrose@mac.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/kotlin/io/prometheus/agent/RequestFailureException.kt b/src/main/kotlin/io/prometheus/agent/RequestFailureException.kt index 39032f9a..4e540856 100644 --- a/src/main/kotlin/io/prometheus/agent/RequestFailureException.kt +++ b/src/main/kotlin/io/prometheus/agent/RequestFailureException.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2020 Paul Ambrose (pambrose@mac.com) + * Copyright © 2023 Paul Ambrose (pambrose@mac.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/kotlin/io/prometheus/agent/SslSettings.kt b/src/main/kotlin/io/prometheus/agent/SslSettings.kt index 380f5448..ca0d5257 100644 --- a/src/main/kotlin/io/prometheus/agent/SslSettings.kt +++ b/src/main/kotlin/io/prometheus/agent/SslSettings.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2022 Paul Ambrose (pambrose@mac.com) + * Copyright © 2023 Paul Ambrose (pambrose@mac.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/kotlin/io/prometheus/agent/TrustAllX509TrustManager.kt b/src/main/kotlin/io/prometheus/agent/TrustAllX509TrustManager.kt index dd7d3587..a9ee0bd1 100644 --- a/src/main/kotlin/io/prometheus/agent/TrustAllX509TrustManager.kt +++ b/src/main/kotlin/io/prometheus/agent/TrustAllX509TrustManager.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2022 Paul Ambrose (pambrose@mac.com) + * Copyright © 2023 Paul Ambrose (pambrose@mac.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/kotlin/io/prometheus/common/BaseOptions.kt b/src/main/kotlin/io/prometheus/common/BaseOptions.kt index 88b54f89..7cdc69f8 100644 --- a/src/main/kotlin/io/prometheus/common/BaseOptions.kt +++ b/src/main/kotlin/io/prometheus/common/BaseOptions.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2020 Paul Ambrose (pambrose@mac.com) + * Copyright © 2023 Paul Ambrose (pambrose@mac.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,7 +29,7 @@ import com.typesafe.config.ConfigParseOptions import com.typesafe.config.ConfigResolveOptions import com.typesafe.config.ConfigSyntax import io.prometheus.common.EnvVars.* -import mu.KLogging +import mu.two.KLogging import java.io.File import java.io.FileNotFoundException import java.net.URL diff --git a/src/main/kotlin/io/prometheus/common/ConfigWrappers.kt b/src/main/kotlin/io/prometheus/common/ConfigWrappers.kt index c6d5d75d..803ed3c9 100644 --- a/src/main/kotlin/io/prometheus/common/ConfigWrappers.kt +++ b/src/main/kotlin/io/prometheus/common/ConfigWrappers.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2020 Paul Ambrose (pambrose@mac.com) + * Copyright © 2023 Paul Ambrose (pambrose@mac.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/kotlin/io/prometheus/common/EnvVars.kt b/src/main/kotlin/io/prometheus/common/EnvVars.kt index 25985acb..10e52aa3 100644 --- a/src/main/kotlin/io/prometheus/common/EnvVars.kt +++ b/src/main/kotlin/io/prometheus/common/EnvVars.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2020 Paul Ambrose (pambrose@mac.com) + * Copyright © 2023 Paul Ambrose (pambrose@mac.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/kotlin/io/prometheus/common/GrpcObjects.kt b/src/main/kotlin/io/prometheus/common/GrpcObjects.kt index d8840e93..319f0b4f 100644 --- a/src/main/kotlin/io/prometheus/common/GrpcObjects.kt +++ b/src/main/kotlin/io/prometheus/common/GrpcObjects.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2020 Paul Ambrose (pambrose@mac.com) + * Copyright © 2023 Paul Ambrose (pambrose@mac.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/kotlin/io/prometheus/common/ScrapeResults.kt b/src/main/kotlin/io/prometheus/common/ScrapeResults.kt index 9097c287..b2ebefcb 100644 --- a/src/main/kotlin/io/prometheus/common/ScrapeResults.kt +++ b/src/main/kotlin/io/prometheus/common/ScrapeResults.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2020 Paul Ambrose (pambrose@mac.com) + * Copyright © 2023 Paul Ambrose (pambrose@mac.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/kotlin/io/prometheus/common/TypeAliases.kt b/src/main/kotlin/io/prometheus/common/TypeAliases.kt index bb36aacb..8e40938d 100644 --- a/src/main/kotlin/io/prometheus/common/TypeAliases.kt +++ b/src/main/kotlin/io/prometheus/common/TypeAliases.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2020 Paul Ambrose (pambrose@mac.com) + * Copyright © 2023 Paul Ambrose (pambrose@mac.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/kotlin/io/prometheus/common/Utils.kt b/src/main/kotlin/io/prometheus/common/Utils.kt index 57549b76..62ede801 100644 --- a/src/main/kotlin/io/prometheus/common/Utils.kt +++ b/src/main/kotlin/io/prometheus/common/Utils.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2020 Paul Ambrose (pambrose@mac.com) + * Copyright © 2023 Paul Ambrose (pambrose@mac.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/kotlin/io/prometheus/proxy/AgentContext.kt b/src/main/kotlin/io/prometheus/proxy/AgentContext.kt index 00f5d9ef..852ab48e 100644 --- a/src/main/kotlin/io/prometheus/proxy/AgentContext.kt +++ b/src/main/kotlin/io/prometheus/proxy/AgentContext.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2020 Paul Ambrose (pambrose@mac.com) + * Copyright © 2023 Paul Ambrose (pambrose@mac.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/kotlin/io/prometheus/proxy/AgentContextCleanupService.kt b/src/main/kotlin/io/prometheus/proxy/AgentContextCleanupService.kt index 04a502cd..1d86bd49 100644 --- a/src/main/kotlin/io/prometheus/proxy/AgentContextCleanupService.kt +++ b/src/main/kotlin/io/prometheus/proxy/AgentContextCleanupService.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2020 Paul Ambrose (pambrose@mac.com) + * Copyright © 2023 Paul Ambrose (pambrose@mac.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,7 +25,7 @@ import com.github.pambrose.common.util.sleep import com.google.common.util.concurrent.MoreExecutors import io.prometheus.Proxy import io.prometheus.common.ConfigVals -import mu.KLogging +import mu.two.KLogging import kotlin.time.Duration.Companion.seconds internal class AgentContextCleanupService( diff --git a/src/main/kotlin/io/prometheus/proxy/AgentContextManager.kt b/src/main/kotlin/io/prometheus/proxy/AgentContextManager.kt index 0dca4050..55fe23fa 100644 --- a/src/main/kotlin/io/prometheus/proxy/AgentContextManager.kt +++ b/src/main/kotlin/io/prometheus/proxy/AgentContextManager.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2020 Paul Ambrose (pambrose@mac.com) + * Copyright © 2023 Paul Ambrose (pambrose@mac.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +20,7 @@ package io.prometheus.proxy import com.github.pambrose.common.util.isNull import com.google.common.collect.Maps.newConcurrentMap -import mu.KLogging +import mu.two.KLogging import java.util.concurrent.ConcurrentMap internal class AgentContextManager(private val isTestMode: Boolean) { diff --git a/src/main/kotlin/io/prometheus/proxy/ChunkedContext.kt b/src/main/kotlin/io/prometheus/proxy/ChunkedContext.kt index ff34579b..2463d58b 100644 --- a/src/main/kotlin/io/prometheus/proxy/ChunkedContext.kt +++ b/src/main/kotlin/io/prometheus/proxy/ChunkedContext.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2020 Paul Ambrose (pambrose@mac.com) + * Copyright © 2023 Paul Ambrose (pambrose@mac.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/kotlin/io/prometheus/proxy/ProxyGrpcService.kt b/src/main/kotlin/io/prometheus/proxy/ProxyGrpcService.kt index 438b2b7a..734dd635 100644 --- a/src/main/kotlin/io/prometheus/proxy/ProxyGrpcService.kt +++ b/src/main/kotlin/io/prometheus/proxy/ProxyGrpcService.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2020 Paul Ambrose (pambrose@mac.com) + * Copyright © 2023 Paul Ambrose (pambrose@mac.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,7 +34,7 @@ import io.grpc.Server import io.grpc.ServerInterceptor import io.grpc.ServerInterceptors import io.prometheus.Proxy -import mu.KLogging +import mu.two.KLogging import kotlin.time.Duration.Companion.seconds internal class ProxyGrpcService( diff --git a/src/main/kotlin/io/prometheus/proxy/ProxyHttpConfig.kt b/src/main/kotlin/io/prometheus/proxy/ProxyHttpConfig.kt index 83960f8c..61ca5bf3 100644 --- a/src/main/kotlin/io/prometheus/proxy/ProxyHttpConfig.kt +++ b/src/main/kotlin/io/prometheus/proxy/ProxyHttpConfig.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2020 Paul Ambrose (pambrose@mac.com) + * Copyright © 2023 Paul Ambrose (pambrose@mac.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,7 +45,7 @@ import kotlinx.serialization.json.addJsonObject import kotlinx.serialization.json.buildJsonArray import kotlinx.serialization.json.putJsonArray import kotlinx.serialization.json.putJsonObject -import mu.KLogging +import mu.two.KLogging import org.slf4j.event.Level import kotlin.time.Duration import kotlin.time.Duration.Companion.milliseconds diff --git a/src/main/kotlin/io/prometheus/proxy/ProxyHttpService.kt b/src/main/kotlin/io/prometheus/proxy/ProxyHttpService.kt index b3abb9e9..34e6538f 100644 --- a/src/main/kotlin/io/prometheus/proxy/ProxyHttpService.kt +++ b/src/main/kotlin/io/prometheus/proxy/ProxyHttpService.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2020 Paul Ambrose (pambrose@mac.com) + * Copyright © 2023 Paul Ambrose (pambrose@mac.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,7 +28,7 @@ import io.ktor.server.cio.CIOApplicationEngine.* import io.ktor.server.engine.* import io.prometheus.Proxy import io.prometheus.proxy.ProxyHttpConfig.configServer -import mu.KLogging +import mu.two.KLogging import kotlin.time.Duration.Companion.seconds import kotlin.time.DurationUnit.SECONDS diff --git a/src/main/kotlin/io/prometheus/proxy/ProxyMetrics.kt b/src/main/kotlin/io/prometheus/proxy/ProxyMetrics.kt index 1622c1f6..04bdb3ae 100644 --- a/src/main/kotlin/io/prometheus/proxy/ProxyMetrics.kt +++ b/src/main/kotlin/io/prometheus/proxy/ProxyMetrics.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2020 Paul Ambrose (pambrose@mac.com) + * Copyright © 2023 Paul Ambrose (pambrose@mac.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/kotlin/io/prometheus/proxy/ProxyOptions.kt b/src/main/kotlin/io/prometheus/proxy/ProxyOptions.kt index 9e8f9d5b..b99a2a32 100644 --- a/src/main/kotlin/io/prometheus/proxy/ProxyOptions.kt +++ b/src/main/kotlin/io/prometheus/proxy/ProxyOptions.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2020 Paul Ambrose (pambrose@mac.com) + * Copyright © 2023 Paul Ambrose (pambrose@mac.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/kotlin/io/prometheus/proxy/ProxyPathManager.kt b/src/main/kotlin/io/prometheus/proxy/ProxyPathManager.kt index 4d389d93..01c548f8 100644 --- a/src/main/kotlin/io/prometheus/proxy/ProxyPathManager.kt +++ b/src/main/kotlin/io/prometheus/proxy/ProxyPathManager.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2020 Paul Ambrose (pambrose@mac.com) + * Copyright © 2023 Paul Ambrose (pambrose@mac.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,7 +26,7 @@ import io.prometheus.common.GrpcObjects.EMPTY_AGENT_ID_MSG import io.prometheus.common.GrpcObjects.EMPTY_PATH_MSG import io.prometheus.common.GrpcObjects.unregisterPathResponse import io.prometheus.grpc.UnregisterPathResponse -import mu.KLogging +import mu.two.KLogging internal class ProxyPathManager(private val proxy: Proxy, private val isTestMode: Boolean) { diff --git a/src/main/kotlin/io/prometheus/proxy/ProxyServerInterceptor.kt b/src/main/kotlin/io/prometheus/proxy/ProxyServerInterceptor.kt index ea0c7614..0ae80dea 100644 --- a/src/main/kotlin/io/prometheus/proxy/ProxyServerInterceptor.kt +++ b/src/main/kotlin/io/prometheus/proxy/ProxyServerInterceptor.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2020 Paul Ambrose (pambrose@mac.com) + * Copyright © 2023 Paul Ambrose (pambrose@mac.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/kotlin/io/prometheus/proxy/ProxyServerTransportFilter.kt b/src/main/kotlin/io/prometheus/proxy/ProxyServerTransportFilter.kt index 210ea18f..8faac6f3 100644 --- a/src/main/kotlin/io/prometheus/proxy/ProxyServerTransportFilter.kt +++ b/src/main/kotlin/io/prometheus/proxy/ProxyServerTransportFilter.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2020 Paul Ambrose (pambrose@mac.com) + * Copyright © 2023 Paul Ambrose (pambrose@mac.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,7 +24,7 @@ import io.grpc.Attributes import io.grpc.ServerTransportFilter import io.prometheus.Proxy import io.prometheus.proxy.ProxyServiceImpl.Companion.UNKNOWN_ADDRESS -import mu.KLogging +import mu.two.KLogging internal class ProxyServerTransportFilter(private val proxy: Proxy) : ServerTransportFilter() { diff --git a/src/main/kotlin/io/prometheus/proxy/ProxyServiceImpl.kt b/src/main/kotlin/io/prometheus/proxy/ProxyServiceImpl.kt index 9c4f6671..a66c7591 100644 --- a/src/main/kotlin/io/prometheus/proxy/ProxyServiceImpl.kt +++ b/src/main/kotlin/io/prometheus/proxy/ProxyServiceImpl.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2020 Paul Ambrose (pambrose@mac.com) + * Copyright © 2023 Paul Ambrose (pambrose@mac.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -48,7 +48,7 @@ import io.prometheus.grpc.UnregisterPathRequest import io.prometheus.grpc.UnregisterPathResponse import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.flow -import mu.KLogging +import mu.two.KLogging import java.util.* import java.util.concurrent.CancellationException import java.util.concurrent.atomic.AtomicLong diff --git a/src/main/kotlin/io/prometheus/proxy/ScrapeRequestManager.kt b/src/main/kotlin/io/prometheus/proxy/ScrapeRequestManager.kt index ab8ce31c..16ec3938 100644 --- a/src/main/kotlin/io/prometheus/proxy/ScrapeRequestManager.kt +++ b/src/main/kotlin/io/prometheus/proxy/ScrapeRequestManager.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2020 Paul Ambrose (pambrose@mac.com) + * Copyright © 2023 Paul Ambrose (pambrose@mac.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +20,7 @@ package io.prometheus.proxy import com.google.common.collect.Maps.newConcurrentMap import io.prometheus.common.ScrapeResults -import mu.KLogging +import mu.two.KLogging import java.util.concurrent.ConcurrentMap internal class ScrapeRequestManager { diff --git a/src/main/kotlin/io/prometheus/proxy/ScrapeRequestWrapper.kt b/src/main/kotlin/io/prometheus/proxy/ScrapeRequestWrapper.kt index 84cf4b57..ef88e7be 100644 --- a/src/main/kotlin/io/prometheus/proxy/ScrapeRequestWrapper.kt +++ b/src/main/kotlin/io/prometheus/proxy/ScrapeRequestWrapper.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2020 Paul Ambrose (pambrose@mac.com) + * Copyright © 2023 Paul Ambrose (pambrose@mac.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/resources/logback.xml b/src/main/resources/logback.xml index 15e2009b..c1928a4e 100644 --- a/src/main/resources/logback.xml +++ b/src/main/resources/logback.xml @@ -1,5 +1,5 @@