Skip to content

Commit

Permalink
1.22.0 (#100)
Browse files Browse the repository at this point in the history
* Update Copyright date
* Fix version typo
* Fix detekt complaints
* Misc refactoring
* Update jars
* Update logging and kotlin jars
  • Loading branch information
pambrose authored Jun 11, 2024
1 parent 98f6235 commit a7a57ca
Show file tree
Hide file tree
Showing 69 changed files with 1,458 additions and 488 deletions.
1 change: 1 addition & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ indent_style = tab
indent_size = 4

[*.{kt,kts}]
indent_size = 2
ktlint_standard_no-wildcard-imports = disabled
ktlint_standard_multiline-if-else = disabled
ktlint_standard_string-template-indent = disabled
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
.gradle/
.kotlin/
.idea/
.wercker/
target/
build/
out/
.run/
*.iml
*.iml
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION=1.21.0
VERSION=1.22.0

default: versioncheck

Expand Down Expand Up @@ -71,4 +71,4 @@ refresh:
./gradlew --refresh-dependencies

upgrade-wrapper:
./gradlew wrapper --gradle-version=8.5 --distribution-type=bin
./gradlew wrapper --gradle-version=8.8 --distribution-type=bin
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ scrape_configs:
The docker images are available via:
```bash
docker pull pambrose/prometheus-proxy:1.21.0
docker pull pambrose/prometheus-agent:1.21.0
docker pull pambrose/prometheus-proxy:1.22.0
docker pull pambrose/prometheus-agent:1.22.0
```

Start a proxy container with:
Expand All @@ -123,15 +123,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.21.0
pambrose/prometheus-proxy:1.22.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.21.0
pambrose/prometheus-agent:1.22.0
```

Using the config
Expand All @@ -149,7 +149,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.21.0
pambrose/prometheus-agent:1.22.0
```

**Note:** The `WORKDIR` of the proxy and agent images is `/app`, so make sure to use `/app` as the base directory in the
Expand Down Expand Up @@ -297,15 +297,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.21.0
pambrose/prometheus-proxy:1.22.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.21.0
pambrose/prometheus-agent:1.22.0
```

**Note:** The `WORKDIR` of the proxy and agent images is `/app`, so make sure to use `/app` as the base directory in the
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.21.0
pambrose/prometheus-agent:1.22.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.21.0
pambrose/prometheus-proxy:1.22.0
156 changes: 89 additions & 67 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,31 @@ plugins {
id 'idea'
id 'java'
id 'maven-publish'
id 'org.jetbrains.kotlin.jvm' version '1.9.22'
id 'org.jetbrains.kotlin.jvm' version '2.0.0'
id 'com.google.protobuf' version '0.9.4' // Keep in sync with grpc
id 'org.jmailen.kotlinter' version "4.1.1"
id "com.github.ben-manes.versions" version '0.50.0'
id 'org.jmailen.kotlinter' version "4.3.0"
id "com.github.ben-manes.versions" version '0.51.0'
id 'com.github.johnrengelman.shadow' version '8.1.1'
id 'com.github.gmazzo.buildconfig' version '5.3.2'
id 'org.jetbrains.kotlinx.kover' version '0.7.5'
id 'com.github.gmazzo.buildconfig' version '5.3.5'
id 'org.jetbrains.kotlinx.kover' version '0.8.1'
id 'io.gitlab.arturbosch.detekt' version '1.23.6'
// Turn these off until jacoco fixes their kotlin 1.5.0 SMAP issue
// id 'jacoco'
// id 'com.github.kt3k.coveralls' version '2.12.0'
}

group = 'io.prometheus'
version = '1.21.0'
version = '1.22.0'

sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
//sourceCompatibility = JavaVersion.VERSION_17
//targetCompatibility = JavaVersion.VERSION_17

buildConfig {
packageName("io.prometheus")

buildConfigField('String', 'APP_NAME', "\"${project.name}\"")
buildConfigField('String', 'APP_VERSION', "\"${project.version}\"")
buildConfigField('String', 'APP_RELEASE_DATE', "\"12/11/2023\"")
buildConfigField('String', 'APP_RELEASE_DATE', "\"06/11/2024\"")
}

repositories {
Expand All @@ -44,6 +45,9 @@ dependencies {
implementation "io.grpc:grpc-stub:$grpc_version"
implementation "io.grpc:grpc-services:$grpc_version"

implementation("com.google.protobuf:protobuf-java:$protobuf_version")
implementation("com.google.protobuf:protobuf-java-util:$protobuf_version")

implementation "io.grpc:grpc-kotlin-stub:$gengrpc_version"

implementation "io.github.mscheong01:krotoDC-core:$krotodc_version"
Expand All @@ -65,7 +69,7 @@ dependencies {
implementation "org.eclipse.jetty:jetty-servlet:$jetty_version"

implementation "javax.annotation:javax.annotation-api:$annotation_version"
implementation "com.beust:jcommander:$jcommander_version"
implementation "org.jcommander:jcommander:$jcommander_version"
implementation "com.typesafe:config:$typesafe_version"

implementation "io.prometheus:simpleclient:$prometheus_version"
Expand All @@ -85,7 +89,7 @@ dependencies {

implementation "io.zipkin.brave:brave-instrumentation-grpc:$zipkin_version"

implementation "io.github.microutils:kotlin-logging:$logging_version"
implementation "io.github.oshai:kotlin-logging-jvm:$logging_version"
implementation "ch.qos.logback:logback-classic:$logback_version"
implementation "org.slf4j:jul-to-slf4j:$slf4j_version"

Expand Down Expand Up @@ -174,6 +178,22 @@ java {
withSourcesJar()
}

detekt {
buildUponDefaultConfig = true // preconfigure defaults
allRules = false // activate all available (even unstable) rules.
config.setFrom("$projectDir/config/detekt/detekt.yml")
// point to your custom config defining rules to run, overwriting default behavior
baseline = file("$projectDir/config/detekt/baseline.xml") // a way of suppressing issues before introducing detekt
}


//tasks.withType(Detekt).configureEach {
// jvmTarget = "1.8"
//}
//tasks.withType(DetektCreateBaselineTask).configureEach {
// jvmTarget = "1.8"
//}


//jacocoTestReport {
// reports {
Expand Down Expand Up @@ -263,61 +283,63 @@ kotlinter {
reporters = ['checkstyle', 'plain']
}

koverMerged {
enable() // create Kover merged reports

filters { // common filters for all default Kover merged tasks
classes { // common class filter for all default Kover merged tasks
includes.add("io.prometheus.*") // class inclusion rules
//excludes.addAll("io.prometheus.subpackage.*") // class exclusion rules
}

projects { // common projects filter for all default Kover merged tasks
//excludes.addAll("project1", ":child:project") // Specifies the projects excluded in the merged tasks
}
}


xmlReport {
onCheck.set(true)
// true to run koverMergedXmlReport task during the execution of the check task (if it exists) of the current project
reportFile.set(layout.buildDirectory.file("my-merged-report/result.xml")) // change report file name
overrideClassFilter { // override common class filter
includes.add("io.prometheus.*") // override class inclusion rules
//excludes.addAll("io.prometheus.subpackage.*") // override class exclusion rules
}
}

htmlReport {
onCheck.set(true)
// true to run koverMergedHtmlReport task during the execution of the check task (if it exists) of the current project
reportDir.set(layout.buildDirectory.dir("my-merged-report/html-result")) // change report directory
overrideClassFilter { // override common class filter
includes.add("io.prometheus.*") // override class inclusion rules
//excludes.addAll("io.prometheus.subpackage.*") // override class exclusion rules
}
}

verify {
onCheck.set(true)
// true to run koverMergedVerify task during the execution of the check task (if it exists) of the current project
rule { // add verification rule
//isEnabled = true // false to disable rule checking
name = null // custom name for the rule
target = 'ALL' // specify by which entity the code for separate coverage evaluation will be grouped

overrideClassFilter { // override common class filter
includes.add("io.prometheus.verify.*") // override class inclusion rules
// excludes.addAll("io.prometheus.verify.subpackage.*") // override class exclusion rules
}

bound { // add rule bound
minValue = 10
maxValue = 20
counter = 'LINE' // change coverage metric to evaluate (LINE, INSTRUCTION, BRANCH)
valueType = 'COVERED_PERCENTAGE'
// change counter value (COVERED_COUNT, MISSED_COUNT, COVERED_PERCENTAGE, MISSED_PERCENTAGE)
}
}
kover {
reports {
// enable() // create Kover merged reports
//
// filters { // common filters for all default Kover merged tasks
// classes { // common class filter for all default Kover merged tasks
// includes.add("io.prometheus.*") // class inclusion rules
// //excludes.addAll("io.prometheus.subpackage.*") // class exclusion rules
// }
//
// projects { // common projects filter for all default Kover merged tasks
// //excludes.addAll("project1", ":child:project") // Specifies the projects excluded in the merged tasks
// }
// }
//
//
// xmlReport {
// onCheck.set(true)
// // true to run koverMergedXmlReport task during the execution of the check task (if it exists) of the current project
// reportFile.set(layout.buildDirectory.file("my-merged-report/result.xml")) // change report file name
// overrideClassFilter { // override common class filter
// includes.add("io.prometheus.*") // override class inclusion rules
// //excludes.addAll("io.prometheus.subpackage.*") // override class exclusion rules
// }
// }
//
// htmlReport {
// onCheck.set(true)
// // true to run koverMergedHtmlReport task during the execution of the check task (if it exists) of the current project
// reportDir.set(layout.buildDirectory.dir("my-merged-report/html-result")) // change report directory
// overrideClassFilter { // override common class filter
// includes.add("io.prometheus.*") // override class inclusion rules
// //excludes.addAll("io.prometheus.subpackage.*") // override class exclusion rules
// }
// }

// verify {
// // onCheck.set(true)
// // true to run koverMergedVerify task during the execution of the check task (if it exists) of the current project
// rule { // add verification rule
// //isEnabled = true // false to disable rule checking
// name = null // custom name for the rule
// target = 'ALL' // specify by which entity the code for separate coverage evaluation will be grouped
//
// overrideClassFilter { // override common class filter
// includes.add("io.prometheus.verify.*") // override class inclusion rules
// // excludes.addAll("io.prometheus.verify.subpackage.*") // override class exclusion rules
// }
//
// bound { // add rule bound
// minValue = 10
// maxValue = 20
// counter = 'LINE' // change coverage metric to evaluate (LINE, INSTRUCTION, BRANCH)
// valueType = 'COVERED_PERCENTAGE'
// // change counter value (COVERED_COUNT, MISSED_COUNT, COVERED_PERCENTAGE, MISSED_PERCENTAGE)
// }
// }
// }
}
}
Loading

0 comments on commit a7a57ca

Please sign in to comment.