Docker Flow Monitor: Automatically Reconfigure Prometheus

Docker Flow Monitor

The goal of the Docker Flow Monitor project is to provide an easy way to reconfigure Prometheus every time a new service is deployed, or when a service is updated. It does not try to "reinvent the wheel", but to leverage the existing leaders and combine them through an easy to use integration. It uses Prometheus as a metrics storage and query engine and adds custom logic that allows on-demand reconfiguration.

Please visit the tutorial for a brief introduction or Configuring Docker Flow Monitor and Usage sections for more details.

Please join the #df-monitor Slack channel in DevOps20 if you have any questions, suggestions, or problems.

.gitignore

/.idea
/*.iml
/docker-flow-monitor
/alertmanager.yml
/tmp
/*.pem
/secret

Dockerfile

FROM golang:1.9.2 AS build
ADD . /src
WORKDIR /src
RUN go get -t github.com/stretchr/testify/suite
RUN go get -d -v -t
RUN go test --cover ./... --run UnitTest -p 1
RUN CGO_ENABLED=0 GOOS=linux go build -v -o docker-flow-monitor



FROM prom/prometheus:v2.25.2

ENV GLOBAL_SCRAPE_INTERVAL=10s \
    ARG_CONFIG_FILE=/etc/prometheus/prometheus.yml \
    ARG_STORAGE_TSDB_PATH=/prometheus \
    ARG_WEB_CONSOLE_LIBRARIES=/usr/share/prometheus/console_libraries \
    ARG_WEB_CONSOLE_TEMPLATES=/usr/share/prometheus/consoles \
    CONFIGS_DIR="/run/secrets"

EXPOSE 8080

ENTRYPOINT ["docker-flow-monitor"]

HEALTHCHECK --interval=5s CMD /bin/check.sh

COPY --from=build /src/docker-flow-monitor /bin/docker-flow-monitor
COPY check.sh /bin/check.sh
COPY conf/shortcuts.yaml /etc/dfm/shortcuts.yaml

USER root
RUN chmod +x /bin/check.sh
RUN chmod +x /bin/docker-flow-monitor
#USER nobody

Dockerfile.docs

### ---- MKDOCS base image ----
FROM python:3.7-alpine3.10 AS build

ENV MKDOCS_VERSION="1.0.4" \
    GIT_REPO='false' \
    LIVE_RELOAD_SUPPORT='false'

RUN \
    apk add --update --no-cache  \
        ca-certificates \
        bash \
        git \
        openssh ;  \
    pip install mkdocs==${MKDOCS_VERSION} && \
    rm -rf /tmp/* /var/tmp/* /var/cache/apk/* /var/cache/distfiles/*

RUN mkdir /workdir && cd /workdir   && \
    pip install pygments pymdown-extensions   && \
    mkdocs new mkdocs

ADD ./docs /workdir/mkdocs/docs
WORKDIR /workdir/mkdocs

RUN  mkdocs build --site-dir /site
### ----




### ---- NGINX ----
FROM nginx:1.11-alpine
LABEL maintainer="Viktor Farcic <viktor@farcic.com>"
LABEL maintainer="Alessandro Affinito <affinito.ale@gmail.com>"
COPY --from=build /site /usr/share/nginx/html

Download details:

Author: docker-flow
Source: https://github.com/docker-flow/docker-flow-monitor

License: MIT license

#docker 

Docker Flow Monitor: Automatically Reconfigure Prometheus
1.60 GEEK