Skip to content

Commit 0db8810

Browse files
authored
1.23.0 (#101)
* Update to Kotlin 2.1.0, Ktor 3.0.1, and gRPC 1.68.2 * Change minimum JDK from 17 to 11 * Remove krotodc library * Convert build.gradle to build.gradle.kts * Add support for gRPC reflection * Add support for service discovery labels in pathConfigs
1 parent a7a57ca commit 0db8810

Some content is hidden

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

55 files changed

+1064
-825
lines changed

.editorconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,4 @@ ktlint_standard_multiline-if-else = disabled
2323
ktlint_standard_string-template-indent = disabled
2424
ktlint_standard_indent = disabled
2525
ktlint_standard_multiline-expression-wrapping = disabled
26+
ktlint_standard_chain-method-continuation = disabled

Makefile

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

33
default: versioncheck
44

@@ -25,7 +25,7 @@ tests:
2525
reports:
2626
./gradlew koverMergedHtmlReport
2727

28-
config:
28+
tsconfig:
2929
java -jar ./etc/jars/tscfg-0.9.997.jar --spec etc/config/config.conf --pn io.prometheus.common --cn ConfigVals --dd src/main/java/io/prometheus/common
3030

3131
distro: clean compile jars
@@ -71,4 +71,4 @@ refresh:
7171
./gradlew --refresh-dependencies
7272

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

README.md

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,16 +62,19 @@ agent {
6262
{
6363
name: "App1 metrics"
6464
path: app1_metrics
65+
labels: "{\"key1\": \"value1\", \"key2\": 2}"
6566
url: "http://app1.local:9100/metrics"
6667
},
6768
{
6869
name: "App2 metrics"
6970
path: app2_metrics
71+
labels: "{\"key3\": \"value3\", \"key4\": \"value4\"}"
7072
url: "http://app2.local:9100/metrics"
7173
},
7274
{
7375
name: "App3 metrics"
7476
path: app3_metrics
77+
labels: "{\"key5\": \"value5\", \"key6\": \"value6\"}"
7578
url: "http://app3.local:9100/metrics"
7679
}
7780
]
@@ -113,8 +116,8 @@ scrape_configs:
113116
The docker images are available via:
114117
115118
```bash
116-
docker pull pambrose/prometheus-proxy:1.22.0
117-
docker pull pambrose/prometheus-agent:1.22.0
119+
docker pull pambrose/prometheus-proxy:1.23.0
120+
docker pull pambrose/prometheus-agent:1.23.0
118121
```
119122

120123
Start a proxy container with:
@@ -123,15 +126,15 @@ Start a proxy container with:
123126
docker run --rm -p 8082:8082 -p 8092:8092 -p 50051:50051 -p 8080:8080 \
124127
--env ADMIN_ENABLED=true \
125128
--env METRICS_ENABLED=true \
126-
pambrose/prometheus-proxy:1.22.0
129+
pambrose/prometheus-proxy:1.23.0
127130
```
128131

129132
Start an agent container with:
130133

131134
```bash
132135
docker run --rm -p 8083:8083 -p 8093:8093 \
133136
--env AGENT_CONFIG='https://raw.githubusercontent.com/pambrose/prometheus-proxy/master/examples/simple.conf' \
134-
pambrose/prometheus-agent:1.22.0
137+
pambrose/prometheus-agent:1.23.0
135138
```
136139

137140
Using the config
@@ -149,7 +152,7 @@ is in your current directory, run an agent container with:
149152
docker run --rm -p 8083:8083 -p 8093:8093 \
150153
--mount type=bind,source="$(pwd)"/prom-agent.conf,target=/app/prom-agent.conf \
151154
--env AGENT_CONFIG=prom-agent.conf \
152-
pambrose/prometheus-agent:1.22.0
155+
pambrose/prometheus-agent:1.23.0
153156
```
154157

155158
**Note:** The `WORKDIR` of the proxy and agent images is `/app`, so make sure to use `/app` as the base directory in the
@@ -195,6 +198,7 @@ argument is an agent config value, which should have an `agent.pathConfigs` valu
195198
| --sd_path | SD_PATH <br> proxy.service.discovery.path | "discovery" | Service discovery endpoint path |
196199
| --sd_target_prefix | SD_TARGET_PREFIX <br> proxy.service.discovery.targetPrefix | "http://localhost:8080/" | Service discovery target prefix |
197200
| --tf-disabled | TRANSPORT_FILTER_DISABLED <br> proxy.transportFilterDisabled | false | Transport filter disabled |
201+
| --ref-disabled | REFLECTION_DISABLED <br> proxy.reflectionDisabled | false | gRPC Reflection disabled |
198202
| --cert, -t | CERT_CHAIN_FILE_PATH <br> proxy.tls.certChainFilePath | | Certificate chain file path |
199203
| --key, -k | PRIVATE_KEY_FILE_PATH <br> proxy.tls.privateKeyFilePath | | Private key file path |
200204
| --trust, -s | TRUST_CERT_COLLECTION_FILE_PATH <br> proxy.tls.trustCertCollectionFilePath | | Trust certificate collection file path |
@@ -219,7 +223,7 @@ argument is an agent config value, which should have an `agent.pathConfigs` valu
219223
| --max_retries | SCRAPE_MAX_RETRIES <br> agent.scrapeMaxRetries | 0 | Scrape maximum retries (0 disables scrape retries) |
220224
| --chunk | CHUNK_CONTENT_SIZE_KBS <br> agent.chunkContentSizeKbs | 32 | Threshold for chunking data to Proxy and buffer size (KBs) |
221225
| --gzip | MIN_GZIP_SIZE_BYTES <br> agent.minGzipSizeBytes | 1024 | Minimum size for content to be gzipped (bytes) |
222-
| --tf-disabled | TRANSPORT_FILTER_DISABLED <br> proxy.transportFilterDisabled | false | Transport filter disabled |
226+
| --tf-disabled | TRANSPORT_FILTER_DISABLED <br> agent.transportFilterDisabled | false | Transport filter disabled |
223227
| --trust_all_x509 | TRUST_ALL_X509_CERTIFICATES <br> agent.http.enableTrustAllX509Certificates | false | Disable SSL verification for agent https endpoints |
224228
| --cert, -t | CERT_CHAIN_FILE_PATH <br> agent.tls.certChainFilePath | | Certificate chain file path |
225229
| --key, -k | PRIVATE_KEY_FILE_PATH <br> agent.tls.privateKeyFilePath | | Private key file path |
@@ -239,6 +243,8 @@ Misc notes:
239243
* Property values can be set as a java -D arg to or as a proxy or agent jar -D arg
240244
* For more information about the proxy service discovery options, see the
241245
Prometheus [documentation](https://prometheus.io/docs/prometheus/latest/http_sd/)
246+
* A pathConfig `labels` value is a quote-escaped JSON string with key/value pairs. It is used to add additional service
247+
discovery context to a target.
242248

243249
### Admin Servlets
244250

@@ -297,15 +303,15 @@ docker run --rm -p 8082:8082 -p 8092:8092 -p 50440:50440 -p 8080:8080 \
297303
--env PROXY_CONFIG=tls-no-mutual-auth.conf \
298304
--env ADMIN_ENABLED=true \
299305
--env METRICS_ENABLED=true \
300-
pambrose/prometheus-proxy:1.22.0
306+
pambrose/prometheus-proxy:1.23.0
301307

302308
docker run --rm -p 8083:8083 -p 8093:8093 \
303309
--mount type=bind,source="$(pwd)"/testing/certs,target=/app/testing/certs \
304310
--mount type=bind,source="$(pwd)"/examples/tls-no-mutual-auth.conf,target=/app/tls-no-mutual-auth.conf \
305311
--env AGENT_CONFIG=tls-no-mutual-auth.conf \
306312
--env PROXY_HOSTNAME=mymachine.lan:50440 \
307313
--name docker-agent \
308-
pambrose/prometheus-agent:1.22.0
314+
pambrose/prometheus-agent:1.23.0
309315
```
310316

311317
**Note:** The `WORKDIR` of the proxy and agent images is `/app`, so make sure to use `/app` as the base directory in the
@@ -339,6 +345,22 @@ An example nginx conf file is [here](https://github.com/pambrose/prometheus-prox
339345
and an example agent/proxy conf file
340346
is [here](https://github.com/pambrose/prometheus-proxy/tree/master/nginx/nginx-proxy.conf)
341347

348+
## gRPC Reflection
349+
350+
The [gRPC Reflection](https://grpc.io/docs/guides/reflection/) service is enabled by default.
351+
352+
To disable gRPC Reflection support, set the `REFLECTION_DISABLED` environment var,
353+
the `--reflection_disabled` CLI option, or the `proxy.reflectionDisabled` property to true.
354+
355+
To use [grpcurl](https://github.com/fullstorydev/grpcurl) to test the reflection service, run:
356+
357+
```bash
358+
grpcurl -plaintext localhost:50051 list
359+
```
360+
361+
If you use the grpcurl `-plaintext` option, make sure that you run the proxy in plaintext
362+
mode, i.e., do not define any TLS properties.
363+
342364
## Grafana
343365

344366
[Grafana](https://grafana.com) dashboards for the proxy and agent

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.22.0
6+
pambrose/prometheus-agent:1.23.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.22.0
5+
pambrose/prometheus-proxy:1.23.0

0 commit comments

Comments
 (0)