Skip to content

Instantly share code, notes, and snippets.

@Dnile
Last active September 29, 2015 21:51
Show Gist options
  • Save Dnile/bf90b075d96bcae3f556 to your computer and use it in GitHub Desktop.
Save Dnile/bf90b075d96bcae3f556 to your computer and use it in GitHub Desktop.
attempt to run promtheus locally
docker build -t prom .
docker run --name promdan -p 9090:9090 -t prom
FROM sdurrheimer/alpine-glibc
MAINTAINER The Prometheus Authors <[email protected]>
WORKDIR /gopath/src/github.com/prometheus/prometheus
COPY . /gopath/src/github.com/prometheus/prometheus
RUN apk add --update -t build-deps tar openssl git make bash curl\
&& source ./scripts/goenv.sh /go /gopath \
&& make build \
&& cp prometheus promtool /bin/ \
&& mkdir -p /etc/prometheus \
&& mv ./documentation/examples/prometheus.yml /etc/prometheus/prometheus.yml \
&& mv ./console_libraries/ ./consoles/ /etc/prometheus/ \
&& apk del --purge build-deps \
&& rm -rf /go /gopath /var/cache/apk/*
EXPOSE 9090
VOLUME [ "/prometheus" ]
WORKDIR /prometheus
ENTRYPOINT [ "/bin/prometheus" ]
CMD [ "-config.file=/etc/prometheus/prometheus.yml", \
"-storage.local.path=/prometheus", \
"-web.console.libraries=/etc/prometheus/console_libraries", \
"-web.console.templates=/etc/prometheus/consoles" ]
results:
curl localhost:9090/mterics
curl: (7) Failed to connect to localhost port 9090: Connection refused
docker exec -ti <container_id> /bin/sh
apk update
apk add curl
curl localhost:9090/metrics
# HELP go_gc_duration_seconds A summary of the GC invocation durations.
# TYPE go_gc_duration_seconds summary
go_gc_duration_seconds{quantile="0"} 8.8718e-05
go_gc_duration_seconds{quantile="0.25"} 0.000186132
go_gc_duration_seconds{quantile="0.5"} 0.00034569600000000005
go_gc_duration_seconds{quantile="0.75"} 0.0017787200000000001
go_gc_duration_seconds{quantile="1"} 0.002445067
go_gc_duration_seconds_sum 0.014817347000000002
go_gc_duration_seconds_count 17
# HELP go_goroutines Number of goroutines that currently exist.
# TYPE go_goroutines gauge
go_goroutines 112
# HELP http_request_duration_microseconds The HTTP request latencies in microseconds.
# TYPE http_request_duration_microseconds summary
http_request_duration_microseconds{handler="alerts",quantile="0.5"} NaN
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment