Skip to content

Commit

Permalink
cmd/tsdbrelay: enable version numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
gbrayut committed Aug 11, 2016
1 parent 2ccd2d7 commit 9546c27
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 13 deletions.
26 changes: 13 additions & 13 deletions cmd/bosun/docker/build/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
FROM debian:wheezy

RUN apt-get update && apt-get install -y \
automake \
curl \
git \
make \
openjdk-7-jdk \
python \
--no-install-recommends \
&& rm -rf /var/lib/apt/lists/*
automake \
curl \
git \
make \
openjdk-7-jdk \
python \
--no-install-recommends \
&& rm -rf /var/lib/apt/lists/*

ENV TSDB /tsdb
RUN git clone --single-branch --depth 1 git://github.com/OpenTSDB/opentsdb.git $TSDB && \
cd $TSDB && bash ./build.sh
cd $TSDB && bash ./build.sh

ENV GOPATH /go
ENV HBASEVER 1.1.2
Expand All @@ -24,7 +24,7 @@ RUN mkdir -p /hbase \
| tar -xzC /hbase \
&& mv /hbase/hbase-$HBASEVER /hbase/hbase

RUN curl -SL https://storage.googleapis.com/golang/go1.6.2.linux-amd64.tar.gz \
RUN curl -SL https://storage.googleapis.com/golang/go1.6.3.linux-amd64.tar.gz \
| tar -xzC /usr/local

COPY bosun $GOPATH/src/bosun.org/
Expand All @@ -33,6 +33,6 @@ WORKDIR $GOPATH/src/bosun.org
ENV PATH $PATH:/usr/local/go/bin:$GOPATH/bin

RUN go run build/build.go \
&& bosun -version \
&& scollector -version
# && tsdbrelay -version doesn't work. See https://github.com/bosun-monitor/bosun/issues/1792
&& bosun -version \
&& scollector -version \
&& tsdbrelay -version
9 changes: 9 additions & 0 deletions cmd/tsdbrelay/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"compress/gzip"
"encoding/json"
"flag"
"fmt"
"io"
"log"
"net/http"
Expand All @@ -14,6 +15,8 @@ import (
"os"
"strings"

version "bosun.org/_version"

"bosun.org/cmd/tsdbrelay/denormalize"
"bosun.org/collect"
"bosun.org/metadata"
Expand All @@ -28,6 +31,7 @@ var (
tsdbServer = flag.String("t", "", "Target OpenTSDB server. Can specify port with host:port.")
logVerbose = flag.Bool("v", false, "enable verbose logging")
toDenormalize = flag.String("denormalize", "", "List of metrics to denormalize. Comma seperated list of `metric__tagname__tagname` rules. Will be translated to `__tagvalue.tagvalue.metric`")
flagVersion = flag.Bool("version", false, "Prints the version and exits.")

redisHost = flag.String("redis", "", "redis host for aggregating external counters")
redisDb = flag.Int("db", 0, "redis db to use for counters")
Expand All @@ -50,9 +54,14 @@ func main() {
}

flag.Parse()
if *flagVersion {
fmt.Println(version.GetVersionInfo("tsdbrelay"))
os.Exit(0)
}
if *bosunServer == "" || *tsdbServer == "" {
log.Fatal("must specify both bosun and tsdb server")
}
log.Println(version.GetVersionInfo("tsdbrelay"))
log.Println("listen on", *listenAddr)
log.Println("relay to bosun at", *bosunServer)
log.Println("relay to tsdb at", *tsdbServer)
Expand Down

0 comments on commit 9546c27

Please sign in to comment.