Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#75 Added grafana and prometheus #84

Merged
merged 4 commits into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions botalka/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,16 @@ logging:
web: INFO
group:
r2dbc: org.springframework.r2dbc,org.springframework.data.r2dbc
management:
endpoints:
web:
base-path: /api/v1/monitoring
exposure:
include: health,prometheus
metrics:
export:
prometheus:
enabled: true
distribution:
percentiles-histogram:
"[http.server.requests]": true
3 changes: 3 additions & 0 deletions buildSrc/src/main/kotlin/lms.conventions.spring.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ dependencies {
implementation("org.springframework.boot:spring-boot-starter-data-r2dbc")
runtimeOnly("org.postgresql:r2dbc-postgresql")

implementation("org.springframework.boot:spring-boot-starter-actuator")
implementation("io.micrometer:micrometer-registry-prometheus")

testImplementation("org.springframework.boot:spring-boot-starter-test")
testImplementation("org.springframework.boot:spring-boot-testcontainers")
testImplementation("org.testcontainers:r2dbc:$testcontainersVersion")
Expand Down
23 changes: 23 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,29 @@ services:
POSTGRES_PASSWORD: postgres
networks:
- lms-network
grafana:
container_name: lms-grafana
build:
context: infra/grafana
dockerfile: Dockerfile
ports:
- "3000:3000"
volumes:
- ./infra/grafana/grafana.ini:/etc/grafana/grafana.ini
environment:
- GF_SECURITY_ADMIN_USER=tester@test.test
- GF_SECURITY_ADMIN_PASSWORD=0000
networks:
- lms-network
prometheus:
container_name: lms-prometheus
image: prom/prometheus
ports:
- "9090:9090"
volumes:
- ./infra/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
networks:
- lms-network
fuzzer:
container_name: lms-fuzzer
image: restler
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion fuzzing/fuzz.sh → infra/fuzzing/fuzz.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env sh

RESTler/restler/Restler fuzz \
--settings lms/fuzzing/settings.json \
--settings lms/infra/fuzzing/settings.json \
--grammar_file Compile/grammar.py \
--dictionary_file Compile/dict.json
File renamed without changes.
2 changes: 2 additions & 0 deletions infra/grafana/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
FROM grafana/grafana
ADD ./provisioning /etc/grafana/provisioning
2 changes: 2 additions & 0 deletions infra/grafana/grafana.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[log.console]
level = warn
10 changes: 10 additions & 0 deletions infra/grafana/provisioning/dashboards/all.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: 1
providers:
- name: 'default'
folder: 'default'
type: file
allowUiUpdates: true
updateIntervalSeconds: 30
options:
path: /etc/grafana/provisioning/dashboards
foldersFromFilesStructure: true
Loading
Loading