Skip to content

Commit

Permalink
init: init monitoring system based local
Browse files Browse the repository at this point in the history
  • Loading branch information
thguss committed Sep 6, 2024
1 parent 22d0243 commit 14af097
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 0 deletions.
26 changes: 26 additions & 0 deletions docker/monitoring/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
version: '3.8'

services:
prometheus:
image: prom/prometheus:latest
container_name: prometheus
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml
command:
- --config.file=/etc/prometheus/prometheus.yml
ports:
- "9090:9090"
networks:
- monitoring-network

grafana:
image: grafana/grafana:latest
container_name: grafana
ports:
- "3000:3000"
networks:
- monitoring-network

networks:
monitoring-network:
driver: bridge
8 changes: 8 additions & 0 deletions docker/monitoring/prometheus.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
global:
scrape_interval: 15s

scrape_configs:
- job_name: prometheus
metrics_path: '/actuator/prometheus'
static_configs:
- targets: ['host.docker.internal:8080']
1 change: 1 addition & 0 deletions smeem-bootstrap/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ dependencies {

implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-actuator'
runtimeOnly 'io.micrometer:micrometer-registry-prometheus'
}

tasks.bootJar {
Expand Down
5 changes: 5 additions & 0 deletions smeem-bootstrap/src/main/resources/application-actuator.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
management:
endpoints:
web:
exposure:
include: info, health, metrics, prometheus
8 changes: 8 additions & 0 deletions smeem-bootstrap/src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
spring:
config:
import:
- classpath:application-actuator.yml
application:
name: "smeem"
messages:
encoding: UTF-8
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ private void setHttp(HttpSecurity http) throws Exception {
.requestMatchers(new AntPathRequestMatcher("/api/v2/plans")).permitAll()
.requestMatchers(new AntPathRequestMatcher("/favicon.ico")).permitAll()
.requestMatchers(new AntPathRequestMatcher("/error")).permitAll()
.requestMatchers(new AntPathRequestMatcher("/actuator/**")).permitAll()
.anyRequest().authenticated())
.addFilterBefore(jwtAuthenticationFilter, UsernamePasswordAuthenticationFilter.class);
}
Expand Down

0 comments on commit 14af097

Please sign in to comment.