ein wenig aufgeräumt
This commit is contained in:
+1
-1
@@ -7,4 +7,4 @@ POSTGRES_DB=mypingtest
|
||||
DEBUG=true
|
||||
|
||||
# JVM Configuration
|
||||
JAVA_OPTS=-Xmx1g -XX:+UseG1GC -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005
|
||||
JAVA_OPTS='-Xmx1g -XX:+UseG1GC -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005'
|
||||
|
||||
@@ -20,7 +20,7 @@ services:
|
||||
SERVER_PORT: ${PING_SERVICE_PORT:-8082}
|
||||
CONSUL_HOST: consul
|
||||
CONSUL_PORT: ${CONSUL_PORT:-8500}
|
||||
CONSUL_ENABLED: ${CONSUL_ENABLED:-true}
|
||||
CONSUL_ENABLED: true
|
||||
DB_HOST: postgres
|
||||
DB_PORT: 5432
|
||||
DB_NAME: ${POSTGRES_DB:-meldestelle}
|
||||
|
||||
+2
-2
@@ -67,7 +67,7 @@ services:
|
||||
KC_DB_USERNAME: ${POSTGRES_USER:-meldestelle}
|
||||
KC_DB_PASSWORD: ${POSTGRES_PASSWORD:-meldestelle}
|
||||
ports:
|
||||
- "8180:8080"
|
||||
- "8180:8081"
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
@@ -77,7 +77,7 @@ services:
|
||||
networks:
|
||||
- meldestelle-network
|
||||
healthcheck:
|
||||
test: [ "CMD", "curl", "--fail", "http://localhost:8080/health/ready" ]
|
||||
test: [ "CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:8081/" ]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 3
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
# Prometheus configuration for Meldestelle project
|
||||
# Basic configuration to enable service monitoring
|
||||
|
||||
global:
|
||||
scrape_interval: 15s
|
||||
evaluation_interval: 15s
|
||||
|
||||
rule_files:
|
||||
# - "first_rules.yml"
|
||||
# - "second_rules.yml"
|
||||
|
||||
scrape_configs:
|
||||
# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
|
||||
- job_name: 'prometheus'
|
||||
static_configs:
|
||||
- targets: ['localhost:9090']
|
||||
|
||||
# Monitor API Gateway
|
||||
- job_name: 'api-gateway'
|
||||
metrics_path: '/actuator/prometheus'
|
||||
static_configs:
|
||||
- targets: ['api-gateway:8081']
|
||||
scrape_interval: 30s
|
||||
|
||||
# Monitor other services if they expose metrics
|
||||
- job_name: 'postgres-exporter'
|
||||
static_configs:
|
||||
- targets: ['postgres:5432']
|
||||
scrape_interval: 30s
|
||||
metrics_path: '/metrics'
|
||||
|
||||
# Add consul for service discovery monitoring
|
||||
- job_name: 'consul'
|
||||
static_configs:
|
||||
- targets: ['consul:8500']
|
||||
metrics_path: '/v1/agent/metrics'
|
||||
params:
|
||||
format: ['prometheus']
|
||||
@@ -86,6 +86,11 @@ ARG VERSION=1.0.0
|
||||
ARG JAVA_VERSION=21
|
||||
ARG SPRING_PROFILES_ACTIVE=default
|
||||
|
||||
# Convert build arguments to environment variables
|
||||
ENV JAVA_VERSION=${JAVA_VERSION} \
|
||||
VERSION=${VERSION} \
|
||||
BUILD_DATE=${BUILD_DATE}
|
||||
|
||||
# Add comprehensive metadata
|
||||
LABEL service="ping-service" \
|
||||
version="${VERSION}" \
|
||||
|
||||
@@ -3,9 +3,10 @@ spring:
|
||||
name: ping-service
|
||||
cloud:
|
||||
consul:
|
||||
host: localhost
|
||||
port: 8500
|
||||
host: ${CONSUL_HOST:localhost}
|
||||
port: ${CONSUL_PORT:8500}
|
||||
discovery:
|
||||
enabled: true
|
||||
register: true
|
||||
health-check-path: /actuator/health
|
||||
health-check-interval: 10s
|
||||
|
||||
Reference in New Issue
Block a user