Loading .gitignoredeleted 100644 → 0 +0 −0 Empty file deleted. .gitlab-ci.yml +8 −11 Original line number Diff line number Diff line Loading @@ -8,26 +8,23 @@ stages: - deploy variables: DOCKER_IMAGE: docker:stable DIND_IMAGE: docker:dind STACK: metric STATUS_CHECK_DELAY: 200 IMAGE_NAME: prom/prometheus IMAGE_TAG: v2.8.0 PROJECT_PARENT_NAME: metric check-rules: stage: test image: ${DOCKER_IMAGE} variables: DOCKER_IMAGE: docker:stable DIND_IMAGE: docker:dind services: - ${DIND_IMAGE} script: - ./check-rules.sh .deploy: script: - > deploy.sh IMAGE_NAME=${IMAGE_NAME} IMAGE_TAG=${IMAGE_TAG} COMPOSE_FILE=${COMPOSE_FILE} UI_AUTH=${UI_AUTH} PUBLIC_HOSTNAME=${PUBLIC_HOSTNAME} JOBS=${JOBS} STORAGE_TSDB_RETENTION_TIME=${STORAGE_TSDB_RETENTION_TIME} STORAGE_TSDB_RETENTION_SIZE=${STORAGE_TSDB_RETENTION_SIZE} variables: STACK: ${PROJECT_PARENT_NAME} SERVICES_TO_CHECK: ${PROJECT_PARENT_NAME}_${CI_PROJECT_NAME} STATUS_CHECK_DELAY: 200 environment: url: https://${CI_PROJECT_NAME}.${PUBLIC_HOSTNAME} README.md +2 −2 Original line number Diff line number Diff line Loading @@ -6,7 +6,7 @@ Set `JOBS` environment variable with a string of service scrape definitions, sep Single scrape definition follow this syntax: ``` ```sh <serviceName>:<port>[<metricsPath>][;[<scrapeInterval>][;[<scrapeTimeout>]]] ``` Loading @@ -22,7 +22,7 @@ Each service scrape definition can contains 5 parameters (**bold** ones are mand Consider 3 services to scrape: ``` ```sh JOBS=service1:8080,service2:8000/metrics-path;60;30,service3:3000;;20 ``` Loading deploy/.env +8 −0 Original line number Diff line number Diff line STORAGE_TSDB_RETENTION_TIME=30d STORAGE_TSDB_RETENTION_SIZE=8GB PORT=9090 DATA_PATH=/prometheus CONFIG_PATH=/etc/prometheus INITIAL_CONFIG_FILENAME=prometheus-config.yml FINAL_CONFIG_FILENAME=prometheus.yml ENTRYPOINT_FILENAME=entrypoint.sh DATA_VOL_NAME=prometheus-vol NODE_RULES_NAME=node_rules deploy/conf/entrypoint.sh +4 −4 Original line number Diff line number Diff line #!/bin/sh -e cat /etc/prometheus/prometheus-conf.yml > /tmp/prometheus.yml cat ${CONFIG_PATH}/${INITIAL_CONFIG_FILENAME} > /tmp/prometheus.yml if [ ${JOBS:+x} ] then Loading Loading @@ -31,12 +31,12 @@ EOF done fi if ls /etc/prometheus/*.rules.yml > /dev/null 2> /dev/null if ls ${CONFIG_PATH}/*.rules.yml > /dev/null 2> /dev/null then echo "Adding rules file" echo "rule_files:" >> /tmp/prometheus.yml for f in /etc/prometheus/*.rules.yml for f in ${CONFIG_PATH}/*.rules.yml do if [ -e "${f}" ] then Loading @@ -47,7 +47,7 @@ then done fi mv /tmp/prometheus.yml /etc/prometheus/prometheus.yml mv /tmp/prometheus.yml ${CONFIG_PATH}/${FINAL_CONFIG_FILENAME} set -- /bin/prometheus "$@" Loading Loading
.gitlab-ci.yml +8 −11 Original line number Diff line number Diff line Loading @@ -8,26 +8,23 @@ stages: - deploy variables: DOCKER_IMAGE: docker:stable DIND_IMAGE: docker:dind STACK: metric STATUS_CHECK_DELAY: 200 IMAGE_NAME: prom/prometheus IMAGE_TAG: v2.8.0 PROJECT_PARENT_NAME: metric check-rules: stage: test image: ${DOCKER_IMAGE} variables: DOCKER_IMAGE: docker:stable DIND_IMAGE: docker:dind services: - ${DIND_IMAGE} script: - ./check-rules.sh .deploy: script: - > deploy.sh IMAGE_NAME=${IMAGE_NAME} IMAGE_TAG=${IMAGE_TAG} COMPOSE_FILE=${COMPOSE_FILE} UI_AUTH=${UI_AUTH} PUBLIC_HOSTNAME=${PUBLIC_HOSTNAME} JOBS=${JOBS} STORAGE_TSDB_RETENTION_TIME=${STORAGE_TSDB_RETENTION_TIME} STORAGE_TSDB_RETENTION_SIZE=${STORAGE_TSDB_RETENTION_SIZE} variables: STACK: ${PROJECT_PARENT_NAME} SERVICES_TO_CHECK: ${PROJECT_PARENT_NAME}_${CI_PROJECT_NAME} STATUS_CHECK_DELAY: 200 environment: url: https://${CI_PROJECT_NAME}.${PUBLIC_HOSTNAME}
README.md +2 −2 Original line number Diff line number Diff line Loading @@ -6,7 +6,7 @@ Set `JOBS` environment variable with a string of service scrape definitions, sep Single scrape definition follow this syntax: ``` ```sh <serviceName>:<port>[<metricsPath>][;[<scrapeInterval>][;[<scrapeTimeout>]]] ``` Loading @@ -22,7 +22,7 @@ Each service scrape definition can contains 5 parameters (**bold** ones are mand Consider 3 services to scrape: ``` ```sh JOBS=service1:8080,service2:8000/metrics-path;60;30,service3:3000;;20 ``` Loading
deploy/.env +8 −0 Original line number Diff line number Diff line STORAGE_TSDB_RETENTION_TIME=30d STORAGE_TSDB_RETENTION_SIZE=8GB PORT=9090 DATA_PATH=/prometheus CONFIG_PATH=/etc/prometheus INITIAL_CONFIG_FILENAME=prometheus-config.yml FINAL_CONFIG_FILENAME=prometheus.yml ENTRYPOINT_FILENAME=entrypoint.sh DATA_VOL_NAME=prometheus-vol NODE_RULES_NAME=node_rules
deploy/conf/entrypoint.sh +4 −4 Original line number Diff line number Diff line #!/bin/sh -e cat /etc/prometheus/prometheus-conf.yml > /tmp/prometheus.yml cat ${CONFIG_PATH}/${INITIAL_CONFIG_FILENAME} > /tmp/prometheus.yml if [ ${JOBS:+x} ] then Loading Loading @@ -31,12 +31,12 @@ EOF done fi if ls /etc/prometheus/*.rules.yml > /dev/null 2> /dev/null if ls ${CONFIG_PATH}/*.rules.yml > /dev/null 2> /dev/null then echo "Adding rules file" echo "rule_files:" >> /tmp/prometheus.yml for f in /etc/prometheus/*.rules.yml for f in ${CONFIG_PATH}/*.rules.yml do if [ -e "${f}" ] then Loading @@ -47,7 +47,7 @@ then done fi mv /tmp/prometheus.yml /etc/prometheus/prometheus.yml mv /tmp/prometheus.yml ${CONFIG_PATH}/${FINAL_CONFIG_FILENAME} set -- /bin/prometheus "$@" Loading