Skip to content

Commit

Permalink
1.8.0
Browse files Browse the repository at this point in the history
* Update to kotlin 1.4.0
* Upgrade to ktor 1.4.0
* Add support for scrapeTimeout val
  • Loading branch information
pambrose authored Aug 28, 2020
1 parent a1e8d04 commit fed6876
Show file tree
Hide file tree
Showing 46 changed files with 578 additions and 468 deletions.
9 changes: 6 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION=1.7.1
VERSION=1.8.0

default: compile

Expand Down Expand Up @@ -53,11 +53,14 @@ site:
tree:
./gradlew -q dependencies

depends:
./gradlew dependencies

versioncheck:
./gradlew dependencyUpdates

refresh:
./gradlew --refresh-dependencies

depends:
./gradlew dependencies
upgrade-wrapper:
./gradlew wrapper --gradle-version=6.6.1 --distribution-type=bin
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ scrape_configs:
The docker images are available via:
```bash
docker pull pambrose/prometheus-proxy:1.7.1
docker pull pambrose/prometheus-agent:1.7.1
docker pull pambrose/prometheus-proxy:1.8.0
docker pull pambrose/prometheus-agent:1.8.0
```

Start a proxy container with:
Expand All @@ -107,15 +107,15 @@ 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.7.1
pambrose/prometheus-proxy:1.8.0
```

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.7.1
pambrose/prometheus-agent:1.8.0
```

Using the config file [simple.conf](https://raw.githubusercontent.com/pambrose/prometheus-proxy/master/examples/simple.conf),
Expand All @@ -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.7.1
pambrose/prometheus-agent:1.8.0
```

**Note:** The `WORKDIR` of the proxy and agent images is `/app`, so make sure
Expand Down Expand Up @@ -182,8 +182,9 @@ The only required argument is an agent config value, which should have an `agent
| --metrics, -e | METRICS_ENABLED <br> agent.metrics.enabled | false | Enable agent metrics |
| --metrics_port, -m | METRICS_PORT <br> agent.metrics.port | 8083 | Agent metrics listen port |
| --consolidated, -o | CONSOLIDATED <br> agent.consolidated | false | Enable multiple agents per registered path |
| --timeout | REQUEST_TIMEOUT_SECS <br> agent.requestTimeoutSecs | 15 | Scrape request timeout time (seconds) |
| --chunk | CHUNK_CONTENT_SIZE_KBS <br> agent.chunkContentSizeKbs | 32 | Threshold for chunking data to Proxy and buffer size (KBs) |
| --gzip | MIN_GZIP_SIZE_BYTES <br> agent.minGzipSizeBytes | 1024 | Minimum size for content to be gzipped (Bytes) |
| --gzip | MIN_GZIP_SIZE_BYTES <br> agent.minGzipSizeBytes | 1024 | Minimum size for content to be gzipped (bytes) |
| --cert, -t | CERT_CHAIN_FILE_PATH <br> agent.tls.certChainFilePath | | Certificate chain file path |
| --key, -k | PRIVATE_KEY_FILE_PATH <br> agent.tls.privateKeyFilePath | | Private key file path |
| --trust, -s | TRUST_CERT_COLLECTION_FILE_PATH <br> agent.tls.trustCertCollectionFilePath | | Trust certificate collection file path |
Expand Down Expand Up @@ -251,15 +252,15 @@ 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.7.1
pambrose/prometheus-proxy:1.8.0

docker run --rm -p 8083:8083 -p 8093:8093 \
--mount type=bind,source="$(pwd)"/testing/certs,target=/app/testing/certs \
--mount type=bind,source="$(pwd)"/examples/tls-no-mutual-auth.conf,target=/app/tls-no-mutual-auth.conf \
--env AGENT_CONFIG=tls-no-mutual-auth.conf \
--env PROXY_HOSTNAME=mymachine.lan:50440 \
--name docker-agent \
pambrose/prometheus-agent:1.7.1
pambrose/prometheus-agent:1.8.0
```

**Note:** The `WORKDIR` of the proxy and agent images is `/app`, so make sure
Expand Down
2 changes: 1 addition & 1 deletion bin/docker-agent.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.7.1
pambrose/prometheus-agent:1.8.0
2 changes: 1 addition & 1 deletion bin/docker-proxy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.7.1
pambrose/prometheus-proxy:1.8.0
22 changes: 8 additions & 14 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
plugins {
id 'idea'
id 'java'
id 'org.jetbrains.kotlin.jvm' version '1.3.72'
id 'org.jetbrains.kotlin.plugin.serialization' version '1.3.72'
id 'org.jetbrains.kotlin.jvm' version '1.4.0'
id 'org.jetbrains.kotlin.plugin.serialization' version '1.4.0'
id 'com.google.protobuf' version '0.8.12'
id "com.github.ben-manes.versions" version '0.29.0'
id 'com.github.johnrengelman.shadow' version '6.0.0'
Expand All @@ -11,14 +11,15 @@ plugins {
}

group = 'io.prometheus'
version = '1.7.1'
version = '1.8.0'

sourceCompatibility = 1.8
targetCompatibility = 1.8

repositories {
maven { url = "https://kotlin.bintray.com/kotlinx" }
maven { url = 'https://maven-central.storage-download.googleapis.com/repos/central/data/' }
maven { url 'https://kotlin.bintray.com/ktor' }
maven { url 'https://kotlin.bintray.com/kotlinx' }
maven { url 'https://maven-central.storage-download.googleapis.com/repos/central/data/' }
jcenter()
maven { url = 'https://jitpack.io' }
}
Expand All @@ -27,10 +28,7 @@ dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
implementation "org.jetbrains.kotlin:kotlin-reflect"

implementation "org.jetbrains.kotlinx:kotlinx-serialization-runtime:$serialization_version"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:$coroutines_version"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-slf4j:$coroutines_version"

//implementation "io.grpc:grpc-netty-shaded:${grpc_version}"
implementation "io.grpc:grpc-netty:${grpc_version}"
Expand Down Expand Up @@ -116,25 +114,21 @@ compileKotlin {
kotlinOptions {
jvmTarget = "1.8"
freeCompilerArgs += ['-Xuse-experimental=kotlin.time.ExperimentalTime',
'-Xuse-experimental=kotlinx.serialization.UnstableDefault',
'-Xuse-experimental=kotlin.ExperimentalUnsignedTypes',
'-Xuse-experimental=kotlinx.coroutines.ExperimentalCoroutinesApi',
'-Xuse-experimental=kotlinx.coroutines.InternalCoroutinesApi',
'-Xuse-experimental=io.ktor.util.KtorExperimentalAPI',
'-Xuse-experimental=kotlinx.serialization.UnstableDefault']
'-Xuse-experimental=io.ktor.util.KtorExperimentalAPI']
}
}

compileTestKotlin {
kotlinOptions {
jvmTarget = "1.8"
freeCompilerArgs += ['-Xuse-experimental=kotlin.time.ExperimentalTime',
'-Xuse-experimental=kotlinx.serialization.UnstableDefault',
'-Xuse-experimental=kotlin.ExperimentalUnsignedTypes',
'-Xuse-experimental=kotlinx.coroutines.ExperimentalCoroutinesApi',
'-Xuse-experimental=kotlinx.coroutines.InternalCoroutinesApi',
'-Xuse-experimental=io.ktor.util.KtorExperimentalAPI',
'-Xuse-experimental=kotlinx.serialization.UnstableDefault']
'-Xuse-experimental=io.ktor.util.KtorExperimentalAPI']
}
}

Expand Down
2 changes: 1 addition & 1 deletion docs/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

3) Modify code

4) Update the release date in *package-info.java*
4) Update the release date in Agent.kt and Proxy.kt

5) Verify tests run cleanly before merge with: `make tests`

Expand Down
2 changes: 1 addition & 1 deletion etc/compose/proxy.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
prometheus-proxy:
autoredeploy: true
image: 'pambrose/prometheus-proxy:1.7.1'
image: 'pambrose/prometheus-proxy:1.8.0'
ports:
- '8080:8080'
- '8082:8082'
Expand Down
11 changes: 7 additions & 4 deletions etc/config/config.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ proxy {
maxThreads = -1
minThreads = -1
idleTimeoutSecs = 45
requestLoggingEnabled = true // Log every proxy metrics request
}

admin {
Expand Down Expand Up @@ -47,11 +48,11 @@ proxy {

internal {
staleAgentCheckEnabled = true
maxAgentInactivitySecs = 15 // Seconds of inactivity before agent is evicted
staleAgentCheckPauseSecs = 10 // Pause interval for agent cleanup
maxAgentInactivitySecs = 15 // Seconds of inactivity before agent is evicted in seconds
staleAgentCheckPauseSecs = 10 // Pause interval for agent cleanup in seconds

scrapeRequestTimeoutSecs = 5 // Timeout for scrape requests
scrapeRequestCheckMillis = 500 // Pause time between checks for scrape request timeout
scrapeRequestTimeoutSecs = 60 // 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

Expand Down Expand Up @@ -82,6 +83,8 @@ agent {
chunkContentSizeKbs = 32 // Threshold for chunking data to Proxy and buffer size
minGzipSizeBytes = 512 // Minimum size for content to be gzipped

scrapeTimeoutSecs = 15 // Scrape timeout in seconds

proxy {
hostname = "localhost" // Proxy hostname
port = 50051 // Proxy port
Expand Down
2 changes: 2 additions & 0 deletions examples/simple.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ proxy {

admin.enabled: true
metrics.enabled: true

http.requestLoggingEnabled: true
}

agent {
Expand Down
21 changes: 10 additions & 11 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,20 @@ org.gradle.parallel=true
org.gradle.caching=true
org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
annotation_version=1.3.2
coroutines_version=1.3.6
dropwizard_version=4.1.11
gengrpc_version=0.1.4
grpc_version=1.31.0
coroutines_version=1.3.9
dropwizard_version=4.1.12.1
gengrpc_version=0.1.5
grpc_version=1.31.1
jcommander_version=1.78
jetty_version=9.4.22.v20191022
jetty_version=9.4.24.v20191120
junit_version=5.6.1
kluent_version=1.61
ktor_version=1.3.2
ktor_version=1.4.0
logback_version=1.2.3
logging_version=1.8.3
prometheus_version=0.9.0
protoc_version=3.12.3
serialization_version=0.20.0-1.3.70-eap-274-2
slf4j_version=1.7.28
protoc_version=3.12.4
slf4j_version=1.7.30
typesafe_version=1.4.0
utils_version=1.1.20
zipkin_version=5.12.4
utils_version=1.3.0
zipkin_version=5.12.5
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 1 addition & 1 deletion gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ fi
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`

JAVACMD=`cygpath --unix "$JAVACMD"`

# We build the pattern for arguments to be converted via cygpath
Expand Down
21 changes: 3 additions & 18 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
if "%ERRORLEVEL%" == "0" goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Expand All @@ -54,7 +54,7 @@ goto fail
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto init
if exist "%JAVA_EXE%" goto execute

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
Expand All @@ -64,29 +64,14 @@ echo location of your Java installation.

goto fail

:init
@rem Get command-line arguments, handling Windows variants

if not "%OS%" == "Windows_NT" goto win9xME_args

:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2

:win9xME_args_slurp
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*

:execute
@rem Setup the command line

set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar


@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*

:end
@rem End local scope for the variables with windows NT shell
Expand Down
Loading

0 comments on commit fed6876

Please sign in to comment.