Add metrics

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2020-01-25 20:18:05 +01:00
parent 112c5d8270
commit ba5295e923
Signed by: luzifer
GPG Key ID: DC2729FDD34BE99E
2 changed files with 13 additions and 5 deletions

View File

@ -10,6 +10,7 @@ RUN set -ex \
git \
make \
&& go get -v \
github.com/Luzifer/bind-log-metrics \
github.com/Luzifer/named-blacklist \
github.com/Luzifer/rootzone \
&& rootzone >named.stubs \
@ -30,10 +31,11 @@ RUN set -ex \
bind-tools \
&& /usr/local/bin/build.sh
COPY --from=builder /src/named.stubs /etc/bind/
COPY --from=builder /src/named.blacklist /etc/bind/
COPY named.conf /etc/bind/
COPY docker-entrypoint.sh /usr/local/bin/
COPY --from=builder /go/bin/bind-log-metrics /usr/local/bin/
COPY --from=builder /src/named.stubs /etc/bind/
COPY --from=builder /src/named.blacklist /etc/bind/
COPY named.conf /etc/bind/
COPY docker-entrypoint.sh /usr/local/bin/
EXPOSE 53/udp 53

View File

@ -1,5 +1,11 @@
#!/usr/local/bin/dumb-init /bin/bash
set -euxo pipefail
# No influx credentials present, don't use metrics sender
[[ -n ${INFLUX_HOST:-} ]] ||
exec named -c /etc/bind/named.conf -g
# Start bind
exec named -c /etc/bind/named.conf -g
bind-log-metrics <(
named -c /etc/bind/named.conf -g 2>&1
)