Skip to content

Commit 0cb7430

Browse files
authored
1.4.4
* Add debug servlet to admin port
1 parent d2c5ed8 commit 0cb7430

Some content is hidden

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

45 files changed

+681
-603
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VERSION=1.4.3
1+
VERSION=1.4.4
22

33
default: compile
44

README.md

Lines changed: 43 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,17 @@ config file had these values:
5151
agent {
5252
pathConfigs: [
5353
{
54-
name: app1
54+
name: "app1 name"
5555
path: app1_metrics
5656
url: "http://app1.local:9100/metrics"
5757
},
5858
{
59-
name: app2
59+
name: "app2 name"
6060
path: app2_metrics
6161
url: "http://app2.local:9100/metrics"
6262
},
6363
{
64-
name: app3
64+
name: "app3 name"
6565
path: app3_metrics
6666
url: "http://app3.local:9100/metrics"
6767
}
@@ -97,8 +97,8 @@ scrape_configs:
9797
9898
The docker images are available via:
9999
```bash
100-
docker pull pambrose/prometheus-proxy:1.4.3
101-
docker pull pambrose/prometheus-agent:1.4.3
100+
docker pull pambrose/prometheus-proxy:1.4.4
101+
docker pull pambrose/prometheus-agent:1.4.4
102102
```
103103

104104
Start the proxy and an agent in separate shells on your local machine:
@@ -107,13 +107,13 @@ Start the proxy and an agent in separate shells on your local machine:
107107
docker run --rm -p 8082:8082 -p 8092:8092 -p 50051:50051 -p 8080:8080 \
108108
-e ADMIN_ENABLED=true \
109109
-e METRICS_ENABLED=true \
110-
pambrose/prometheus-proxy:1.4.3
110+
pambrose/prometheus-proxy:1.4.4
111111
```
112112

113113
```bash
114114
docker run --rm -p 8083:8083 -p 8093:8093 \
115115
-e AGENT_CONFIG='https://raw.githubusercontent.com/pambrose/prometheus-proxy/master/examples/simple.conf' \
116-
pambrose/prometheus-agent:1.4.3
116+
pambrose/prometheus-agent:1.4.4
117117
```
118118

119119
If you want to be able to externalize your `agent` config file on your local machine (or VM) file system (instead of the above HTTP served config file), you'll need to add the Docker `volume` definition to the command:
@@ -122,7 +122,7 @@ If you want to be able to externalize your `agent` config file on your local mac
122122
docker run --rm -p 8083:8083 -p 8093:8093 \
123123
-v ${PWD}/prom-agent.conf:/prom-agent.conf \
124124
-e AGENT_CONFIG=/prom-agent.conf \
125-
pambrose/prometheus-agent:1.4.3
125+
pambrose/prometheus-agent:1.4.4
126126
```
127127

128128
The above assumes that you have the file `prom-agent.conf` in the current directory from which you're running the `docker` command.
@@ -147,34 +147,36 @@ The only required argument is an Agent config value, which should have an `agent
147147

148148
### Proxy CLI Options
149149

150-
| Options | Env Var | Property |Default | Description |
151-
|:--------------------|:----------------|:-----------------------|:-------|:---------------------------------------|
152-
| -c --config | PROXY_CONFIG | | | Agent config file or url |
153-
| -p --port | PROXY_PORT | proxy.http.port | 8080 | Proxy listen port |
154-
| -a --agent_port | AGENT_PORT | proxy.agent.port | 50051 | gRPC listen port for Agents |
155-
| -r --admin | ADMIN_ENABLED | proxy.admin.enabled | false | Enable admin servlets |
156-
| -i --admin_port | ADMIN_PORT | proxy.admin.port | 8092 | Admin servlets port |
157-
| -e --metrics | METRICS_ENABLED | proxy.metrics.enabled | false | Enable proxy metrics |
158-
| -m --metrics_port | METRICS_PORT | proxy.metrics.port | 8082 | Proxy metrics listen port |
159-
| -v --version | | | | Print version info and exit |
160-
| -u --usage | | | | Print usage message and exit |
161-
| -D | | | | Dynamic property assignment |
150+
| Options | Env Var | Property |Default | Description |
151+
|:--------------------|:----------------|:---------------------------|:-------|:---------------------------------------|
152+
| -c --config | PROXY_CONFIG | | | Agent config file or url |
153+
| -p --port | PROXY_PORT | proxy.http.port | 8080 | Proxy listen port |
154+
| -a --agent_port | AGENT_PORT | proxy.agent.port | 50051 | gRPC listen port for Agents |
155+
| -r --admin | ADMIN_ENABLED | proxy.admin.enabled | false | Enable admin servlets |
156+
| -i --admin_port | ADMIN_PORT | proxy.admin.port | 8092 | Admin servlets port |
157+
| -e --metrics | METRICS_ENABLED | proxy.metrics.enabled | false | Enable proxy metrics |
158+
| -m --metrics_port | METRICS_PORT | proxy.metrics.port | 8082 | Proxy metrics listen port |
159+
| -b --debug | DEBUG_ENABLED | proxy.metrics.debugEnabled | false | Enable proxy debug servlet on admin port|
160+
| -v --version | | | | Print version info and exit |
161+
| -u --usage | | | | Print usage message and exit |
162+
| -D | | | | Dynamic property assignment |
162163

163164

164165
### Agent CLI Options
165166

166-
| Options | Env Var | Property |Default | Description |
167-
|:--------------------|:----------------|:-----------------------|:-------|:---------------------------------------|
168-
| -c --config | AGENT_CONFIG | | | Agent config file or url (required) |
169-
| -p --proxy | PROXY_HOSTNAME | agent.proxy.hostname | | Proxy hostname (can include :port) |
170-
| -n --name | AGENT_NAME | agent.name | | Agent name |
171-
| -r --admin | ADMIN_ENABLED | agent.admin.enabled | false | Enable admin servlets |
172-
| -i --admin_port | ADMIN_PORT | agent.admin.port | 8093 | Admin servlets port |
173-
| -e --metrics | METRICS_ENABLED | agent.metrics.enabled | false | Enable agent metrics |
174-
| -m --metrics_port | METRICS_PORT | agent.metrics.port | 8083 | Agent metrics listen port |
175-
| -v --version | | | | Print version info and exit |
176-
| -u --usage | | | | Print usage message and exit |
177-
| -D | | | | Dynamic property assignment |
167+
| Options | Env Var | Property |Default | Description |
168+
|:--------------------|:----------------|:---------------------------|:-------|:---------------------------------------|
169+
| -c --config | AGENT_CONFIG | | | Agent config file or url (required) |
170+
| -p --proxy | PROXY_HOSTNAME | agent.proxy.hostname | | Proxy hostname (can include :port) |
171+
| -n --name | AGENT_NAME | agent.name | | Agent name |
172+
| -r --admin | ADMIN_ENABLED | agent.admin.enabled | false | Enable admin servlets |
173+
| -i --admin_port | ADMIN_PORT | agent.admin.port | 8093 | Admin servlets port |
174+
| -e --metrics | METRICS_ENABLED | agent.metrics.enabled | false | Enable agent metrics |
175+
| -m --metrics_port | METRICS_PORT | agent.metrics.port | 8083 | Agent metrics listen port |
176+
| -b --debug | DEBUG_ENABLED | agent.metrics.debugEnabled | false | Enable proxy debug servlet on admin port|
177+
| -v --version | | | | Print version info and exit |
178+
| -u --usage | | | | Print usage message and exit |
179+
| -D | | | | Dynamic property assignment |
178180

179181
Misc notes:
180182
* If you want to customize the logging, include the java arg `-Dlogback.configurationFile=/path/to/logback.xml`
@@ -186,14 +188,21 @@ Misc notes:
186188

187189
### Admin Servlets
188190

189-
Three admin servlets are available when the `proxy.admin.enabled` or `agent.admin.enabled` properties are enabled:
191+
These admin servlets are available when the admin servlet is enabled:
190192
* /ping
191193
* /threaddump
192194
* /healthcheck
193195
* /version
194196

197+
The admin servlets can be enabled with the ``ADMIN_ENABLED`` environment var, the ``--admin`` CLI option, or with the
198+
`proxy.admin.enabled` and `agent.admin.enabled` properties.
199+
200+
The debug servlet can be enabled with ``DEBUG_ENABLED`` environment var, ``--debug``CLI option , or with the
201+
proxy.admin.debugEnabled` and `agent.admin.debugEnabled` properties. The debug servlet requires that the
202+
admin servlets are enabled. The debug servlet is at: /debug on the admin port.
203+
195204
Descriptions of the servlets are [here](http://metrics.dropwizard.io/3.2.2/manual/servlets.html).
196-
The path names can be changed in the configuration file. To disable an admin servlet, assign its path to "".
205+
The path names can be changed in the configuration file. To disable an admin servlet, assign its property path to "".
197206

198207
## Grafana
199208

bin/docker-agent.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22

33
docker run --rm -p 8083:8083 -p 8093:8093 \
4-
-e HOSTNAME=${HOSTNAME} \
5-
-e AGENT_CONFIG='https://raw.githubusercontent.com/pambrose/prometheus-proxy/master/examples/simple.conf' \
6-
pambrose/prometheus-agent:1.4.3
4+
-e HOSTNAME=${HOSTNAME} \
5+
-e AGENT_CONFIG='https://raw.githubusercontent.com/pambrose/prometheus-proxy/master/examples/simple.conf' \
6+
pambrose/prometheus-agent:1.4.4

bin/docker-proxy.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22

33
docker run --rm -p 8082:8082 -p 8092:8092 -p 50051:50051 -p 8080:8080 \
4-
-e HOSTNAME=${HOSTNAME} \
5-
-e PROXY_CONFIG='https://raw.githubusercontent.com/pambrose/prometheus-proxy/master/examples/simple.conf' \
6-
pambrose/prometheus-proxy:1.4.3
4+
-e HOSTNAME=${HOSTNAME} \
5+
-e PROXY_CONFIG='https://raw.githubusercontent.com/pambrose/prometheus-proxy/master/examples/simple.conf' \
6+
pambrose/prometheus-proxy:1.4.4

build.gradle

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ plugins {
99
}
1010

1111
group = 'io.prometheus'
12-
version = '1.4.3-SNAPSHOT'
12+
version = '1.4.4'
1313

1414
sourceCompatibility = 1.8
1515
targetCompatibility = 1.8
1616

1717
def kotlinVersion = '1.3.60'
1818
def serializationVersion = '0.13.0'
1919
def coroutinesVersion = '1.3.2'
20-
def utilsVersion = '1.1.6'
20+
def utilsVersion = '1.1.7'
2121

2222
def grpcVersion = '1.25.0'
2323
def protocVersion = '3.10.0'
@@ -28,6 +28,7 @@ def prometheusVersion = '0.8.0'
2828
def loggingVersion = '1.7.7'
2929
def dropwizardVersion = '4.1.1'
3030
def zipkinVersion = '5.9.0'
31+
def jettyVersion = '9.4.22.v20191022'
3132
def kluentVersion = '1.57'
3233
def tscfgVersion = '1.3.4'
3334
def contribVersion = '0.8.1'
@@ -56,15 +57,18 @@ dependencies {
5657
implementation "io.grpc:grpc-all:${grpcVersion}"
5758

5859
implementation "com.github.pambrose.common-utils:core-utils:${utilsVersion}"
60+
implementation "com.github.pambrose.common-utils:corex-utils:${utilsVersion}"
5961
implementation "com.github.pambrose.common-utils:dropwizard-utils:${utilsVersion}"
6062
implementation "com.github.pambrose.common-utils:guava-utils:${utilsVersion}"
6163
implementation "com.github.pambrose.common-utils:grpc-utils:${utilsVersion}"
62-
implementation "com.github.pambrose.common-utils:ktor-client-utils:${utilsVersion}"
6364
implementation "com.github.pambrose.common-utils:jetty-utils:${utilsVersion}"
65+
implementation "com.github.pambrose.common-utils:ktor-client-utils:${utilsVersion}"
6466
implementation "com.github.pambrose.common-utils:prometheus-utils:${utilsVersion}"
6567
implementation "com.github.pambrose.common-utils:service-utils:${utilsVersion}"
6668
implementation "com.github.pambrose.common-utils:zipkin-utils:${utilsVersion}"
6769

70+
implementation "org.eclipse.jetty:jetty-servlet:${jettyVersion}"
71+
6872
implementation "javax.annotation:javax.annotation-api:${annotationVersion}"
6973
implementation "com.beust:jcommander:${jcommanderVersion}"
7074
implementation "com.typesafe:config:${tscfgVersion}"

etc/compose/proxy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
prometheus-proxy:
22
autoredeploy: true
3-
image: 'pambrose/prometheus-proxy:1.4.3'
3+
image: 'pambrose/prometheus-proxy:1.4.4'
44
ports:
55
- '8080:8080'
66
- '8082:8082'

etc/config/config.conf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ proxy {
1717
versionPath = "version" // Version servlet path
1818
healthCheckPath = "healthcheck" // HealthCheck servlet path
1919
threadDumpPath = "threaddump" // ThreadDump servlet path
20+
debugEnabled = false // Enable proxy debug servlet on admin port
2021
}
2122

2223
metrics {
@@ -44,7 +45,6 @@ proxy {
4445

4546
scrapeRequestTimeoutSecs = 5
4647
scrapeRequestCheckMillis = 500
47-
scrapeRequestChannelSize = 128
4848
scrapeRequestBacklogUnhealthySize = 25 // Threshold for returning an unhealthy healthcheck
4949
scrapeRequestMapUnhealthySize = 25 // Threshold for returning an unhealthy healthcheck
5050

@@ -79,6 +79,7 @@ agent {
7979
versionPath = "version" // Version servlet path
8080
healthCheckPath = "healthcheck" // HealthCheck servlet path
8181
threadDumpPath = "threaddump" // ThreadDump servlet path
82+
debugEnabled = false // Enable agent debug servlet on admin port
8283
}
8384

8485
metrics {
@@ -108,13 +109,12 @@ agent {
108109
]
109110

110111
internal {
111-
reconectPauseSecs = 3 // Pause interval between connect attempts
112+
reconnectPauseSecs = 3 // Pause interval between connect attempts
112113

113114
heartbeatEnabled = true
114115
heartbeatCheckPauseMillis = 500 // Pause interval when checking for inactivity
115116
heartbeatMaxInactivitySecs = 5 // Max inactivity before hearbeat sent
116117

117-
scrapeRequestChannelSize = 128
118118
scrapeRequestBacklogUnhealthySize = 25 // Threshold for returning an unhealthy healthcheck
119119

120120
zipkin {

logback/docker-logback.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@
2525
</appender>
2626

2727
<logger name="io.grpc.internal" level="WARN"/>
28-
<logger name="spark.http.matching" level="WARN"/>
28+
<logger name="io.ktor.server.engine" level="WARN"/>
29+
<logger name="org.eclipse.jetty.server" level="WARN"/>
30+
<logger name="ktor.application" level="WARN"/>
31+
32+
<logger name="io.prometheus.agent.AgentHttpService" level="INFO"/>
2933

3034
<root level="INFO">
3135
<appender-ref ref="STDOUT"/>

0 commit comments

Comments
 (0)