Skip to content

Commit

Permalink
1.4.4
Browse files Browse the repository at this point in the history
* Add debug servlet to admin port
  • Loading branch information
pambrose authored Nov 20, 2019
1 parent d2c5ed8 commit 0cb7430
Show file tree
Hide file tree
Showing 45 changed files with 681 additions and 603 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION=1.4.3
VERSION=1.4.4

default: compile

Expand Down
77 changes: 43 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,17 @@ config file had these values:
agent {
pathConfigs: [
{
name: app1
name: "app1 name"
path: app1_metrics
url: "http://app1.local:9100/metrics"
},
{
name: app2
name: "app2 name"
path: app2_metrics
url: "http://app2.local:9100/metrics"
},
{
name: app3
name: "app3 name"
path: app3_metrics
url: "http://app3.local:9100/metrics"
}
Expand Down Expand Up @@ -97,8 +97,8 @@ scrape_configs:
The docker images are available via:
```bash
docker pull pambrose/prometheus-proxy:1.4.3
docker pull pambrose/prometheus-agent:1.4.3
docker pull pambrose/prometheus-proxy:1.4.4
docker pull pambrose/prometheus-agent:1.4.4
```

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

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

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:
Expand All @@ -122,7 +122,7 @@ If you want to be able to externalize your `agent` config file on your local mac
docker run --rm -p 8083:8083 -p 8093:8093 \
-v ${PWD}/prom-agent.conf:/prom-agent.conf \
-e AGENT_CONFIG=/prom-agent.conf \
pambrose/prometheus-agent:1.4.3
pambrose/prometheus-agent:1.4.4
```

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

### Proxy CLI Options

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


### Agent CLI Options

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

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

### Admin Servlets

Three admin servlets are available when the `proxy.admin.enabled` or `agent.admin.enabled` properties are enabled:
These admin servlets are available when the admin servlet is enabled:
* /ping
* /threaddump
* /healthcheck
* /version

The admin servlets can be enabled with the ``ADMIN_ENABLED`` environment var, the ``--admin`` CLI option, or with the
`proxy.admin.enabled` and `agent.admin.enabled` properties.

The debug servlet can be enabled with ``DEBUG_ENABLED`` environment var, ``--debug``CLI option , or with the
proxy.admin.debugEnabled` and `agent.admin.debugEnabled` properties. The debug servlet requires that the
admin servlets are enabled. The debug servlet is at: /debug on the admin port.

Descriptions of the servlets are [here](http://metrics.dropwizard.io/3.2.2/manual/servlets.html).
The path names can be changed in the configuration file. To disable an admin servlet, assign its path to "".
The path names can be changed in the configuration file. To disable an admin servlet, assign its property path to "".

## Grafana

Expand Down
6 changes: 3 additions & 3 deletions bin/docker-agent.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

docker run --rm -p 8083:8083 -p 8093:8093 \
-e HOSTNAME=${HOSTNAME} \
-e AGENT_CONFIG='https://raw.githubusercontent.com/pambrose/prometheus-proxy/master/examples/simple.conf' \
pambrose/prometheus-agent:1.4.3
-e HOSTNAME=${HOSTNAME} \
-e AGENT_CONFIG='https://raw.githubusercontent.com/pambrose/prometheus-proxy/master/examples/simple.conf' \
pambrose/prometheus-agent:1.4.4
6 changes: 3 additions & 3 deletions bin/docker-proxy.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

docker run --rm -p 8082:8082 -p 8092:8092 -p 50051:50051 -p 8080:8080 \
-e HOSTNAME=${HOSTNAME} \
-e PROXY_CONFIG='https://raw.githubusercontent.com/pambrose/prometheus-proxy/master/examples/simple.conf' \
pambrose/prometheus-proxy:1.4.3
-e HOSTNAME=${HOSTNAME} \
-e PROXY_CONFIG='https://raw.githubusercontent.com/pambrose/prometheus-proxy/master/examples/simple.conf' \
pambrose/prometheus-proxy:1.4.4
10 changes: 7 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ plugins {
}

group = 'io.prometheus'
version = '1.4.3-SNAPSHOT'
version = '1.4.4'

sourceCompatibility = 1.8
targetCompatibility = 1.8

def kotlinVersion = '1.3.60'
def serializationVersion = '0.13.0'
def coroutinesVersion = '1.3.2'
def utilsVersion = '1.1.6'
def utilsVersion = '1.1.7'

def grpcVersion = '1.25.0'
def protocVersion = '3.10.0'
Expand All @@ -28,6 +28,7 @@ def prometheusVersion = '0.8.0'
def loggingVersion = '1.7.7'
def dropwizardVersion = '4.1.1'
def zipkinVersion = '5.9.0'
def jettyVersion = '9.4.22.v20191022'
def kluentVersion = '1.57'
def tscfgVersion = '1.3.4'
def contribVersion = '0.8.1'
Expand Down Expand Up @@ -56,15 +57,18 @@ dependencies {
implementation "io.grpc:grpc-all:${grpcVersion}"

implementation "com.github.pambrose.common-utils:core-utils:${utilsVersion}"
implementation "com.github.pambrose.common-utils:corex-utils:${utilsVersion}"
implementation "com.github.pambrose.common-utils:dropwizard-utils:${utilsVersion}"
implementation "com.github.pambrose.common-utils:guava-utils:${utilsVersion}"
implementation "com.github.pambrose.common-utils:grpc-utils:${utilsVersion}"
implementation "com.github.pambrose.common-utils:ktor-client-utils:${utilsVersion}"
implementation "com.github.pambrose.common-utils:jetty-utils:${utilsVersion}"
implementation "com.github.pambrose.common-utils:ktor-client-utils:${utilsVersion}"
implementation "com.github.pambrose.common-utils:prometheus-utils:${utilsVersion}"
implementation "com.github.pambrose.common-utils:service-utils:${utilsVersion}"
implementation "com.github.pambrose.common-utils:zipkin-utils:${utilsVersion}"

implementation "org.eclipse.jetty:jetty-servlet:${jettyVersion}"

implementation "javax.annotation:javax.annotation-api:${annotationVersion}"
implementation "com.beust:jcommander:${jcommanderVersion}"
implementation "com.typesafe:config:${tscfgVersion}"
Expand Down
2 changes: 1 addition & 1 deletion etc/compose/proxy.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
prometheus-proxy:
autoredeploy: true
image: 'pambrose/prometheus-proxy:1.4.3'
image: 'pambrose/prometheus-proxy:1.4.4'
ports:
- '8080:8080'
- '8082:8082'
Expand Down
6 changes: 3 additions & 3 deletions etc/config/config.conf
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ proxy {
versionPath = "version" // Version servlet path
healthCheckPath = "healthcheck" // HealthCheck servlet path
threadDumpPath = "threaddump" // ThreadDump servlet path
debugEnabled = false // Enable proxy debug servlet on admin port
}

metrics {
Expand Down Expand Up @@ -44,7 +45,6 @@ proxy {

scrapeRequestTimeoutSecs = 5
scrapeRequestCheckMillis = 500
scrapeRequestChannelSize = 128
scrapeRequestBacklogUnhealthySize = 25 // Threshold for returning an unhealthy healthcheck
scrapeRequestMapUnhealthySize = 25 // Threshold for returning an unhealthy healthcheck

Expand Down Expand Up @@ -79,6 +79,7 @@ agent {
versionPath = "version" // Version servlet path
healthCheckPath = "healthcheck" // HealthCheck servlet path
threadDumpPath = "threaddump" // ThreadDump servlet path
debugEnabled = false // Enable agent debug servlet on admin port
}

metrics {
Expand Down Expand Up @@ -108,13 +109,12 @@ agent {
]

internal {
reconectPauseSecs = 3 // Pause interval between connect attempts
reconnectPauseSecs = 3 // Pause interval between connect attempts

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

scrapeRequestChannelSize = 128
scrapeRequestBacklogUnhealthySize = 25 // Threshold for returning an unhealthy healthcheck

zipkin {
Expand Down
6 changes: 5 additions & 1 deletion logback/docker-logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@
</appender>

<logger name="io.grpc.internal" level="WARN"/>
<logger name="spark.http.matching" level="WARN"/>
<logger name="io.ktor.server.engine" level="WARN"/>
<logger name="org.eclipse.jetty.server" level="WARN"/>
<logger name="ktor.application" level="WARN"/>

<logger name="io.prometheus.agent.AgentHttpService" level="INFO"/>

<root level="INFO">
<appender-ref ref="STDOUT"/>
Expand Down
Loading

0 comments on commit 0cb7430

Please sign in to comment.