Project

General

Profile

Actions

Task #3279

closed

Task #3278: External monitoring service

Add Prometheus support to IdM

Added by Tomáš Doischer about 1 year ago. Updated 6 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Peter Štrunc
Category:
Monitoring
Target version:
Start date:
03/07/2023
Due date:
% Done:

100%

Estimated time:
15.00 h
Owner:

Description

Make sure that the monitoring endpoints are available and work as expected.

Actions #1

Updated by Tomáš Doischer about 1 year ago

  • Sprint set to Sprint 13.1-2 (bře 08 - bře 22)
Actions #2

Updated by Tomáš Doischer about 1 year ago

  • Sprint changed from Sprint 13.1-2 (bře 08 - bře 22) to Sprint 13.1-3 (bře 22 - dub 05)
Actions #3

Updated by Tomáš Doischer about 1 year ago

  • Sprint changed from Sprint 13.1-3 (bře 22 - dub 05) to Sprint 13.1-4 (dub 05 - dub 19)
Actions #4

Updated by Peter Štrunc about 1 year ago

  • Status changed from New to Needs feedback
  • Assignee changed from Peter Štrunc to Tomáš Doischer
  • % Done changed from 0 to 80

Added basic micrometer metrics actuator with Prometheus support. I also needed to rename caches in order for it to work. I also created some custom metrics, but those are not part of the attached PR and will be added in the future.

PR: https://github.com/bcvsolutions/CzechIdMng/pull/377

@doischert could you check it out, please?

Actions #5

Updated by Peter Štrunc about 1 year ago

Here is a sample compose file with Prometheus config

docker-compose.yml

services:
  prometheus:
    image: prom/prometheus:v2.35.0
    container_name: prometheus
    restart: unless-stopped
    volumes:
      - ./config:/etc/prometheus/
    command:
      - '--config.file=/etc/prometheus/prometheus.yaml'
    ports:
      - "9090:9090" 
  grafana:
    image: grafana/grafana-oss:8.5.2
    pull_policy: always
    container_name: grafana
    restart: unless-stopped
    ports:
      - "3005:3000" 
    volumes:
      - ./data/grafana:/var/lib/grafana
    environment:
      - GF_SECURITY_ADMIN_PASSWORD=admin
      - GF_SERVER_DOMAIN=localhost

prometheus.yaml

scrape_configs:
  - job_name: 'Idm metrics input'
    metrics_path: '/idm-backend/actuator/prometheus'
    scrape_interval: 2s
    static_configs:
      - targets: ['host.docker.internal:8080']
        labels:
          application: 'Idm'
    basic_auth:
      username: 'metrics'
      password: 'metricsmetrics'

Folder structure should look something like this:

.
└── prometheus
    ├── config
    │   └── prometheus.yaml
    ├── data
    └── docker-compose.yml
Actions #6

Updated by Tomáš Doischer about 1 year ago

  • Status changed from Needs feedback to Resolved
Actions #7

Updated by Tomáš Doischer about 1 year ago

  • Assignee changed from Tomáš Doischer to Peter Štrunc
  • % Done changed from 80 to 100

Merged to develop.

Actions #8

Updated by Peter Štrunc 6 months ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF