├── .gitignore ├── registry ├── auth │ └── .gitignore ├── .env.exemple ├── README.md └── docker-compose.yml ├── traefik ├── traefik │ ├── acme │ │ └── .gitignore │ ├── basicAuth │ │ └── .gitignore │ └── config │ │ ├── metrics.yml │ │ └── middlewares.yml ├── .env.exemple └── docker-compose.yml ├── gitlab ├── .env.exemple ├── README.md └── docker-compose.yml ├── jenkins ├── .env.exemple ├── README.md └── docker-compose.yml ├── golang-project-example ├── .env.exemple ├── README.md ├── Dockerfile └── docker-compose.yml ├── gogs ├── .env.exemple ├── README.md └── docker-compose.yml ├── miniflux ├── .env.exemple ├── README.md └── docker-compose.yml ├── prometheus-grafana ├── grafana.env ├── prometheus │ └── prometheus.yml ├── grafana │ └── provisioning │ │ ├── dashboards │ │ ├── dashboard.yml │ │ └── reverse-proxy_rev1.json │ │ └── datasources │ │ └── datasource.yml └── docker-compose.yml ├── portainer └── docker-compose.yml └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | **/.env -------------------------------------------------------------------------------- /registry/auth/.gitignore: -------------------------------------------------------------------------------- 1 | htpasswd -------------------------------------------------------------------------------- /traefik/traefik/acme/.gitignore: -------------------------------------------------------------------------------- 1 | acme.json -------------------------------------------------------------------------------- /traefik/traefik/basicAuth/.gitignore: -------------------------------------------------------------------------------- 1 | .admin -------------------------------------------------------------------------------- /gitlab/.env.exemple: -------------------------------------------------------------------------------- 1 | GITLAB_URL=gitlab.your-domain.com 2 | -------------------------------------------------------------------------------- /jenkins/.env.exemple: -------------------------------------------------------------------------------- 1 | JENKINS_URL=jenkins.your-domain.com 2 | -------------------------------------------------------------------------------- /registry/.env.exemple: -------------------------------------------------------------------------------- 1 | REGISTRY_URL=registry.your-domain.com 2 | -------------------------------------------------------------------------------- /golang-project-example/.env.exemple: -------------------------------------------------------------------------------- 1 | MYSQL_USER=DB 2 | MYSQL_PASSWORD=user 3 | -------------------------------------------------------------------------------- /traefik/.env.exemple: -------------------------------------------------------------------------------- 1 | TRAEFIK_URL=traefik.your-domain.com 2 | EMAIL=your@email.com 3 | -------------------------------------------------------------------------------- /gogs/.env.exemple: -------------------------------------------------------------------------------- 1 | GOGS_POSTGRES_USER=postgres 2 | GOGS_POSTGRES_PASSWORD=password 3 | GOGS_URL=gogs.yourdomain.tld -------------------------------------------------------------------------------- /miniflux/.env.exemple: -------------------------------------------------------------------------------- 1 | MINIFLUX_URL=feed.your-domain.com 2 | MINIFLUX_POSTGRES_USER=user 3 | MINIFLUX_POSTGRES_PASSWORD=password 4 | -------------------------------------------------------------------------------- /golang-project-example/README.md: -------------------------------------------------------------------------------- 1 | ## Your Golang project example 2 | 3 | An exemple with Golang Dockerfile 4 | 5 | Dont forget to change the port `8080` if necessary and `YOUR-DOMAIN` in `docker-compose.yml` 6 | 7 | you can also change the name `goproject` -------------------------------------------------------------------------------- /prometheus-grafana/grafana.env: -------------------------------------------------------------------------------- 1 | GF_AUTH_ANONYMOUS_ENABLED=true 2 | GF_AUTH_BASIC_ENABLED=false 3 | GF_AUTH_PROXY_ENABLED=false 4 | GF_USERS_ALLOW_SIGN_UP=false 5 | GF_INSTALL_PLUGINS=grafana-piechart-panel 6 | GF_SERVER_ROOT_URL=%(protocol)s://%(domain)s:%(http_port)s 7 | -------------------------------------------------------------------------------- /prometheus-grafana/prometheus/prometheus.yml: -------------------------------------------------------------------------------- 1 | global: 2 | scrape_interval: 15s 3 | evaluation_interval: 15s 4 | 5 | rule_files: 6 | - 'alert.rules' 7 | 8 | scrape_configs: 9 | - job_name: 'traefik' 10 | scrape_interval: 5s 11 | static_configs: 12 | - targets: ['traefik:9797'] -------------------------------------------------------------------------------- /traefik/traefik/config/metrics.yml: -------------------------------------------------------------------------------- 1 | entryPoints: 2 | metrics: 3 | address: ":9797" 4 | 5 | metrics: 6 | prometheus: 7 | entryPoint: metrics 8 | buckets: 9 | - 0.1 10 | - 0.3 11 | - 1.2 12 | - 5.0 13 | addEntryPointsLabels: true 14 | addServicesLabels: true 15 | -------------------------------------------------------------------------------- /jenkins/README.md: -------------------------------------------------------------------------------- 1 | ## Jenkins 2 | 3 | Make sure you have configured Traefik 4 | 5 | ### Run 6 | In folder: 7 | Make `.env` file on the same model as `.env.exemple` 8 | ```shell 9 | docker compose up -d 10 | ``` 11 | 12 | or 13 | 14 | ```shell 15 | JENKINS_URL=jenkins.yourdomain.tld docker compose up -d 16 | ``` 17 | -------------------------------------------------------------------------------- /gitlab/README.md: -------------------------------------------------------------------------------- 1 | ## Gitlab 2 | 3 | Make sure you have configured Traefik 4 | 5 | ### Run 6 | 7 | Warning, gitlab data is located in _/srv/gitlab/_ 8 | 9 | In folder: 10 | Make `.env` file on the same model as `.env.exemple` 11 | ```shell 12 | docker compose up -d 13 | ``` 14 | 15 | or 16 | 17 | ```shell 18 | GITLAB_URL=gitlab.yourdomain.tld docker compose up -d 19 | ``` 20 | -------------------------------------------------------------------------------- /miniflux/README.md: -------------------------------------------------------------------------------- 1 | ## Miniflux 2 | 3 | Make sure you have configured Traefik 4 | 5 | ### Run 6 | In folder: 7 | Make `.env` file on the same model as `.env.exemple` 8 | ```shell 9 | docker compose up -d 10 | ``` 11 | 12 | or 13 | 14 | ```shell 15 | MINIFLUX_URL=feed.your-domain.com MINIFLUX_POSTGRES_USER=user MINIFLUX_POSTGRES_PASSWORD=password 16 | docker compose up -d 17 | ``` 18 | -------------------------------------------------------------------------------- /gogs/README.md: -------------------------------------------------------------------------------- 1 | ## Gogs 2 | 3 | Make sure you have configured Traefik 4 | 5 | ### Run 6 | In folder: 7 | Make `.env` file on the same model as `.env.exemple` 8 | ```shell 9 | docker compose up -d 10 | ``` 11 | 12 | ### To install gogs 13 | In Gogs installer 14 | 15 | - set `Database Type` to `PostgreSQL` 16 | - set `Host` to `postgres:5432` 17 | - set `SSH Port` to `10022` (if you dont change default) 18 | - set `HTTP Port` to `443` 19 | - set `Application URL` to your website URL (with `https://`) -------------------------------------------------------------------------------- /traefik/traefik/config/middlewares.yml: -------------------------------------------------------------------------------- 1 | # Declaring the user list 2 | http: 3 | middlewares: 4 | admin-auth: 5 | basicAuth: 6 | usersFile: "/etc/traefik/basicAuth/.admin" 7 | 8 | # https only 9 | https-only: 10 | redirectScheme: 11 | scheme: https 12 | permanent: true 13 | 14 | default-headers: 15 | headers: 16 | frameDeny: true 17 | browserXssFilter: true 18 | contentTypeNosniff: true 19 | forceSTSHeader: true 20 | stsIncludeSubdomains: true 21 | stsPreload: true -------------------------------------------------------------------------------- /golang-project-example/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang:alpine 2 | RUN apk add -U --no-cache git ca-certificates 3 | WORKDIR /go 4 | COPY go.mod go.sum /go/ 5 | RUN go mod download && go mod verify 6 | COPY . . 7 | RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" . 8 | RUN echo "nobody:x:65534:65534:Nobody:/:" > /etc_passwd 9 | 10 | 11 | FROM scratch 12 | 13 | COPY --from=0 /etc_passwd /etc/passwd 14 | COPY --from=0 /go/go /go 15 | COPY --from=0 /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ 16 | 17 | USER nobody 18 | 19 | EXPOSE 8080 20 | ENV GIN_MODE=release 21 | ENTRYPOINT ["/go"] -------------------------------------------------------------------------------- /registry/README.md: -------------------------------------------------------------------------------- 1 | ## Docker Registry 2 | 3 | Make sure you have configured Traefik 4 | 5 | ### Setup 6 | Create your user file 7 | ```shell 8 | htpasswd -B -C 14 -c auth/htpasswd *your-username* 9 | ``` 10 | 11 | ### Run 12 | In folder: 13 | Make `.env` file on the same model as `.env.exemple` 14 | ```shell 15 | docker compose up -d 16 | ``` 17 | 18 | or 19 | 20 | ```shell 21 | REGISTRY_URL=registry.yourdomain.tld docker compose up -d 22 | ``` 23 | 24 | ### Informations 25 | 26 | Now your can use your docker registry like this 27 | ```shell 28 | docker login registry.yourdomain.tld 29 | 30 | docker push registry.yourdomain.tld/my_image:my_version 31 | 32 | docker pull registry.yourdomain.tld/my_image:my_version 33 | ``` 34 | -------------------------------------------------------------------------------- /prometheus-grafana/grafana/provisioning/dashboards/dashboard.yml: -------------------------------------------------------------------------------- 1 | apiVersion: 1 2 | 3 | providers: 4 | # provider name 5 | - name: 'default' 6 | # org id. will default to orgId 1 if not specified 7 | orgId: 1 8 | # name of the dashboard folder. Required 9 | folder: '' 10 | # folder UID. will be automatically generated if not specified 11 | folderUid: '' 12 | # provider type. Required 13 | type: file 14 | # disable dashboard deletion 15 | disableDeletion: false 16 | # enable dashboard editing 17 | editable: true 18 | # how often Grafana will scan for changed dashboards 19 | updateIntervalSeconds: 10 20 | options: 21 | path: /etc/grafana/provisioning/dashboards -------------------------------------------------------------------------------- /jenkins/docker-compose.yml: -------------------------------------------------------------------------------- 1 | services: 2 | jenkins: 3 | container_name: jenkins 4 | image: jenkins/jenkins:alpine 5 | ports: 6 | - "50000:50000" 7 | restart: "always" 8 | volumes: 9 | - jenkins_data:/var/jenkins_home 10 | labels: 11 | - "traefik.enable=true" 12 | 13 | - "traefik.http.routers.jenkins.rule=Host(`${JENKINS_URL}`)" 14 | - "traefik.http.routers.jenkins.entrypoints=https" 15 | - "traefik.http.routers.jenkins.tls.certresolver=certbot" 16 | #- "traefik.http.routers.jenkins.middlewares=default-headers@file" 17 | 18 | - "traefik.http.services.jenkins.loadbalancer.server.port=8080" 19 | networks: 20 | - traefik 21 | 22 | volumes: 23 | jenkins_data: 24 | driver: local 25 | 26 | networks: 27 | traefik: 28 | name: traefik_proxy 29 | external: true 30 | -------------------------------------------------------------------------------- /portainer/docker-compose.yml: -------------------------------------------------------------------------------- 1 | services: 2 | portainer: 3 | image: portainer/portainer-ce:alpine 4 | container_name: portainer 5 | restart: unless-stopped 6 | security_opt: 7 | - no-new-privileges:true 8 | networks: 9 | - traefik 10 | volumes: 11 | - /var/run/docker.sock:/var/run/docker.sock:ro 12 | - ./portainer-data:/data 13 | labels: 14 | - "traefik.enable=true" 15 | 16 | - "traefik.http.routers.portainer.middlewares=default-headers@file" 17 | - "traefik.http.routers.portainer.tls.certresolver=certbot" 18 | - "traefik.http.routers.portainer.entrypoints=https" 19 | - "traefik.http.routers.portainer.rule=Host(`${PORTAINER_URL}`)" 20 | 21 | - "traefik.http.services.portainer.loadbalancer.server.port=9000" 22 | 23 | networks: 24 | traefik: 25 | name: traefik_proxy 26 | external: true 27 | -------------------------------------------------------------------------------- /registry/docker-compose.yml: -------------------------------------------------------------------------------- 1 | services: 2 | registry: 3 | container_name: registry 4 | restart: always 5 | image: registry:2 6 | environment: 7 | REGISTRY_HTTP_ADDR: 0.0.0.0:443 8 | REGISTRY_AUTH: htpasswd 9 | REGISTRY_AUTH_HTPASSWD_PATH: /auth/htpasswd 10 | REGISTRY_AUTH_HTPASSWD_REALM: Registry Realm 11 | volumes: 12 | - registry:/var/lib/registry 13 | - ./auth:/auth 14 | networks: 15 | - traefik 16 | labels: 17 | - "traefik.enable=true" 18 | 19 | - "traefik.http.routers.registry.rule=Host(`${REGISTRY_URL}`)" 20 | - "traefik.http.routers.registry.entrypoints=https" 21 | - "traefik.http.routers.registry.tls.certresolver=certbot" 22 | 23 | - "traefik.http.services.registry.loadbalancer.server.port=443" 24 | 25 | volumes: 26 | registry: 27 | 28 | networks: 29 | traefik: 30 | name: traefik_proxy 31 | external: true 32 | -------------------------------------------------------------------------------- /gitlab/docker-compose.yml: -------------------------------------------------------------------------------- 1 | services: 2 | gitlab: 3 | hostname: '${GITLAB_URL}' 4 | environment: 5 | GITLAB_OMNIBUS_CONFIG: | 6 | external_url = 'https://${GITLAB_URL}' 7 | nginx['listen_port'] = '80' 8 | nginx['listen_https'] = false 9 | gitlab_rails['gitlab_shell_ssh_port'] = 2222 10 | image: 'gitlab/gitlab-ce:latest' 11 | restart: always 12 | ports: 13 | - "2222:22" 14 | container_name: gitlab 15 | volumes: 16 | - /srv/gitlab/conf:/etc/gitlab 17 | - /srv/gitlab/logs:/var/log/gitlab 18 | - /srv/gitlab/data:/var/opt/gitlab 19 | labels: 20 | - "traefik.enable=true" 21 | 22 | # routers 23 | - "traefik.http.routers.gitlab.rule=Host(`${GITLAB_URL}`)" 24 | - "traefik.http.routers.gitlab.entrypoints=https" 25 | - "traefik.http.routers.gitlab.tls=true" 26 | - "traefik.http.routers.gitlab.tls.certresolver=certbot" 27 | - "traefik.http.routers.gitlab.middlewares=default-headers@file" 28 | 29 | #- services http 30 | - "traefik.http.services.gitlab.loadbalancer.server.port=80" 31 | 32 | networks: 33 | - traefik 34 | 35 | networks: 36 | traefik: 37 | name: traefik_proxy 38 | external: true 39 | -------------------------------------------------------------------------------- /miniflux/docker-compose.yml: -------------------------------------------------------------------------------- 1 | services: 2 | miniflux: 3 | restart: always 4 | container_name: miniflux 5 | image: miniflux/miniflux:latest 6 | expose: 7 | - "8080" 8 | depends_on: 9 | db: 10 | condition: service_healthy 11 | environment: 12 | - RUN_MIGRATIONS=1 13 | - DATABASE_URL=postgres://${MINIFLUX_POSTGRES_USER}:${MINIFLUX_POSTGRES_PASSWORD}@db/miniflux?sslmode=disable 14 | labels: 15 | - "traefik.enable=true" 16 | 17 | - "traefik.http.routers.rssfeed.middlewares=default-headers@file" 18 | - "traefik.http.routers.rssfeed.rule=Host(`${MINIFLUX_URL}`)" 19 | - "traefik.http.routers.rssfeed.entrypoints=https" 20 | - "traefik.http.routers.rssfeed.tls.certresolver=certbot" 21 | 22 | - "traefik.http.services.rssfeed.loadbalancer.server.port=8080" 23 | networks: 24 | - traefik 25 | 26 | db: 27 | restart: always 28 | container_name: miniflux_db 29 | image: postgres:10 30 | environment: 31 | - POSTGRES_USER=${MINIFLUX_POSTGRES_USER} 32 | - POSTGRES_PASSWORD=${MINIFLUX_POSTGRES_PASSWORD} 33 | volumes: 34 | - miniflux-db:/var/lib/postgresql/data 35 | healthcheck: 36 | test: ["CMD", "pg_isready", "-U", "miniflux"] 37 | interval: 10s 38 | start_period: 30s 39 | networks: 40 | - traefik 41 | 42 | volumes: 43 | miniflux-db: 44 | 45 | networks: 46 | traefik: 47 | name: traefik_proxy 48 | external: true 49 | -------------------------------------------------------------------------------- /gogs/docker-compose.yml: -------------------------------------------------------------------------------- 1 | services: 2 | gogs: 3 | image: gogs/gogs 4 | restart: always 5 | container_name: gogs 6 | ports: 7 | - "10022:22" 8 | depends_on: 9 | postgres: 10 | condition: service_healthy 11 | volumes: 12 | - gogs_server_data:/data 13 | labels: 14 | - "traefik.enable=true" 15 | 16 | - "traefik.http.routers.gogs.middlewares=default-headers@file" 17 | - "traefik.http.routers.gogs.rule=Host(`${GOGS_URL}`)" 18 | - "traefik.http.routers.gogs.entrypoints=https" 19 | - "traefik.http.routers.gogs.tls.certresolver=certbot" 20 | 21 | - "traefik.http.services.gogs.loadbalancer.server.port=3000" 22 | networks: 23 | - gogs 24 | - traefik 25 | 26 | postgres: 27 | container_name: gogs_db 28 | image: postgres:13-alpine 29 | restart: always 30 | environment: 31 | - POSTGRES_USER=${GOGS_POSTGRES_USER} 32 | - POSTGRES_PASSWORD=${GOGS_POSTGRES_PASSWORD} 33 | - POSTGRES_DB=gogs 34 | volumes: 35 | - gogs_db_data:/var/lib/postgresql/data 36 | healthcheck: 37 | test: ["CMD", "pg_isready", "-U", "gogs"] 38 | interval: 10s 39 | start_period: 30s 40 | networks: 41 | - gogs 42 | 43 | volumes: 44 | gogs_server_data: 45 | driver: local 46 | gogs_db_data: 47 | driver: local 48 | 49 | 50 | networks: 51 | traefik: 52 | name: traefik_proxy 53 | external: true 54 | gogs: 55 | -------------------------------------------------------------------------------- /prometheus-grafana/docker-compose.yml: -------------------------------------------------------------------------------- 1 | services: 2 | prometheus: 3 | image: prom/prometheus:v2.36.1 4 | restart: unless-stopped 5 | container_name: prometheus 6 | volumes: 7 | - ./prometheus/:/etc/prometheus/ 8 | - prometheus:/prometheus 9 | command: 10 | - "--web.route-prefix=/" 11 | - "--web.external-url=https://${PROMETHEUS_URL}" 12 | - "--config.file=/etc/prometheus/prometheus.yml" 13 | - "--storage.tsdb.path=/prometheus" 14 | - "--web.console.libraries=/usr/share/prometheus/console_libraries" 15 | - "--web.console.templates=/usr/share/prometheus/consoles" 16 | networks: 17 | - traefik 18 | 19 | grafana: 20 | image: grafana/grafana:6.6.1 21 | restart: unless-stopped 22 | container_name: grafana 23 | volumes: 24 | - grafana:/var/lib/grafana 25 | - ./grafana/provisioning:/etc/grafana/provisioning 26 | env_file: 27 | - grafana.env 28 | depends_on: 29 | - prometheus 30 | networks: 31 | - traefik 32 | labels: 33 | - "traefik.enable=true" 34 | - "traefik.http.routers.grafana.middlewares=default-headers@file,admin-auth@file" 35 | - "traefik.http.routers.grafana.rule=Host(`${GRAFANA_URL}`)" 36 | - "traefik.http.routers.grafana.entrypoints=https" 37 | - "traefik.http.routers.grafana.tls.certresolver=certbot" 38 | - "traefik.http.services.grafana.loadbalancer.server.port=3000" 39 | 40 | volumes: 41 | prometheus: 42 | grafana: 43 | 44 | networks: 45 | traefik: 46 | name: traefik_proxy 47 | external: true 48 | -------------------------------------------------------------------------------- /golang-project-example/docker-compose.yml: -------------------------------------------------------------------------------- 1 | services: 2 | goproject: 3 | container_name: goproject 4 | restart: always 5 | build: . 6 | env_file: 7 | - .env 8 | environment: 9 | GIN_MODE: release 10 | MYSQL_USER: ${MYSQL_USER} 11 | MYSQL_PASSWORD: ${MYSQL_PASSWORD} 12 | MYSQL_URL: database 13 | depends_on: 14 | database: 15 | condition: service_healthy 16 | labels: 17 | - "traefik.enable=true" 18 | 19 | - "traefik.http.routers.goproject.middlewares=default-headers@file" 20 | - "traefik.http.routers.goproject.rule=Host(`YOUR-DOMAIN`)" 21 | - "traefik.http.routers.goproject.entrypoints=https" 22 | - "traefik.http.routers.goproject.tls.certresolver=certbot" 23 | 24 | - "traefik.http.services.goproject.loadbalancer.server.port=8080" 25 | networks: 26 | - traefik 27 | 28 | database: 29 | env_file: 30 | - .env 31 | container_name: database 32 | image: mysql:5.7 33 | restart: always 34 | environment: 35 | MYSQL_USER: ${MYSQL_USER} 36 | MYSQL_PASSWORD: ${MYSQL_PASSWORD} 37 | MYSQL_RANDOM_ROOT_PASSWORD: 'yes' 38 | MYSQL_DATABASE: database 39 | networks: 40 | - traefik 41 | volumes: 42 | - database:/var/lib/mysql 43 | healthcheck: 44 | test: ["CMD", "mysql", "-u", "${MYSQL_USER}", "-p${MYSQL_PASSWORD}", "-e", "SELECT 1"] 45 | interval: 10s 46 | timeout: 5s 47 | retries: 3 48 | start_period: 5s 49 | 50 | volumes: 51 | database: 52 | 53 | networks: 54 | traefik: 55 | name: traefik_proxy 56 | external: true 57 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Traefik Server with Docker (Traefik 3 available) 2 | 3 | Traefik 3 is now available, on branch **master**. 4 | 5 | Traefik 2 is still usable from branch [traefik-2](https://github.com/raph6/docker-traefik/tree/traefik-2) 6 | 7 | ## Getting started 8 | 9 | Make sure you have Docker and docker-compose installed and your DNS records set up 10 | 11 | ```shell 12 | git clone https://github.com/raph6/docker-traefik.git 13 | cd docker-traefik 14 | ``` 15 | 16 | ## Setup Traefik 17 | ```shell 18 | cd traefik 19 | 20 | # create acme.json 21 | touch traefik/acme/acme.json 22 | chmod 600 traefik/acme/acme.json 23 | 24 | # create your admin user file 25 | htpasswd -B -C 14 -c traefik/basicAuth/.admin *your-username* 26 | ``` 27 | 28 | `htpasswd` can be found in the package `apache2-utils` 29 | 30 | `sudo apt-get install apache2-utils` (adjust for your distribution) 31 | 32 | ## Run Traefik 33 | In Traefik folder: 34 | Make `.env` file on the same model as `.env.exemple` 35 | ```shell 36 | docker compose up -d 37 | ``` 38 | 39 | or 40 | 41 | ```shell 42 | EMAIL=your@email.com TRAEFIK_URL=traefik.yourdomain.tld docker compose up -d 43 | ``` 44 | 45 | ## Services you can use 46 | 47 | Feel free to ask for another project 48 | 49 | - [Gitlab](gitlab) 50 | - [Jenkins](jenkins) 51 | - [Miniflux](miniflux) 52 | - [Docker Registry](registry) 53 | - [Gogs](gogs) 54 | - [Prometheus-Grafana](prometheus-grafana) (based on https://github.com/axinorm/traefik-monitoring) 55 | 56 | - [Golang project example](golang-project-example) 57 | 58 | 59 | ## Informations 60 | HTTPS is enabled by default, your certificates are generated and automatically renewed 61 | 62 | PR are welcome 63 | -------------------------------------------------------------------------------- /prometheus-grafana/grafana/provisioning/datasources/datasource.yml: -------------------------------------------------------------------------------- 1 | # config file version 2 | apiVersion: 1 3 | 4 | # list of datasources that should be deleted from the database 5 | deleteDatasources: 6 | - name: Prometheus 7 | orgId: 1 8 | 9 | # list of datasources to insert/update depending 10 | # whats available in the database 11 | datasources: 12 | # name of the datasource. Required 13 | - name: Prometheus 14 | # datasource type. Required 15 | type: prometheus 16 | # access mode. direct or proxy. Required 17 | access: proxy 18 | # org id. will default to orgId 1 if not specified 19 | orgId: 1 20 | # url 21 | url: http://prometheus:9090 22 | # database password, if used 23 | password: 24 | # database user, if used 25 | user: 26 | # database name, if used 27 | database: 28 | # enable/disable basic auth 29 | basicAuth: false 30 | # basic auth username 31 | basicAuthUser: 32 | # basic auth password 33 | basicAuthPassword: 34 | # enable/disable with credentials headers 35 | withCredentials: 36 | # mark as default datasource. Max one per org 37 | isDefault: true 38 | # fields that will be converted to json and stored in json_data 39 | jsonData: 40 | graphiteVersion: "1.1" 41 | tlsAuth: false 42 | tlsAuthWithCACert: false 43 | # json object of data that will be encrypted. 44 | secureJsonData: 45 | tlsCACert: "..." 46 | tlsClientCert: "..." 47 | tlsClientKey: "..." 48 | version: 1 49 | # allow users to edit datasources from the UI. 50 | editable: true -------------------------------------------------------------------------------- /traefik/docker-compose.yml: -------------------------------------------------------------------------------- 1 | services: 2 | reverse-proxy: 3 | container_name: traefik 4 | image: traefik:v3.1 5 | restart: "always" 6 | command: 7 | - "--log.level=INFO" 8 | 9 | - "--accesslog=true" 10 | 11 | - "--ping" 12 | 13 | - "--providers.docker=true" 14 | - "--providers.docker.exposedbydefault=false" 15 | - "--providers.docker.watch=true" 16 | 17 | - "--global.checknewversion=true" 18 | - "--global.sendanonymoususage=false" 19 | 20 | - "--api.dashboard=true" 21 | # - "--api.insecure=true" 22 | # - "--api.debug=true" 23 | 24 | - "--entrypoints.http.address=:80" 25 | - "--entrypoints.https.address=:443" 26 | 27 | - "--providers.file.directory=/etc/traefik/config" 28 | 29 | - "--certificatesresolvers.certbot=true" 30 | - "--certificatesresolvers.certbot.acme.email=${EMAIL}" 31 | - "--certificatesresolvers.certbot.acme.storage=/etc/traefik/acme/acme.json" 32 | - "--certificatesresolvers.certbot.acme.caserver=https://acme-v02.api.letsencrypt.org/directory" 33 | 34 | - "--certificatesresolvers.certbot.acme.httpchallenge=true" 35 | - "--certificatesresolvers.certbot.acme.httpchallenge.entrypoint=http" 36 | 37 | #- "--certificatesResolvers.certbot.acme.tlsChallenge=true" 38 | ports: 39 | - "80:80" # http 40 | - "443:443" # https 41 | volumes: 42 | - /var/run/docker.sock:/var/run/docker.sock 43 | - ./traefik:/etc/traefik 44 | healthcheck: 45 | test: ["CMD", "traefik", "healthcheck", "--ping"] 46 | interval: 30s 47 | timeout: 3s 48 | retries: 30 49 | labels: 50 | - "traefik.enable=true" 51 | 52 | # redirect all http to https 53 | - traefik.http.routers.to-https.rule=HostRegexp(`.+`) 54 | - traefik.http.routers.to-https.entrypoints=http 55 | - traefik.http.routers.to-https.middlewares=https-only@file 56 | 57 | # traefik dashboard 58 | - "traefik.http.routers.dashboard.middlewares=admin-auth@file" 59 | - "traefik.http.routers.dashboard.rule=Host(`${TRAEFIK_URL}`)" 60 | - "traefik.http.routers.dashboard.entrypoints=https" 61 | - "traefik.http.routers.dashboard.tls.certresolver=certbot" 62 | - "traefik.http.routers.dashboard.service=api@internal" 63 | networks: 64 | - proxy 65 | 66 | networks: 67 | proxy: 68 | driver: bridge 69 | -------------------------------------------------------------------------------- /prometheus-grafana/grafana/provisioning/dashboards/reverse-proxy_rev1.json: -------------------------------------------------------------------------------- 1 | { 2 | "__requires": [ 3 | { 4 | "type": "grafana", 5 | "id": "grafana", 6 | "name": "Grafana", 7 | "version": "6.3.6" 8 | }, 9 | { 10 | "type": "panel", 11 | "id": "grafana-piechart-panel", 12 | "name": "Pie Chart", 13 | "version": "1.3.9" 14 | }, 15 | { 16 | "type": "panel", 17 | "id": "graph", 18 | "name": "Graph", 19 | "version": "" 20 | }, 21 | { 22 | "type": "datasource", 23 | "id": "prometheus", 24 | "name": "Prometheus", 25 | "version": "1.0.0" 26 | }, 27 | { 28 | "type": "panel", 29 | "id": "singlestat", 30 | "name": "Singlestat", 31 | "version": "" 32 | } 33 | ], 34 | "annotations": { 35 | "list": [ 36 | { 37 | "builtIn": 1, 38 | "datasource": "-- Grafana --", 39 | "enable": true, 40 | "hide": true, 41 | "iconColor": "rgba(0, 211, 255, 1)", 42 | "name": "Annotations & Alerts", 43 | "type": "dashboard" 44 | } 45 | ] 46 | }, 47 | "editable": true, 48 | "gnetId": 10906, 49 | "graphTooltip": 0, 50 | "id": null, 51 | "iteration": 1569328089102, 52 | "links": [ 53 | { 54 | "icon": "external link", 55 | "tags": [ 56 | "link" 57 | ], 58 | "type": "dashboards" 59 | } 60 | ], 61 | "panels": [ 62 | { 63 | "cacheTimeout": null, 64 | "colorBackground": false, 65 | "colorValue": false, 66 | "colors": [ 67 | "#299c46", 68 | "rgba(237, 129, 40, 0.89)", 69 | "#d44a3a" 70 | ], 71 | "datasource": "Prometheus", 72 | "format": "s", 73 | "gauge": { 74 | "maxValue": 100, 75 | "minValue": 0, 76 | "show": false, 77 | "thresholdLabels": false, 78 | "thresholdMarkers": true 79 | }, 80 | "gridPos": { 81 | "h": 6, 82 | "w": 3, 83 | "x": 0, 84 | "y": 0 85 | }, 86 | "id": 22, 87 | "interval": null, 88 | "links": [], 89 | "mappingType": 1, 90 | "mappingTypes": [ 91 | { 92 | "name": "value to text", 93 | "value": 1 94 | }, 95 | { 96 | "name": "range to text", 97 | "value": 2 98 | } 99 | ], 100 | "maxDataPoints": 100, 101 | "nullPointMode": "connected", 102 | "nullText": null, 103 | "options": {}, 104 | "postfix": "", 105 | "postfixFontSize": "50%", 106 | "prefix": "", 107 | "prefixFontSize": "50%", 108 | "rangeMaps": [ 109 | { 110 | "from": "null", 111 | "text": "N/A", 112 | "to": "null" 113 | } 114 | ], 115 | "sparkline": { 116 | "fillColor": "rgba(31, 118, 189, 0.18)", 117 | "full": false, 118 | "lineColor": "rgb(31, 120, 193)", 119 | "show": false 120 | }, 121 | "tableColumn": "", 122 | "targets": [ 123 | { 124 | "expr": "time() - process_start_time_seconds{job=\"$job\"}", 125 | "format": "time_series", 126 | "intervalFactor": 2, 127 | "refId": "A" 128 | } 129 | ], 130 | "thresholds": "", 131 | "title": "Uptime", 132 | "type": "singlestat", 133 | "valueFontSize": "80%", 134 | "valueMaps": [ 135 | { 136 | "op": "=", 137 | "text": "N/A", 138 | "value": "null" 139 | } 140 | ], 141 | "valueName": "current" 142 | }, 143 | { 144 | "cacheTimeout": null, 145 | "colorBackground": false, 146 | "colorValue": true, 147 | "colors": [ 148 | "rgba(50, 172, 45, 0.97)", 149 | "rgba(26, 206, 22, 0.89)", 150 | "rgba(245, 54, 54, 0.9)" 151 | ], 152 | "datasource": "Prometheus", 153 | "decimals": 0, 154 | "format": "none", 155 | "gauge": { 156 | "maxValue": 100, 157 | "minValue": 0, 158 | "show": false, 159 | "thresholdLabels": false, 160 | "thresholdMarkers": true 161 | }, 162 | "gridPos": { 163 | "h": 6, 164 | "w": 3, 165 | "x": 3, 166 | "y": 0 167 | }, 168 | "id": 26, 169 | "interval": null, 170 | "links": [], 171 | "mappingType": 1, 172 | "mappingTypes": [ 173 | { 174 | "name": "value to text", 175 | "value": 1 176 | }, 177 | { 178 | "name": "range to text", 179 | "value": 2 180 | } 181 | ], 182 | "maxDataPoints": 100, 183 | "nullPointMode": "connected", 184 | "nullText": null, 185 | "options": {}, 186 | "postfix": "", 187 | "postfixFontSize": "50%", 188 | "prefix": "", 189 | "prefixFontSize": "200%", 190 | "rangeMaps": [ 191 | { 192 | "from": "null", 193 | "text": "N/A", 194 | "to": "null" 195 | } 196 | ], 197 | "sparkline": { 198 | "fillColor": "rgba(31, 118, 189, 0.18)", 199 | "full": false, 200 | "lineColor": "rgb(31, 120, 193)", 201 | "show": false 202 | }, 203 | "tableColumn": "", 204 | "targets": [ 205 | { 206 | "expr": "sum(increase(traefik_service_requests_total{code=\"404\",method=\"GET\",protocol=~\"$protocol\"}[$interval]))", 207 | "format": "time_series", 208 | "intervalFactor": 2, 209 | "legendFormat": "", 210 | "metric": "traefik_requests_total", 211 | "refId": "A", 212 | "step": 60 213 | } 214 | ], 215 | "thresholds": "0,1", 216 | "title": "404 Error Count last $interval", 217 | "type": "singlestat", 218 | "valueFontSize": "200%", 219 | "valueMaps": [ 220 | { 221 | "op": "=", 222 | "text": "N/A", 223 | "value": "null" 224 | } 225 | ], 226 | "valueName": "max" 227 | }, 228 | { 229 | "aliasColors": {}, 230 | "breakPoint": "50%", 231 | "cacheTimeout": null, 232 | "combine": { 233 | "label": "Others", 234 | "threshold": 0 235 | }, 236 | "datasource": "Prometheus", 237 | "fontSize": "80%", 238 | "format": "short", 239 | "gridPos": { 240 | "h": 6, 241 | "w": 7, 242 | "x": 6, 243 | "y": 0 244 | }, 245 | "id": 18, 246 | "interval": null, 247 | "legend": { 248 | "percentage": true, 249 | "show": true, 250 | "sort": null, 251 | "sortDesc": null, 252 | "values": true 253 | }, 254 | "legendType": "Right side", 255 | "links": [], 256 | "maxDataPoints": 3, 257 | "nullPointMode": "connected", 258 | "options": {}, 259 | "pieType": "pie", 260 | "strokeWidth": 1, 261 | "targets": [ 262 | { 263 | "expr": "traefik_service_requests_total{protocol=~\"$protocol\"}", 264 | "format": "time_series", 265 | "intervalFactor": 2, 266 | "legendFormat": "{{method}} : {{code}}", 267 | "refId": "A" 268 | } 269 | ], 270 | "title": "$protocol return code", 271 | "type": "grafana-piechart-panel", 272 | "valueName": "current" 273 | }, 274 | { 275 | "cacheTimeout": null, 276 | "colorBackground": false, 277 | "colorValue": false, 278 | "colors": [ 279 | "#299c46", 280 | "rgba(237, 129, 40, 0.89)", 281 | "#d44a3a" 282 | ], 283 | "datasource": "Prometheus", 284 | "format": "ms", 285 | "gauge": { 286 | "maxValue": 100, 287 | "minValue": 0, 288 | "show": false, 289 | "thresholdLabels": false, 290 | "thresholdMarkers": true 291 | }, 292 | "gridPos": { 293 | "h": 6, 294 | "w": 4, 295 | "x": 13, 296 | "y": 0 297 | }, 298 | "id": 20, 299 | "interval": null, 300 | "links": [], 301 | "mappingType": 1, 302 | "mappingTypes": [ 303 | { 304 | "name": "value to text", 305 | "value": 1 306 | }, 307 | { 308 | "name": "range to text", 309 | "value": 2 310 | } 311 | ], 312 | "maxDataPoints": 100, 313 | "nullPointMode": "connected", 314 | "nullText": null, 315 | "options": {}, 316 | "postfix": "", 317 | "postfixFontSize": "50%", 318 | "prefix": "", 319 | "prefixFontSize": "50%", 320 | "rangeMaps": [ 321 | { 322 | "from": "null", 323 | "text": "N/A", 324 | "to": "null" 325 | } 326 | ], 327 | "sparkline": { 328 | "fillColor": "rgba(31, 118, 189, 0.18)", 329 | "full": false, 330 | "lineColor": "rgb(31, 120, 193)", 331 | "show": true 332 | }, 333 | "tableColumn": "", 334 | "targets": [ 335 | { 336 | "expr": "sum(traefik_entrypoint_request_duration_seconds_sum) / sum(traefik_entrypoint_requests_total) * 1000", 337 | "format": "time_series", 338 | "intervalFactor": 2, 339 | "refId": "A" 340 | } 341 | ], 342 | "thresholds": "", 343 | "title": "Average response time", 344 | "type": "singlestat", 345 | "valueFontSize": "80%", 346 | "valueMaps": [ 347 | { 348 | "op": "=", 349 | "text": "N/A", 350 | "value": "null" 351 | } 352 | ], 353 | "valueName": "avg" 354 | }, 355 | { 356 | "aliasColors": {}, 357 | "bars": false, 358 | "dashLength": 10, 359 | "dashes": false, 360 | "datasource": "Prometheus", 361 | "fill": 1, 362 | "fillGradient": 0, 363 | "gridPos": { 364 | "h": 6, 365 | "w": 7, 366 | "x": 17, 367 | "y": 0 368 | }, 369 | "id": 14, 370 | "legend": { 371 | "avg": false, 372 | "current": false, 373 | "max": false, 374 | "min": false, 375 | "show": true, 376 | "total": false, 377 | "values": false 378 | }, 379 | "lines": true, 380 | "linewidth": 1, 381 | "links": [], 382 | "nullPointMode": "null", 383 | "options": { 384 | "dataLinks": [] 385 | }, 386 | "percentage": false, 387 | "pointradius": 5, 388 | "points": false, 389 | "renderer": "flot", 390 | "seriesOverrides": [], 391 | "spaceLength": 10, 392 | "stack": false, 393 | "steppedLine": false, 394 | "targets": [ 395 | { 396 | "expr": "sum(traefik_service_request_duration_seconds_sum{protocol=~\"$protocol\"}) / sum(traefik_entrypoint_requests_total{protocol=~\"$protocol\"}) * 1000", 397 | "format": "time_series", 398 | "intervalFactor": 2, 399 | "legendFormat": "Average response time (ms)", 400 | "refId": "A", 401 | "step": 240 402 | } 403 | ], 404 | "thresholds": [], 405 | "timeFrom": null, 406 | "timeRegions": [], 407 | "timeShift": null, 408 | "title": "Average response time", 409 | "tooltip": { 410 | "shared": true, 411 | "sort": 0, 412 | "value_type": "individual" 413 | }, 414 | "type": "graph", 415 | "xaxis": { 416 | "buckets": null, 417 | "mode": "time", 418 | "name": null, 419 | "show": true, 420 | "values": [] 421 | }, 422 | "yaxes": [ 423 | { 424 | "format": "ms", 425 | "label": null, 426 | "logBase": 10, 427 | "max": null, 428 | "min": "0", 429 | "show": true 430 | }, 431 | { 432 | "format": "short", 433 | "label": null, 434 | "logBase": 1, 435 | "max": null, 436 | "min": null, 437 | "show": true 438 | } 439 | ], 440 | "yaxis": { 441 | "align": false, 442 | "alignLevel": null 443 | } 444 | }, 445 | { 446 | "aliasColors": {}, 447 | "bars": false, 448 | "dashLength": 10, 449 | "dashes": false, 450 | "datasource": "Prometheus", 451 | "decimals": 0, 452 | "fill": 1, 453 | "fillGradient": 0, 454 | "gridPos": { 455 | "h": 6, 456 | "w": 12, 457 | "x": 0, 458 | "y": 6 459 | }, 460 | "id": 10, 461 | "legend": { 462 | "alignAsTable": true, 463 | "avg": false, 464 | "current": false, 465 | "max": false, 466 | "min": false, 467 | "rightSide": true, 468 | "show": true, 469 | "total": false, 470 | "values": false 471 | }, 472 | "lines": true, 473 | "linewidth": 1, 474 | "links": [], 475 | "nullPointMode": "null", 476 | "options": { 477 | "dataLinks": [] 478 | }, 479 | "percentage": false, 480 | "pointradius": 5, 481 | "points": false, 482 | "renderer": "flot", 483 | "seriesOverrides": [], 484 | "spaceLength": 10, 485 | "stack": false, 486 | "steppedLine": false, 487 | "targets": [ 488 | { 489 | "expr": "sum(increase(traefik_service_requests_total{code=\"404\",method=\"GET\",protocol=~\"$protocol\"}[$interval])) by (service)", 490 | "format": "time_series", 491 | "interval": "", 492 | "intervalFactor": 2, 493 | "legendFormat": "{{service}} ", 494 | "refId": "A", 495 | "step": 240 496 | } 497 | ], 498 | "thresholds": [], 499 | "timeFrom": null, 500 | "timeRegions": [], 501 | "timeShift": null, 502 | "title": "Bad Status Code Count $interval", 503 | "tooltip": { 504 | "shared": true, 505 | "sort": 0, 506 | "value_type": "individual" 507 | }, 508 | "type": "graph", 509 | "xaxis": { 510 | "buckets": null, 511 | "mode": "time", 512 | "name": null, 513 | "show": true, 514 | "values": [] 515 | }, 516 | "yaxes": [ 517 | { 518 | "decimals": 0, 519 | "format": "short", 520 | "label": null, 521 | "logBase": 1, 522 | "max": null, 523 | "min": null, 524 | "show": true 525 | }, 526 | { 527 | "format": "short", 528 | "label": null, 529 | "logBase": 1, 530 | "max": null, 531 | "min": null, 532 | "show": false 533 | } 534 | ], 535 | "yaxis": { 536 | "align": false, 537 | "alignLevel": null 538 | } 539 | }, 540 | { 541 | "aliasColors": {}, 542 | "bars": true, 543 | "dashLength": 10, 544 | "dashes": false, 545 | "datasource": "Prometheus", 546 | "fill": 1, 547 | "fillGradient": 0, 548 | "gridPos": { 549 | "h": 6, 550 | "w": 12, 551 | "x": 12, 552 | "y": 6 553 | }, 554 | "hideTimeOverride": false, 555 | "id": 4, 556 | "legend": { 557 | "alignAsTable": true, 558 | "avg": true, 559 | "current": false, 560 | "max": true, 561 | "min": true, 562 | "rightSide": true, 563 | "show": true, 564 | "total": false, 565 | "values": true 566 | }, 567 | "lines": false, 568 | "linewidth": 1, 569 | "links": [], 570 | "nullPointMode": "null", 571 | "options": { 572 | "dataLinks": [] 573 | }, 574 | "percentage": false, 575 | "pointradius": 5, 576 | "points": false, 577 | "renderer": "flot", 578 | "seriesOverrides": [], 579 | "spaceLength": 10, 580 | "stack": false, 581 | "steppedLine": false, 582 | "targets": [ 583 | { 584 | "expr": "sum(rate(traefik_service_requests_total[$interval]))", 585 | "format": "time_series", 586 | "intervalFactor": 2, 587 | "legendFormat": "Total requests", 588 | "refId": "A" 589 | } 590 | ], 591 | "thresholds": [], 592 | "timeFrom": null, 593 | "timeRegions": [], 594 | "timeShift": null, 595 | "title": "Total requests over $interval", 596 | "tooltip": { 597 | "shared": true, 598 | "sort": 0, 599 | "value_type": "individual" 600 | }, 601 | "type": "graph", 602 | "xaxis": { 603 | "buckets": null, 604 | "mode": "time", 605 | "name": null, 606 | "show": true, 607 | "values": [] 608 | }, 609 | "yaxes": [ 610 | { 611 | "decimals": 0, 612 | "format": "short", 613 | "label": null, 614 | "logBase": 1, 615 | "max": null, 616 | "min": null, 617 | "show": true 618 | }, 619 | { 620 | "decimals": 0, 621 | "format": "short", 622 | "label": "", 623 | "logBase": 1, 624 | "max": null, 625 | "min": null, 626 | "show": true 627 | } 628 | ], 629 | "yaxis": { 630 | "align": false, 631 | "alignLevel": null 632 | } 633 | }, 634 | { 635 | "aliasColors": {}, 636 | "bars": false, 637 | "dashLength": 10, 638 | "dashes": false, 639 | "datasource": "Prometheus", 640 | "fill": 1, 641 | "fillGradient": 0, 642 | "gridPos": { 643 | "h": 6, 644 | "w": 10, 645 | "x": 0, 646 | "y": 12 647 | }, 648 | "id": 8, 649 | "legend": { 650 | "avg": false, 651 | "current": false, 652 | "max": false, 653 | "min": false, 654 | "show": true, 655 | "total": false, 656 | "values": false 657 | }, 658 | "lines": true, 659 | "linewidth": 1, 660 | "links": [], 661 | "nullPointMode": "null as zero", 662 | "options": { 663 | "dataLinks": [] 664 | }, 665 | "percentage": false, 666 | "pointradius": 5, 667 | "points": false, 668 | "renderer": "flot", 669 | "seriesOverrides": [], 670 | "spaceLength": 10, 671 | "stack": true, 672 | "steppedLine": false, 673 | "targets": [ 674 | { 675 | "expr": "process_open_fds{job=~\"$job\"}", 676 | "format": "time_series", 677 | "interval": "", 678 | "intervalFactor": 2, 679 | "legendFormat": "{{ instance }}", 680 | "refId": "A", 681 | "step": 240 682 | } 683 | ], 684 | "thresholds": [], 685 | "timeFrom": null, 686 | "timeRegions": [], 687 | "timeShift": null, 688 | "title": "Used sockets", 689 | "tooltip": { 690 | "shared": true, 691 | "sort": 0, 692 | "value_type": "individual" 693 | }, 694 | "type": "graph", 695 | "xaxis": { 696 | "buckets": null, 697 | "mode": "time", 698 | "name": null, 699 | "show": true, 700 | "values": [] 701 | }, 702 | "yaxes": [ 703 | { 704 | "format": "short", 705 | "label": null, 706 | "logBase": 1, 707 | "max": null, 708 | "min": null, 709 | "show": true 710 | }, 711 | { 712 | "format": "short", 713 | "label": null, 714 | "logBase": 1, 715 | "max": null, 716 | "min": null, 717 | "show": true 718 | } 719 | ], 720 | "yaxis": { 721 | "align": false, 722 | "alignLevel": null 723 | } 724 | }, 725 | { 726 | "aliasColors": {}, 727 | "bars": false, 728 | "dashLength": 10, 729 | "dashes": false, 730 | "datasource": "Prometheus", 731 | "decimals": 0, 732 | "fill": 1, 733 | "fillGradient": 0, 734 | "gridPos": { 735 | "h": 6, 736 | "w": 14, 737 | "x": 10, 738 | "y": 12 739 | }, 740 | "id": 24, 741 | "legend": { 742 | "alignAsTable": true, 743 | "avg": true, 744 | "current": true, 745 | "max": false, 746 | "min": false, 747 | "rightSide": true, 748 | "show": true, 749 | "total": true, 750 | "values": true 751 | }, 752 | "lines": true, 753 | "linewidth": 1, 754 | "links": [], 755 | "nullPointMode": "null", 756 | "options": { 757 | "dataLinks": [] 758 | }, 759 | "percentage": false, 760 | "pointradius": 5, 761 | "points": false, 762 | "renderer": "flot", 763 | "seriesOverrides": [], 764 | "spaceLength": 10, 765 | "stack": false, 766 | "steppedLine": false, 767 | "targets": [ 768 | { 769 | "expr": "sum(rate(traefik_service_requests_total{protocol=~\"http|https\",code=\"200\"}[$interval])) by (service)", 770 | "format": "time_series", 771 | "interval": "", 772 | "intervalFactor": 2, 773 | "legendFormat": "{{service}} {{method}} {{code}}", 774 | "refId": "A", 775 | "step": 240 776 | } 777 | ], 778 | "thresholds": [], 779 | "timeFrom": null, 780 | "timeRegions": [], 781 | "timeShift": null, 782 | "title": "Access to backends", 783 | "tooltip": { 784 | "shared": true, 785 | "sort": 0, 786 | "value_type": "individual" 787 | }, 788 | "type": "graph", 789 | "xaxis": { 790 | "buckets": null, 791 | "mode": "time", 792 | "name": null, 793 | "show": true, 794 | "values": [] 795 | }, 796 | "yaxes": [ 797 | { 798 | "decimals": 0, 799 | "format": "short", 800 | "label": null, 801 | "logBase": 1, 802 | "max": null, 803 | "min": null, 804 | "show": true 805 | }, 806 | { 807 | "format": "short", 808 | "label": null, 809 | "logBase": 1, 810 | "max": null, 811 | "min": null, 812 | "show": false 813 | } 814 | ], 815 | "yaxis": { 816 | "align": false, 817 | "alignLevel": null 818 | } 819 | }, 820 | { 821 | "aliasColors": {}, 822 | "bars": false, 823 | "dashLength": 10, 824 | "dashes": false, 825 | "datasource": "Prometheus", 826 | "fill": 7, 827 | "fillGradient": 0, 828 | "gridPos": { 829 | "h": 7, 830 | "w": 12, 831 | "x": 0, 832 | "y": 18 833 | }, 834 | "id": 30, 835 | "legend": { 836 | "alignAsTable": true, 837 | "avg": true, 838 | "current": true, 839 | "max": true, 840 | "min": false, 841 | "rightSide": true, 842 | "show": true, 843 | "sort": "avg", 844 | "sortDesc": true, 845 | "total": false, 846 | "values": true 847 | }, 848 | "lines": true, 849 | "linewidth": 1, 850 | "links": [], 851 | "nullPointMode": "null", 852 | "options": { 853 | "dataLinks": [] 854 | }, 855 | "percentage": false, 856 | "pointradius": 5, 857 | "points": false, 858 | "renderer": "flot", 859 | "seriesOverrides": [], 860 | "spaceLength": 10, 861 | "stack": true, 862 | "steppedLine": false, 863 | "targets": [ 864 | { 865 | "expr": "sum(traefik_entrypoint_open_connections) by (method)", 866 | "format": "time_series", 867 | "intervalFactor": 1, 868 | "legendFormat": "{{ method }}", 869 | "refId": "A" 870 | } 871 | ], 872 | "thresholds": [], 873 | "timeFrom": null, 874 | "timeRegions": [], 875 | "timeShift": null, 876 | "title": "ENTRYPOINT - Open Connections", 877 | "tooltip": { 878 | "shared": true, 879 | "sort": 0, 880 | "value_type": "individual" 881 | }, 882 | "type": "graph", 883 | "xaxis": { 884 | "buckets": null, 885 | "mode": "time", 886 | "name": null, 887 | "show": true, 888 | "values": [] 889 | }, 890 | "yaxes": [ 891 | { 892 | "format": "short", 893 | "label": null, 894 | "logBase": 1, 895 | "max": null, 896 | "min": null, 897 | "show": true 898 | }, 899 | { 900 | "format": "short", 901 | "label": null, 902 | "logBase": 1, 903 | "max": null, 904 | "min": null, 905 | "show": false 906 | } 907 | ], 908 | "yaxis": { 909 | "align": false, 910 | "alignLevel": null 911 | } 912 | }, 913 | { 914 | "aliasColors": {}, 915 | "bars": false, 916 | "dashLength": 10, 917 | "dashes": false, 918 | "datasource": "Prometheus", 919 | "fill": 7, 920 | "fillGradient": 0, 921 | "gridPos": { 922 | "h": 7, 923 | "w": 12, 924 | "x": 12, 925 | "y": 18 926 | }, 927 | "id": 28, 928 | "legend": { 929 | "alignAsTable": true, 930 | "avg": true, 931 | "current": true, 932 | "max": true, 933 | "min": false, 934 | "rightSide": true, 935 | "show": true, 936 | "sort": "avg", 937 | "sortDesc": true, 938 | "total": false, 939 | "values": true 940 | }, 941 | "lines": true, 942 | "linewidth": 1, 943 | "links": [], 944 | "nullPointMode": "null", 945 | "options": { 946 | "dataLinks": [] 947 | }, 948 | "percentage": false, 949 | "pointradius": 5, 950 | "points": false, 951 | "renderer": "flot", 952 | "seriesOverrides": [], 953 | "spaceLength": 10, 954 | "stack": true, 955 | "steppedLine": false, 956 | "targets": [ 957 | { 958 | "expr": "sum(traefik_service_open_connections) by (method)", 959 | "format": "time_series", 960 | "intervalFactor": 1, 961 | "legendFormat": "{{ method }}", 962 | "refId": "A" 963 | } 964 | ], 965 | "thresholds": [], 966 | "timeFrom": null, 967 | "timeRegions": [], 968 | "timeShift": null, 969 | "title": "BACKEND - Open Connections", 970 | "tooltip": { 971 | "shared": true, 972 | "sort": 0, 973 | "value_type": "individual" 974 | }, 975 | "type": "graph", 976 | "xaxis": { 977 | "buckets": null, 978 | "mode": "time", 979 | "name": null, 980 | "show": true, 981 | "values": [] 982 | }, 983 | "yaxes": [ 984 | { 985 | "format": "short", 986 | "label": null, 987 | "logBase": 1, 988 | "max": null, 989 | "min": null, 990 | "show": true 991 | }, 992 | { 993 | "format": "short", 994 | "label": null, 995 | "logBase": 1, 996 | "max": null, 997 | "min": null, 998 | "show": false 999 | } 1000 | ], 1001 | "yaxis": { 1002 | "align": false, 1003 | "alignLevel": null 1004 | } 1005 | }, 1006 | { 1007 | "aliasColors": {}, 1008 | "bars": false, 1009 | "dashLength": 10, 1010 | "dashes": false, 1011 | "datasource": "Prometheus", 1012 | "decimals": 0, 1013 | "fill": 1, 1014 | "fillGradient": 0, 1015 | "gridPos": { 1016 | "h": 7, 1017 | "w": 24, 1018 | "x": 0, 1019 | "y": 25 1020 | }, 1021 | "id": 12, 1022 | "legend": { 1023 | "alignAsTable": true, 1024 | "avg": false, 1025 | "current": false, 1026 | "max": false, 1027 | "min": false, 1028 | "rightSide": true, 1029 | "show": true, 1030 | "total": false, 1031 | "values": false 1032 | }, 1033 | "lines": true, 1034 | "linewidth": 1, 1035 | "links": [], 1036 | "nullPointMode": "null", 1037 | "options": { 1038 | "dataLinks": [] 1039 | }, 1040 | "percentage": false, 1041 | "pointradius": 5, 1042 | "points": false, 1043 | "renderer": "flot", 1044 | "seriesOverrides": [ 1045 | { 1046 | "alias": "/^[^234].*/", 1047 | "transform": "negative-Y" 1048 | } 1049 | ], 1050 | "spaceLength": 10, 1051 | "stack": false, 1052 | "steppedLine": false, 1053 | "targets": [ 1054 | { 1055 | "expr": "sum(increase(traefik_service_requests_total{protocol=~\"$protocol\"}[$interval])) by (code)", 1056 | "format": "time_series", 1057 | "intervalFactor": 2, 1058 | "legendFormat": "{{code}}", 1059 | "refId": "A", 1060 | "step": 120 1061 | } 1062 | ], 1063 | "thresholds": [], 1064 | "timeFrom": null, 1065 | "timeRegions": [], 1066 | "timeShift": null, 1067 | "title": "Status Code Count per $interval", 1068 | "tooltip": { 1069 | "shared": true, 1070 | "sort": 0, 1071 | "value_type": "individual" 1072 | }, 1073 | "type": "graph", 1074 | "xaxis": { 1075 | "buckets": null, 1076 | "mode": "time", 1077 | "name": null, 1078 | "show": true, 1079 | "values": [] 1080 | }, 1081 | "yaxes": [ 1082 | { 1083 | "decimals": 0, 1084 | "format": "short", 1085 | "label": "", 1086 | "logBase": 1, 1087 | "max": null, 1088 | "min": "0", 1089 | "show": true 1090 | }, 1091 | { 1092 | "format": "short", 1093 | "label": null, 1094 | "logBase": 1, 1095 | "max": null, 1096 | "min": null, 1097 | "show": false 1098 | } 1099 | ], 1100 | "yaxis": { 1101 | "align": false, 1102 | "alignLevel": null 1103 | } 1104 | } 1105 | ], 1106 | "refresh": "10s", 1107 | "schemaVersion": 19, 1108 | "style": "dark", 1109 | "tags": [ 1110 | "traefik", 1111 | "load-balancer", 1112 | "docker", 1113 | "prometheus", 1114 | "link" 1115 | ], 1116 | "templating": { 1117 | "list": [ 1118 | { 1119 | "allValue": null, 1120 | "current": {}, 1121 | "datasource": "Prometheus", 1122 | "definition": "", 1123 | "hide": 0, 1124 | "includeAll": false, 1125 | "label": "Job:", 1126 | "multi": false, 1127 | "name": "job", 1128 | "options": [], 1129 | "query": "label_values(job)", 1130 | "refresh": 1, 1131 | "regex": "", 1132 | "skipUrlSync": false, 1133 | "sort": 2, 1134 | "tagValuesQuery": "", 1135 | "tags": [], 1136 | "tagsQuery": "", 1137 | "type": "query", 1138 | "useTags": false 1139 | }, 1140 | { 1141 | "allValue": "traefik", 1142 | "current": {}, 1143 | "datasource": "Prometheus", 1144 | "definition": "", 1145 | "hide": 0, 1146 | "includeAll": false, 1147 | "label": "Node:", 1148 | "multi": false, 1149 | "name": "node", 1150 | "options": [], 1151 | "query": "label_values(process_start_time_seconds, instance)", 1152 | "refresh": 1, 1153 | "regex": "/([^:]+):.*/", 1154 | "skipUrlSync": false, 1155 | "sort": 1, 1156 | "tagValuesQuery": "", 1157 | "tags": [], 1158 | "tagsQuery": "", 1159 | "type": "query", 1160 | "useTags": false 1161 | }, 1162 | { 1163 | "allValue": null, 1164 | "current": {}, 1165 | "datasource": "Prometheus", 1166 | "definition": "label_values(traefik_service_requests_total, protocol)", 1167 | "hide": 0, 1168 | "includeAll": true, 1169 | "label": "Service:", 1170 | "multi": true, 1171 | "name": "protocol", 1172 | "options": [], 1173 | "query": "label_values(traefik_service_requests_total, protocol)", 1174 | "refresh": 1, 1175 | "regex": "", 1176 | "skipUrlSync": false, 1177 | "sort": 0, 1178 | "tagValuesQuery": "", 1179 | "tags": [], 1180 | "tagsQuery": "", 1181 | "type": "query", 1182 | "useTags": false 1183 | }, 1184 | { 1185 | "auto": true, 1186 | "auto_count": 30, 1187 | "auto_min": "10s", 1188 | "current": { 1189 | "text": "30m", 1190 | "value": "30m" 1191 | }, 1192 | "hide": 0, 1193 | "label": "Interval", 1194 | "name": "interval", 1195 | "options": [ 1196 | { 1197 | "selected": false, 1198 | "text": "auto", 1199 | "value": "$__auto_interval_interval" 1200 | }, 1201 | { 1202 | "selected": false, 1203 | "text": "1m", 1204 | "value": "1m" 1205 | }, 1206 | { 1207 | "selected": false, 1208 | "text": "10m", 1209 | "value": "10m" 1210 | }, 1211 | { 1212 | "selected": true, 1213 | "text": "30m", 1214 | "value": "30m" 1215 | }, 1216 | { 1217 | "selected": false, 1218 | "text": "1h", 1219 | "value": "1h" 1220 | }, 1221 | { 1222 | "selected": false, 1223 | "text": "6h", 1224 | "value": "6h" 1225 | }, 1226 | { 1227 | "selected": false, 1228 | "text": "12h", 1229 | "value": "12h" 1230 | }, 1231 | { 1232 | "selected": false, 1233 | "text": "1d", 1234 | "value": "1d" 1235 | }, 1236 | { 1237 | "selected": false, 1238 | "text": "7d", 1239 | "value": "7d" 1240 | }, 1241 | { 1242 | "selected": false, 1243 | "text": "14d", 1244 | "value": "14d" 1245 | }, 1246 | { 1247 | "selected": false, 1248 | "text": "30d", 1249 | "value": "30d" 1250 | } 1251 | ], 1252 | "query": "1m,10m,30m,1h,6h,12h,1d,7d,14d,30d", 1253 | "refresh": 2, 1254 | "skipUrlSync": false, 1255 | "type": "interval" 1256 | } 1257 | ] 1258 | }, 1259 | "time": { 1260 | "from": "now-1h", 1261 | "to": "now" 1262 | }, 1263 | "timepicker": { 1264 | "refresh_intervals": [ 1265 | "5s", 1266 | "10s", 1267 | "30s", 1268 | "1m", 1269 | "5m", 1270 | "15m", 1271 | "30m", 1272 | "1h", 1273 | "2h", 1274 | "1d" 1275 | ], 1276 | "time_options": [ 1277 | "5m", 1278 | "15m", 1279 | "1h", 1280 | "6h", 1281 | "12h", 1282 | "24h", 1283 | "2d", 1284 | "7d", 1285 | "30d" 1286 | ] 1287 | }, 1288 | "timezone": "", 1289 | "title": "traefik", 1290 | "uid": "3ipsWfViz", 1291 | "version": 13, 1292 | "description": "Dashboard for Traefik2/Prometheus" 1293 | } --------------------------------------------------------------------------------