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 \ git \
make \ make \
&& go get -v \ && go get -v \
github.com/Luzifer/bind-log-metrics \
github.com/Luzifer/named-blacklist \ github.com/Luzifer/named-blacklist \
github.com/Luzifer/rootzone \ github.com/Luzifer/rootzone \
&& rootzone >named.stubs \ && rootzone >named.stubs \
@ -30,6 +31,7 @@ RUN set -ex \
bind-tools \ bind-tools \
&& /usr/local/bin/build.sh && /usr/local/bin/build.sh
COPY --from=builder /go/bin/bind-log-metrics /usr/local/bin/
COPY --from=builder /src/named.stubs /etc/bind/ COPY --from=builder /src/named.stubs /etc/bind/
COPY --from=builder /src/named.blacklist /etc/bind/ COPY --from=builder /src/named.blacklist /etc/bind/
COPY named.conf /etc/bind/ COPY named.conf /etc/bind/

View file

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