Skip to content

Commit

Permalink
1.23.0 (#101)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
pambrose authored Nov 30, 2024
1 parent a7a57ca commit 0db8810
Show file tree
Hide file tree
Showing 55 changed files with 1,064 additions and 825 deletions.
1 change: 1 addition & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ ktlint_standard_multiline-if-else = disabled
ktlint_standard_string-template-indent = disabled
ktlint_standard_indent = disabled
ktlint_standard_multiline-expression-wrapping = disabled
ktlint_standard_chain-method-continuation = disabled
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION=1.22.0
VERSION=1.23.0

default: versioncheck

Expand All @@ -25,7 +25,7 @@ tests:
reports:
./gradlew koverMergedHtmlReport

config:
tsconfig:
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

distro: clean compile jars
Expand Down Expand Up @@ -71,4 +71,4 @@ refresh:
./gradlew --refresh-dependencies

upgrade-wrapper:
./gradlew wrapper --gradle-version=8.8 --distribution-type=bin
./gradlew wrapper --gradle-version=8.11.1 --distribution-type=bin
38 changes: 30 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,19 @@ agent {
{
name: "App1 metrics"
path: app1_metrics
labels: "{\"key1\": \"value1\", \"key2\": 2}"
url: "http://app1.local:9100/metrics"
},
{
name: "App2 metrics"
path: app2_metrics
labels: "{\"key3\": \"value3\", \"key4\": \"value4\"}"
url: "http://app2.local:9100/metrics"
},
{
name: "App3 metrics"
path: app3_metrics
labels: "{\"key5\": \"value5\", \"key6\": \"value6\"}"
url: "http://app3.local:9100/metrics"
}
]
Expand Down Expand Up @@ -113,8 +116,8 @@ scrape_configs:
The docker images are available via:
```bash
docker pull pambrose/prometheus-proxy:1.22.0
docker pull pambrose/prometheus-agent:1.22.0
docker pull pambrose/prometheus-proxy:1.23.0
docker pull pambrose/prometheus-agent:1.23.0
```

Start a proxy container with:
Expand All @@ -123,15 +126,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.22.0
pambrose/prometheus-proxy:1.23.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.22.0
pambrose/prometheus-agent:1.23.0
```

Using the config
Expand All @@ -149,7 +152,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.22.0
pambrose/prometheus-agent:1.23.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 @@ -195,6 +198,7 @@ argument is an agent config value, which should have an `agent.pathConfigs` valu
| --sd_path | SD_PATH <br> proxy.service.discovery.path | "discovery" | Service discovery endpoint path |
| --sd_target_prefix | SD_TARGET_PREFIX <br> proxy.service.discovery.targetPrefix | "http://localhost:8080/" | Service discovery target prefix |
| --tf-disabled | TRANSPORT_FILTER_DISABLED <br> proxy.transportFilterDisabled | false | Transport filter disabled |
| --ref-disabled | REFLECTION_DISABLED <br> proxy.reflectionDisabled | false | gRPC Reflection disabled |
| --cert, -t | CERT_CHAIN_FILE_PATH <br> proxy.tls.certChainFilePath | | Certificate chain file path |
| --key, -k | PRIVATE_KEY_FILE_PATH <br> proxy.tls.privateKeyFilePath | | Private key file path |
| --trust, -s | TRUST_CERT_COLLECTION_FILE_PATH <br> proxy.tls.trustCertCollectionFilePath | | Trust certificate collection file path |
Expand All @@ -219,7 +223,7 @@ argument is an agent config value, which should have an `agent.pathConfigs` valu
| --max_retries | SCRAPE_MAX_RETRIES <br> agent.scrapeMaxRetries | 0 | Scrape maximum retries (0 disables scrape retries) |
| --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) |
| --tf-disabled | TRANSPORT_FILTER_DISABLED <br> proxy.transportFilterDisabled | false | Transport filter disabled |
| --tf-disabled | TRANSPORT_FILTER_DISABLED <br> agent.transportFilterDisabled | false | Transport filter disabled |
| --trust_all_x509 | TRUST_ALL_X509_CERTIFICATES <br> agent.http.enableTrustAllX509Certificates | false | Disable SSL verification for agent https endpoints |
| --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 |
Expand All @@ -239,6 +243,8 @@ Misc notes:
* Property values can be set as a java -D arg to or as a proxy or agent jar -D arg
* For more information about the proxy service discovery options, see the
Prometheus [documentation](https://prometheus.io/docs/prometheus/latest/http_sd/)
* A pathConfig `labels` value is a quote-escaped JSON string with key/value pairs. It is used to add additional service
discovery context to a target.

### Admin Servlets

Expand Down Expand Up @@ -297,15 +303,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.22.0
pambrose/prometheus-proxy:1.23.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.22.0
pambrose/prometheus-agent:1.23.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 @@ -339,6 +345,22 @@ An example nginx conf file is [here](https://github.com/pambrose/prometheus-prox
and an example agent/proxy conf file
is [here](https://github.com/pambrose/prometheus-proxy/tree/master/nginx/nginx-proxy.conf)

## gRPC Reflection

The [gRPC Reflection](https://grpc.io/docs/guides/reflection/) service is enabled by default.

To disable gRPC Reflection support, set the `REFLECTION_DISABLED` environment var,
the `--reflection_disabled` CLI option, or the `proxy.reflectionDisabled` property to true.

To use [grpcurl](https://github.com/fullstorydev/grpcurl) to test the reflection service, run:

```bash
grpcurl -plaintext localhost:50051 list
```

If you use the grpcurl `-plaintext` option, make sure that you run the proxy in plaintext
mode, i.e., do not define any TLS properties.

## Grafana

[Grafana](https://grafana.com) dashboards for the proxy and agent
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.22.0
pambrose/prometheus-agent:1.23.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.22.0
pambrose/prometheus-proxy:1.23.0
Loading

0 comments on commit 0db8810

Please sign in to comment.