Skip to content

Commit

Permalink
1.1.0
Browse files Browse the repository at this point in the history
* Catch and log all Exceptions in fetchUrl

* Convert Proxy to use Guava AbstractIdleService

* Convert Agent to use Guava AbstractExecutionThreadService

* Prepare for 1.1.0 release

* Change env var from ENABLE_METRICS to METRICS_ENABLED

* Add config vals for http server threadpool

* Convert Agent and Proxy to guava Services

* Add ServiceManager to Agent and Proxy

* Update to grpc 1.3.0

* Change pom.xml to use grpc-all
  • Loading branch information
pambrose authored Apr 28, 2017
1 parent 80f3399 commit e085c46
Show file tree
Hide file tree
Showing 37 changed files with 846 additions and 585 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION=1.0.0
VERSION=1.1.0

default: build

Expand Down Expand Up @@ -27,8 +27,8 @@ report-coverage:

distro: build
mkdir target/distro
mv target/proxy-1.0-jar-with-dependencies.jar target/distro/prometheus-proxy.jar
mv target/agent-1.0-jar-with-dependencies.jar target/distro/prometheus-agent.jar
mv target/proxy-jar-with-dependencies.jar target/distro/prometheus-proxy.jar
mv target/agent-jar-with-dependencies.jar target/distro/prometheus-agent.jar

site:
./mvnw site
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,24 +84,24 @@ scrape_configs:
The docker images are available via:
```bash
$ docker pull pambrose/prometheus-proxy:1.0.0
$ docker pull pambrose/prometheus-agent:1.0.0
$ docker pull pambrose/prometheus-proxy:1.1.0
$ docker pull pambrose/prometheus-agent:1.1.0
```

Start the proxy and an agent in separate shells on your local machine:

```bash
$ docker run --rm -p 8082:8082 -p 50051:50051 -p 8080:8080 \
-e HOSTNAME=${HOSTNAME} \
-e ENABLE_METRICS=true \
pambrose/prometheus-proxy:1.0.0
-e METRICS_ENABLED=true \
pambrose/prometheus-proxy:1.1.0
```

```bash
$ docker run --rm -p 8083:8083 \
-e HOSTNAME=${HOSTNAME} \
-e AGENT_CONFIG='https://raw.githubusercontent.com/pambrose/prometheus-proxy/master/examples/simple.conf' \
pambrose/prometheus-agent:1.0.0
pambrose/prometheus-agent:1.1.0
```

Using the config file [simple.conf](https://raw.githubusercontent.com/pambrose/prometheus-proxy/master/examples/simple.conf),
Expand Down Expand Up @@ -129,7 +129,7 @@ The only required argument is an Agent config value, which should have an `agent
| -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 |
| -e --metrics | ENABLE_METRICS | proxy.metrics.enabled | false | Enable proxy metrics |
| -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 |
Expand All @@ -143,7 +143,7 @@ The only required argument is an Agent config value, which should have an `agent
| -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 |
| -e --metrics | ENABLE_METRICS | agent.metrics.enabled | false | Enable agent metrics |
| -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 |
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 \
-e HOSTNAME=${HOSTNAME} \
-e AGENT_CONFIG='https://raw.githubusercontent.com/pambrose/prometheus-proxy/master/examples/simple.conf' \
pambrose/prometheus-agent:1.0.0
pambrose/prometheus-agent:1.1.0
2 changes: 1 addition & 1 deletion bin/docker-proxy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
docker run --rm -p 8082:8082 -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.0.0
pambrose/prometheus-proxy:1.1.0
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.0.0'
image: 'pambrose/prometheus-proxy:1.1.0'
ports:
- '8080:8080'
- '8082:8082'
Expand Down
8 changes: 7 additions & 1 deletion etc/config/config.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@

proxy {
http.port = 8080 // Listen port for proxied scrapes

http {
port = 8080 // Listen port for proxied scrapes
maxThreads = -1
minThreads = -1
idleTimeoutMillis = -1
}

agent.port = 50051 // Listen port for agent connections

Expand Down
42 changes: 16 additions & 26 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,20 @@

<groupId>io.prometheus</groupId>
<artifactId>prometheus-proxy</artifactId>
<version>1.0-SNAPSHOT</version>
<version>1.1.0-SNAPSHOT</version>

<properties>
<config.version>1.3.1</config.version>
<grpc.version>1.2.0</grpc.version>
<grpc.plugin.version>1.2.0</grpc.plugin.version>
<grpc.version>1.3.0</grpc.version>
<grpc.plugin.version>1.3.0</grpc.plugin.version>
<protobuf.version>3.2.0</protobuf.version>
<protobuf.plugin.version>0.5.0</protobuf.plugin.version>
<guava.version>19.0</guava.version>
<prometheus.version>0.0.21</prometheus.version>
<jcommander.version>1.69</jcommander.version>
<spark.version>2.6.0.RC0</spark.version>
<okhttp.version>3.7.0</okhttp.version>
<auto.version>1.4.1</auto.version>
<grpc-prom.version>0.3.0</grpc-prom.version>
<brave.version>4.2.0</brave.version>
<zipkin-reporter.version>0.7.0</zipkin-reporter.version>
Expand All @@ -40,6 +41,9 @@
<maven.compiler.target>1.8</maven.compiler.target>

<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

<sonar.exclusions>**/grpc/*.java, **/AutoValue_*</sonar.exclusions>
<sonar.language>java</sonar.language>
</properties>

<prerequisites>
Expand All @@ -62,21 +66,10 @@

<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-protobuf</artifactId>
<version>${grpc.version}</version>
</dependency>

<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-stub</artifactId>
<artifactId>grpc-all</artifactId>
<version>${grpc.version}</version>
</dependency>

<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-netty</artifactId>
<version>${grpc.version}</version>
</dependency>
</dependencies>
</dependencyManagement>

Expand Down Expand Up @@ -148,20 +141,16 @@

<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-protobuf</artifactId>
<artifactId>grpc-all</artifactId>
<version>${grpc.version}</version>
</dependency>

<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-stub</artifactId>
<version>${grpc.version}</version>
</dependency>

<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-netty</artifactId>
<version>${grpc.version}</version>
<groupId>com.google.auto.value</groupId>
<artifactId>auto-value</artifactId>
<version>${auto.version}</version>
<scope>provided</scope>
</dependency>

<dependency>
Expand Down Expand Up @@ -354,7 +343,7 @@
<phase>package</phase>

<configuration>
<finalName>proxy-1.0</finalName>
<finalName>proxy</finalName>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
Expand All @@ -375,7 +364,7 @@
<phase>package</phase>

<configuration>
<finalName>agent-1.0</finalName>
<finalName>agent</finalName>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
Expand Down Expand Up @@ -534,6 +523,7 @@
<exclude>**/grpc/*.class</exclude>
<exclude>**/ConfigVals*.class</exclude>
<exclude>**/ZipkinReporter*.class</exclude>
<exclude>**/AutoValue_*.class</exclude>
</excludes>
</configuration>
<executions>
Expand Down
Loading

0 comments on commit e085c46

Please sign in to comment.