Commit dfc40dc5 authored by Pedro Eduardo Trujillo's avatar Pedro Eduardo Trujillo
Browse files

Merge branch 'dev' into 'master'

Pone al día el proyecto y migra a nuevas versiones

See merge request redmic-project/postgres/postgres-exporter!2
parents 767f2aac 84421b44
Loading
Loading
Loading
Loading

.gitignore

deleted100644 → 0
+0 −0

Empty file deleted.

+3 −12
Original line number Diff line number Diff line
include:
  - project: 'redmic-project/gitlab-ci-templates'
    ref: master
    file: '/deployment.yml'
    file: '/deployment-service/docker-deploy.yml'

stages:
  - deploy

.deploy:
  variables:
    STACK: postgres
  IMAGE_NAME: wrouesnel/postgres_exporter
  IMAGE_TAG: latest

.deploy:
  script:
    - >
      deploy.sh IMAGE_NAME=${IMAGE_NAME} IMAGE_TAG=${IMAGE_TAG} DATA_SOURCE_NAME=${DATA_SOURCE_NAME}
      PG_EXPORTER_DISABLE_DEFAULT_METRICS=${PG_EXPORTER_DISABLE_DEFAULT_METRICS}
      PG_EXPORTER_DISABLE_SETTINGS_METRICS=${PG_EXPORTER_DISABLE_SETTINGS_METRICS}
      PG_EXPORTER_CONSTANT_LABELS=${PG_EXPORTER_CONSTANT_LABELS} LOG_LEVEL=${LOG_LEVEL}
+1 −1
Original line number Diff line number Diff line
# Postgres Exporter

Deployment of a PostgresSQL metric exporter for Prometheus
 No newline at end of file
Deployment of a PostgreSQL metric exporter for Prometheus
+8 −4
Original line number Diff line number Diff line
DATA_SOURCE_NAME=postgresql://user:pass@hostname:5432/dbname
PG_EXPORTER_WEB_LISTEN_ADDRESS=:9187
LOG_LEVEL=warn
WEB_LISTEN_ADDRESS=:9187

DATA_SOURCE_URI=hostname:5432/dbname?sslmode=disable
DATA_SOURCE_USER=postgres
DATA_SOURCE_PASS=changeme

PG_EXPORTER_WEB_TELEMETRY_PATH=/metrics
PG_EXPORTER_DISABLE_DEFAULT_METRICS=false
PG_EXPORTER_DISABLE_SETTINGS_METRICS=false
LOG_LEVEL=warn
PG_EXPORTER_DISABLE_SETTINGS_METRICS=true
+13 −13
Original line number Diff line number Diff line
version: '3.5'

services:
  postgres-exporter:
    image: ${IMAGE_NAME:-wrouesnel/postgres_exporter}:${IMAGE_TAG:-latest}
    image: ${IMAGE_NAME:-quay.io/prometheuscommunity/postgres-exporter}:${IMAGE_TAG:-latest}
    command:
      - --web.listen-address=${WEB_LISTEN_ADDRESS}
      - --log.level=${LOG_LEVEL}
    environment:
      DATA_SOURCE_NAME:
      PG_EXPORTER_WEB_LISTEN_ADDRESS:
      DATA_SOURCE_URI:
      DATA_SOURCE_USER:
      DATA_SOURCE_PASS:
      PG_EXPORTER_WEB_TELEMETRY_PATH:
      PG_EXPORTER_DISABLE_DEFAULT_METRICS:
      PG_EXPORTER_DISABLE_SETTINGS_METRICS:
      PG_EXPORTER_CONSTANT_LABELS:
    networks:
      - postgres-net
      - metric-net
    deploy:
      mode: replicated
      replicas: 1
      replicas: ${REPLICAS:-1}
      restart_policy:
        delay: 30s
        window: 1m
        delay: ${RESTART_DELAY:-30s}
      update_config:
        delay: ${UPDATE_DELAY:-1m}
      resources:
        limits:
          cpus: '0.5'
          memory: 64M
          cpus: '${RESOURCES_LIMITS_CPUS:-0.5}'
          memory: ${RESOURCES_LIMITS_MEMORY:-64M}
        reservations:
          cpus: '0.001'
          memory: 32M
          cpus: '${RESOURCES_RESERVATIONS_CPUS:-0.001}'
          memory: ${RESOURCES_RESERVATIONS_MEMORY:-32M}

networks:
  postgres-net:
Loading