Skip to content

Commit a7a57ca

Browse files
authored
1.22.0 (#100)
* Update Copyright date * Fix version typo * Fix detekt complaints * Misc refactoring * Update jars * Update logging and kotlin jars
1 parent 98f6235 commit a7a57ca

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+1458
-488
lines changed

.editorconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ indent_style = tab
1717
indent_size = 4
1818

1919
[*.{kt,kts}]
20+
indent_size = 2
2021
ktlint_standard_no-wildcard-imports = disabled
2122
ktlint_standard_multiline-if-else = disabled
2223
ktlint_standard_string-template-indent = disabled

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
.gradle/
2+
.kotlin/
23
.idea/
34
.wercker/
45
target/
56
build/
67
out/
78
.run/
8-
*.iml
9+
*.iml

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VERSION=1.21.0
1+
VERSION=1.22.0
22

33
default: versioncheck
44

@@ -71,4 +71,4 @@ refresh:
7171
./gradlew --refresh-dependencies
7272

7373
upgrade-wrapper:
74-
./gradlew wrapper --gradle-version=8.5 --distribution-type=bin
74+
./gradlew wrapper --gradle-version=8.8 --distribution-type=bin

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ scrape_configs:
113113
The docker images are available via:
114114
115115
```bash
116-
docker pull pambrose/prometheus-proxy:1.21.0
117-
docker pull pambrose/prometheus-agent:1.21.0
116+
docker pull pambrose/prometheus-proxy:1.22.0
117+
docker pull pambrose/prometheus-agent:1.22.0
118118
```
119119

120120
Start a proxy container with:
@@ -123,15 +123,15 @@ Start a proxy container with:
123123
docker run --rm -p 8082:8082 -p 8092:8092 -p 50051:50051 -p 8080:8080 \
124124
--env ADMIN_ENABLED=true \
125125
--env METRICS_ENABLED=true \
126-
pambrose/prometheus-proxy:1.21.0
126+
pambrose/prometheus-proxy:1.22.0
127127
```
128128

129129
Start an agent container with:
130130

131131
```bash
132132
docker run --rm -p 8083:8083 -p 8093:8093 \
133133
--env AGENT_CONFIG='https://raw.githubusercontent.com/pambrose/prometheus-proxy/master/examples/simple.conf' \
134-
pambrose/prometheus-agent:1.21.0
134+
pambrose/prometheus-agent:1.22.0
135135
```
136136

137137
Using the config
@@ -149,7 +149,7 @@ is in your current directory, run an agent container with:
149149
docker run --rm -p 8083:8083 -p 8093:8093 \
150150
--mount type=bind,source="$(pwd)"/prom-agent.conf,target=/app/prom-agent.conf \
151151
--env AGENT_CONFIG=prom-agent.conf \
152-
pambrose/prometheus-agent:1.21.0
152+
pambrose/prometheus-agent:1.22.0
153153
```
154154

155155
**Note:** The `WORKDIR` of the proxy and agent images is `/app`, so make sure to use `/app` as the base directory in the
@@ -297,15 +297,15 @@ docker run --rm -p 8082:8082 -p 8092:8092 -p 50440:50440 -p 8080:8080 \
297297
--env PROXY_CONFIG=tls-no-mutual-auth.conf \
298298
--env ADMIN_ENABLED=true \
299299
--env METRICS_ENABLED=true \
300-
pambrose/prometheus-proxy:1.21.0
300+
pambrose/prometheus-proxy:1.22.0
301301

302302
docker run --rm -p 8083:8083 -p 8093:8093 \
303303
--mount type=bind,source="$(pwd)"/testing/certs,target=/app/testing/certs \
304304
--mount type=bind,source="$(pwd)"/examples/tls-no-mutual-auth.conf,target=/app/tls-no-mutual-auth.conf \
305305
--env AGENT_CONFIG=tls-no-mutual-auth.conf \
306306
--env PROXY_HOSTNAME=mymachine.lan:50440 \
307307
--name docker-agent \
308-
pambrose/prometheus-agent:1.21.0
308+
pambrose/prometheus-agent:1.22.0
309309
```
310310

311311
**Note:** The `WORKDIR` of the proxy and agent images is `/app`, so make sure to use `/app` as the base directory in the

bin/docker-agent.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
docker run --rm -p 8083:8083 -p 8093:8093 \
44
--env AGENT_CONFIG='https://raw.githubusercontent.com/pambrose/prometheus-proxy/master/examples/simple.conf' \
55
--env PROXY_HOSTNAME=mymachine.lan \
6-
pambrose/prometheus-agent:1.21.0
6+
pambrose/prometheus-agent:1.22.0

bin/docker-proxy.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
docker run --rm -p 8082:8082 -p 8092:8092 -p 50051:50051 -p 8080:8080 \
44
--env PROXY_CONFIG='https://raw.githubusercontent.com/pambrose/prometheus-proxy/master/examples/simple.conf' \
5-
pambrose/prometheus-proxy:1.21.0
5+
pambrose/prometheus-proxy:1.22.0

build.gradle

Lines changed: 89 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,31 @@ plugins {
22
id 'idea'
33
id 'java'
44
id 'maven-publish'
5-
id 'org.jetbrains.kotlin.jvm' version '1.9.22'
5+
id 'org.jetbrains.kotlin.jvm' version '2.0.0'
66
id 'com.google.protobuf' version '0.9.4' // Keep in sync with grpc
7-
id 'org.jmailen.kotlinter' version "4.1.1"
8-
id "com.github.ben-manes.versions" version '0.50.0'
7+
id 'org.jmailen.kotlinter' version "4.3.0"
8+
id "com.github.ben-manes.versions" version '0.51.0'
99
id 'com.github.johnrengelman.shadow' version '8.1.1'
10-
id 'com.github.gmazzo.buildconfig' version '5.3.2'
11-
id 'org.jetbrains.kotlinx.kover' version '0.7.5'
10+
id 'com.github.gmazzo.buildconfig' version '5.3.5'
11+
id 'org.jetbrains.kotlinx.kover' version '0.8.1'
12+
id 'io.gitlab.arturbosch.detekt' version '1.23.6'
1213
// Turn these off until jacoco fixes their kotlin 1.5.0 SMAP issue
1314
// id 'jacoco'
1415
// id 'com.github.kt3k.coveralls' version '2.12.0'
1516
}
1617

1718
group = 'io.prometheus'
18-
version = '1.21.0'
19+
version = '1.22.0'
1920

20-
sourceCompatibility = JavaVersion.VERSION_17
21-
targetCompatibility = JavaVersion.VERSION_17
21+
//sourceCompatibility = JavaVersion.VERSION_17
22+
//targetCompatibility = JavaVersion.VERSION_17
2223

2324
buildConfig {
2425
packageName("io.prometheus")
2526

2627
buildConfigField('String', 'APP_NAME', "\"${project.name}\"")
2728
buildConfigField('String', 'APP_VERSION', "\"${project.version}\"")
28-
buildConfigField('String', 'APP_RELEASE_DATE', "\"12/11/2023\"")
29+
buildConfigField('String', 'APP_RELEASE_DATE', "\"06/11/2024\"")
2930
}
3031

3132
repositories {
@@ -44,6 +45,9 @@ dependencies {
4445
implementation "io.grpc:grpc-stub:$grpc_version"
4546
implementation "io.grpc:grpc-services:$grpc_version"
4647

48+
implementation("com.google.protobuf:protobuf-java:$protobuf_version")
49+
implementation("com.google.protobuf:protobuf-java-util:$protobuf_version")
50+
4751
implementation "io.grpc:grpc-kotlin-stub:$gengrpc_version"
4852

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

6771
implementation "javax.annotation:javax.annotation-api:$annotation_version"
68-
implementation "com.beust:jcommander:$jcommander_version"
72+
implementation "org.jcommander:jcommander:$jcommander_version"
6973
implementation "com.typesafe:config:$typesafe_version"
7074

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

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

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

@@ -174,6 +178,22 @@ java {
174178
withSourcesJar()
175179
}
176180

181+
detekt {
182+
buildUponDefaultConfig = true // preconfigure defaults
183+
allRules = false // activate all available (even unstable) rules.
184+
config.setFrom("$projectDir/config/detekt/detekt.yml")
185+
// point to your custom config defining rules to run, overwriting default behavior
186+
baseline = file("$projectDir/config/detekt/baseline.xml") // a way of suppressing issues before introducing detekt
187+
}
188+
189+
190+
//tasks.withType(Detekt).configureEach {
191+
// jvmTarget = "1.8"
192+
//}
193+
//tasks.withType(DetektCreateBaselineTask).configureEach {
194+
// jvmTarget = "1.8"
195+
//}
196+
177197

178198
//jacocoTestReport {
179199
// reports {
@@ -263,61 +283,63 @@ kotlinter {
263283
reporters = ['checkstyle', 'plain']
264284
}
265285

266-
koverMerged {
267-
enable() // create Kover merged reports
268-
269-
filters { // common filters for all default Kover merged tasks
270-
classes { // common class filter for all default Kover merged tasks
271-
includes.add("io.prometheus.*") // class inclusion rules
272-
//excludes.addAll("io.prometheus.subpackage.*") // class exclusion rules
273-
}
274-
275-
projects { // common projects filter for all default Kover merged tasks
276-
//excludes.addAll("project1", ":child:project") // Specifies the projects excluded in the merged tasks
277-
}
278-
}
279-
280-
281-
xmlReport {
282-
onCheck.set(true)
283-
// true to run koverMergedXmlReport task during the execution of the check task (if it exists) of the current project
284-
reportFile.set(layout.buildDirectory.file("my-merged-report/result.xml")) // change report file name
285-
overrideClassFilter { // override common class filter
286-
includes.add("io.prometheus.*") // override class inclusion rules
287-
//excludes.addAll("io.prometheus.subpackage.*") // override class exclusion rules
288-
}
289-
}
290-
291-
htmlReport {
292-
onCheck.set(true)
293-
// true to run koverMergedHtmlReport task during the execution of the check task (if it exists) of the current project
294-
reportDir.set(layout.buildDirectory.dir("my-merged-report/html-result")) // change report directory
295-
overrideClassFilter { // override common class filter
296-
includes.add("io.prometheus.*") // override class inclusion rules
297-
//excludes.addAll("io.prometheus.subpackage.*") // override class exclusion rules
298-
}
299-
}
300-
301-
verify {
302-
onCheck.set(true)
303-
// true to run koverMergedVerify task during the execution of the check task (if it exists) of the current project
304-
rule { // add verification rule
305-
//isEnabled = true // false to disable rule checking
306-
name = null // custom name for the rule
307-
target = 'ALL' // specify by which entity the code for separate coverage evaluation will be grouped
308-
309-
overrideClassFilter { // override common class filter
310-
includes.add("io.prometheus.verify.*") // override class inclusion rules
311-
// excludes.addAll("io.prometheus.verify.subpackage.*") // override class exclusion rules
312-
}
313-
314-
bound { // add rule bound
315-
minValue = 10
316-
maxValue = 20
317-
counter = 'LINE' // change coverage metric to evaluate (LINE, INSTRUCTION, BRANCH)
318-
valueType = 'COVERED_PERCENTAGE'
319-
// change counter value (COVERED_COUNT, MISSED_COUNT, COVERED_PERCENTAGE, MISSED_PERCENTAGE)
320-
}
321-
}
286+
kover {
287+
reports {
288+
// enable() // create Kover merged reports
289+
//
290+
// filters { // common filters for all default Kover merged tasks
291+
// classes { // common class filter for all default Kover merged tasks
292+
// includes.add("io.prometheus.*") // class inclusion rules
293+
// //excludes.addAll("io.prometheus.subpackage.*") // class exclusion rules
294+
// }
295+
//
296+
// projects { // common projects filter for all default Kover merged tasks
297+
// //excludes.addAll("project1", ":child:project") // Specifies the projects excluded in the merged tasks
298+
// }
299+
// }
300+
//
301+
//
302+
// xmlReport {
303+
// onCheck.set(true)
304+
// // true to run koverMergedXmlReport task during the execution of the check task (if it exists) of the current project
305+
// reportFile.set(layout.buildDirectory.file("my-merged-report/result.xml")) // change report file name
306+
// overrideClassFilter { // override common class filter
307+
// includes.add("io.prometheus.*") // override class inclusion rules
308+
// //excludes.addAll("io.prometheus.subpackage.*") // override class exclusion rules
309+
// }
310+
// }
311+
//
312+
// htmlReport {
313+
// onCheck.set(true)
314+
// // true to run koverMergedHtmlReport task during the execution of the check task (if it exists) of the current project
315+
// reportDir.set(layout.buildDirectory.dir("my-merged-report/html-result")) // change report directory
316+
// overrideClassFilter { // override common class filter
317+
// includes.add("io.prometheus.*") // override class inclusion rules
318+
// //excludes.addAll("io.prometheus.subpackage.*") // override class exclusion rules
319+
// }
320+
// }
321+
322+
// verify {
323+
// // onCheck.set(true)
324+
// // true to run koverMergedVerify task during the execution of the check task (if it exists) of the current project
325+
// rule { // add verification rule
326+
// //isEnabled = true // false to disable rule checking
327+
// name = null // custom name for the rule
328+
// target = 'ALL' // specify by which entity the code for separate coverage evaluation will be grouped
329+
//
330+
// overrideClassFilter { // override common class filter
331+
// includes.add("io.prometheus.verify.*") // override class inclusion rules
332+
// // excludes.addAll("io.prometheus.verify.subpackage.*") // override class exclusion rules
333+
// }
334+
//
335+
// bound { // add rule bound
336+
// minValue = 10
337+
// maxValue = 20
338+
// counter = 'LINE' // change coverage metric to evaluate (LINE, INSTRUCTION, BRANCH)
339+
// valueType = 'COVERED_PERCENTAGE'
340+
// // change counter value (COVERED_COUNT, MISSED_COUNT, COVERED_PERCENTAGE, MISSED_PERCENTAGE)
341+
// }
342+
// }
343+
// }
322344
}
323345
}

0 commit comments

Comments
 (0)