Skip to content

Commit

Permalink
add prometheus
Browse files Browse the repository at this point in the history
  • Loading branch information
chendelin1982 authored Mar 5, 2024
1 parent b572cfa commit ad76dbd
Show file tree
Hide file tree
Showing 7 changed files with 82 additions and 41 deletions.
17 changes: 12 additions & 5 deletions apps/prometheus/.env
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
W9_DIST=community
W9_REPO=prom/prometheus
W9_VERSION=latest
W9_POWER_PASSWORD=1PrMxExC45LsCT

W9_NAME=prometheus
W9_REPO=
W9_VERSION=latest
W9_HTTP_PORT=9001
W9_NETWORK=websoft9
W9_ID=prometheus
W9_HTTP_PORT_SET=9001
W9_HTTP_PORT=9090

W9_URL=appname.example.com

W9_NETWORK=websoft9

# environments from Prometheus
6 changes: 4 additions & 2 deletions apps/prometheus/Notes.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# Appname
## FAQ
# Prometheus

- exporter is not need, is sometime installed at customer machine
- prometheus.yml is copy from container, and it seem very simple. And you can see the more simple [Configuring Prometheus](https://prometheus.io/docs/introduction/first_steps/#configuring-prometheus)
26 changes: 0 additions & 26 deletions apps/prometheus/README.md

This file was deleted.

30 changes: 26 additions & 4 deletions apps/prometheus/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,43 @@
# image: https://hub.docker.com/r/bitnami/suitecrm
# image and docs: https://hub.docker.com/r/prom/prometheus/
# pushgateway docs: https://github.com/prometheus/pushgateway
# alertmanager docs: https://github.com/prometheus/alertmanager

version: '3.8'

services:
prometheus:
image: $W9_REPO:$W9_VERSION
container_name: $W9_NAME
container_name: $W9_ID
restart: unless-stopped
volumes:
- ./src/prometheus.yml:/etc/prometheus/prometheus.yml
- prometheus:/prometheus
env_file:
- .env
ports:
- '${W9_HTTP_PORT}:8080'
- '${W9_HTTP_PORT_SET}:9090'

prometheus-pushgateway:
image: prom/pushgateway
container_name: $W9_ID-pushgateway
restart: unless-stopped
#ports:
# - '9091:9091'

prometheus-alertmanager:
image: prom/alertmanager
container_name: $W9_ID-alertmanager
restart: unless-stopped
volumes:
- alertmanager:/alertmanager
#ports:
# - '9093:9093'

networks:
default:
name: ${W9_NETWORK}
external: true

volumes:
prometheus:
prometheus:
alertmanager:
3 changes: 3 additions & 0 deletions apps/prometheus/src/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# About

This folder includes files mount to container and used by Websoft9
35 changes: 35 additions & 0 deletions apps/prometheus/src/prometheus.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
global:
scrape_interval: 15s
scrape_timeout: 10s
scrape_protocols:
- OpenMetricsText1.0.0
- OpenMetricsText0.0.1
- PrometheusText0.0.4
evaluation_interval: 15s
alerting:
alertmanagers:
- follow_redirects: true
enable_http2: true
scheme: http
timeout: 10s
api_version: v2
static_configs:
- targets: []
scrape_configs:
- job_name: prometheus
honor_timestamps: true
track_timestamps_staleness: false
scrape_interval: 15s
scrape_timeout: 10s
scrape_protocols:
- OpenMetricsText1.0.0
- OpenMetricsText0.0.1
- PrometheusText0.0.4
metrics_path: /metrics
scheme: http
enable_compression: true
follow_redirects: true
enable_http2: true
static_configs:
- targets:
- localhost:9090
6 changes: 2 additions & 4 deletions apps/prometheus/variables.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
{
"name": "prometheus",
"trademark": "Prometheus",
"release": false,
"release": true,
"fork_url": "https://hub.docker.com/r/prom/prometheus/",
"edition": [
{
"dist": "community",
"version": [
"latest"
]
"version": ["v2.50.1","latest"]
}
],
"requirements": {
Expand Down

0 comments on commit ad76dbd

Please sign in to comment.