Дерево страниц
Перейти к концу метаданных
Переход к началу метаданных

Описание


Сервис eltex-jobs выполняет формирование задачи с необходимыми параметрами и отправку отчета пользователю по команде от сервиса bruce. Параметры задачи хранятся в базе данных MariaDB. 

Для корректной работы сервиса необходим доступ до сервиса eltex-ngw с настроенным email-шлюзом.

Установка


Сервис устанавливается с помощью пакетного менеджера командой

apt install eltex-jobs

Настройка


Конфигурационный файл для настройки доступен по пути /etc/eltex-jobs/application.properties

application.properties
# порт используемый сервисом
server.port=9696
spring.batch.job.enabled=false

spring.flyway.enabled=true
# URL для подключения к mariadb
spring.flyway.url=jdbc:mysql://localhost:3306/eltex_jobs
#Логин и пароль для подключения
spring.flyway.user=javauser
spring.flyway.password=javapassword

spring.datasource.jdbcUrl=jdbc:h2:mem:testdb;DB_CLOSE_ON_EXIT=FALSE
spring.datasource.driverClassName=org.h2.Driver
spring.datasource.username=sa
spring.datasource.password=
spring.datasource.maximum-pool-size=200
spring.datasource.poolName=h2-pool
spring.h2.console.enabled=false

# адрес базы данных ems и имя драйвера
spring.jobsdatasource.jdbcUrl=jdbc:mysql://127.0.0.1/eltex_jobs?zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf8&relaxAutoCommit=true&connectTimeout=5000
spring.jobsdatasource.driverClassName=com.mysql.cj.jdbc.Driver
# логин и пароль для подключения к бд ems
spring.jobsdatasource.poolName=jobs-pool
spring.jobsdatasource.username=javauser
spring.jobsdatasource.password=javapassword

spring.emsdatasource.jdbcUrl=jdbc:mysql://127.0.0.1/eltex_ems?zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf8&relaxAutoCommit=true&connectTimeout=5000&useSSL=false
spring.emsdatasource.driverClassName=com.mysql.cj.jdbc.Driver
spring.emsdatasource.username=javauser
spring.emsdatasource.password=javapassword
# ConnectionTimeout property controls the maximum number of milliseconds that a client (that's you) will wait for a connection from the pool.
spring.emsdatasource.connection-timeout=15000
# ValidationTimeout property controls the maximum amount of time that a connection will be tested for aliveness.
spring.emsdatasource.validation-timeout=3000
# IdleTimeout property controls the maximum amount of time that a connection is allowed to sit idle in the pool.
spring.emsdatasource.idle-timeout=30000
# MinimumIdle property controls the minimum number of idle connections that HikariCP tries to maintain in the pool.
spring.emsdatasource.minimum-idle=1
# Maximum size of connection pool
spring.emsdatasource.maximum-pool-size=48
spring.emsdatasource.poolName=ems-pool

# адрес сервиса ngw
services.ngw.host=localhost
# порт сервиса ngw
services.ngw.port=8040
services.ngw.retries=1
# ограничение размера сообщения для NGW в байтах
services.ngw.attachment.maxSize=10000000

services.report.allSessions.compress=true

# адрес базы данных radius для Clickhouse(раскоментировать при переходе на Clickhouse)
#spring.radiusdatasource.jdbcUrl=jdbc:clickhouse://localhost:8123/radius?zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf8&relaxAutoCommit=true&connectTimeout=5000
# имя драйвера для Clickhouse(раскоментировать при переходе на Clickhouse)
#spring.radiusdatasource.driverClassName=ru.yandex.clickhouse.ClickHouseDriver
# адрес базы данных radius для MySQL(закоментировать при переходе на MySQL)
spring.radiusdatasource.jdbcUrl=jdbc:mysql://localhost/radius?zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf8&relaxAutoCommit=true&connectTimeout=5000
# имя драйвера для MySQL(закоментировать при переходе на MySQL)
spring.radiusdatasource.driverClassName=com.mysql.cj.jdbc.Driver
# логин для подключения к бд radius
spring.radiusdatasource.username=javauser
# пароль для подключения к бд radius
spring.radiusdatasource.password=javapassword

management.health.defaults.enabled=true
management.endpoints.web.exposure.include=health, beans, prometheus, env, threaddump, heapdump, metrics, httptrace
management.endpoint.health.enabled=true

Докеризация сервиса


Сервис может быть запущен в docker-контейнере. Для этого необходимо подготовить файл с переменными окружения .env и docker-compose.yml.

docker-compose.yml
version: "3"
services:
  eltex-jobs:
    container_name: eltex-jobs
    ports:
      # Проброс порта из контейнера на хост. На этот порт обращается Eltex-Bruce.
      - 9696:${SERVER_PORT}
	image: ${ELTEX_HUB}/eltex-jobs:${SWLC_VERSION}
    environment:
      # Порт на котором поднят сервис внутри контейнера. По-умолчанию 9696
      - SERVER_PORT=${SERVER_PORT}
      - SPRING_BATCH_JOB_ENABLED=${SPRING_BATCH_JOB_ENABLED}
      - SPRING_DATASOURCE_JDBCURL=${SPRING_DATASOURCE_JDBCURL}
      - SPRING_DATASOURCE_DRIVERCLASSNAME=${SPRING_DATASOURCE_DRIVERCLASSNAME}
      - SPRING_DATASOURCE_USERNAME=${SPRING_DATASOURCE_USERNAME}
      - SPRING_DATASOURCE_PASSWORD=${SPRING_DATASOURCE_PASSWORD}
      - SPRING_DATASOURCE_MAXIMUMPOOLSIZE=${SPRING_DATASOURCE_MAXIMUMPOOLSIZE}
      - SPRING_H2_CONSOLE_ENABLED=${SPRING_H2_CONSOLE_ENABLED}
      # Параметры миграции БД
      - SPRING_FLYWAY_ENABLED=${SPRING_FLYWAY_ENABLED}
      - SPRING_FLYWAY_URL=${SPRING_FLYWAY_URL}
      - SPRING_FLYWAY_USER=${SPRING_FLYWAY_USER}
      - SPRING_FLYWAY_PASSWORD=${SPRING_FLYWAY_PASSWORD}
      # Подключение к БД
      - SPRING_JOBSDATASOURCE_JDBCURL=${SPRING_JOBSDATASOURCE_JDBCURL}
      - SPRING_JOBSDATASOURCE_DRIVERCLASSNAME=${SPRING_JOBSDATASOURCE_DRIVERCLASSNAME}
      - SPRING_JOBSDATASOURCE_POOLNAME=${SPRING_JOBSDATASOURCE_POOLNAME}
      - SPRING_JOBSDATASOURCE_USERNAME=${SPRING_JOBSDATASOURCE_USERNAME}
      - SPRING_JOBSDATASOURCE_PASSWORD=${SPRING_JOBSDATASOURCE_PASSWORD}
      # JDBC-адрес подключения до БД eltex_ems
      - SPRING_EMSDATASOURCE_JDBCURL=${SPRING_EMSDATASOURCE_JDBCURL}
      - SPRING_EMSDATASOURCE_DRIVERCLASSNAME=${SPRING_EMSDATASOURCE_DRIVERCLASSNAME}
      # Логин от БД eltex_ems
      - SPRING_EMSDATASOURCE_USERNAME=${SPRING_EMSDATASOURCE_USERNAME}
      # Пароль от БД eltex_ems
      - SPRING_EMSDATASOURCE_PASSWORD=${SPRING_EMSDATASOURCE_PASSWORD}
      - SPRING_EMSDATASOURCE_CONNECTIONTIMEOUT=${SPRING_EMSDATASOURCE_CONNECTIONTIMEOUT}
      - SPRING_EMSDATASOURCE_VALIDATIONTIMEOUT=${SPRING_EMSDATASOURCE_VALIDATIONTIMEOUT}
      - SPRING_EMSDATASOURCE_IDLETIMEOUT=${SPRING_EMSDATASOURCE_IDLETIMEOUT}
      - SPRING_EMSDATASOURCE_MINIMUMIDLE=${SPRING_EMSDATASOURCE_MINIMUMIDLE}
      - SPRING_EMSDATASOURCE_MAXIMUMPOOLSIZE=${SPRING_EMSDATASOURCE_MAXIMUMPOOLSIZE}
      # Адрес хоста NGW
      - SERVICES_NGW_HOST=${SERVICES_NGW_HOST}
      # Адрес порта NGW
      - SERVICES_NGW_PORT=${SERVICES_NGW_PORT}
      - SERVICES_NGW_RETRIES=${SERVICES_NGW_RETRIES}
      - SERVICES_NGW_ATTACHMENT_MAXSIZE=${SERVICES_NGW_ATTACHMENT_MAXSIZE}
      - SERVICES_REPORT_ALLSESSIONS_COMPRESS=${SERVICES_REPORT_ALLSESSIONS_COMPRESS}
      # JDBC-адрес подключения до БД radius
      - SPRING_RADIUSDATASOURCE_JDBCURL=${SPRING_RADIUSDATASOURCE_JDBCURL}
      - SPRING_RADIUSDATASOURCE_DRIVERCLASSNAME=${SPRING_RADIUSDATASOURCE_DRIVERCLASSNAME}
      # Логин от БД radius
      - SPRING_RADIUSDATASOURCE_USERNAME=${SPRING_RADIUSDATASOURCE_USERNAME}
      # Пароль от БД radius
      - SPRING_RADIUSDATASOURCE_PASSWORD=${SPRING_RADIUSDATASOURCE_PASSWORD}
      - GELF_LEVEL=${GELF_LEVEL}
      - GELF_HOST=${GELF_HOST}
      - GELF_PORT=${GELF_PORT}
      - JOBS_LOG_LEVEL=${JOBS_LOG_LEVEL}
      - JOBS_CONSOLE_LEVEL=${JOBS_CONSOLE_LEVEL}
      - TZ=${TZ}
.env
ELTEX_HUB=hub.eltex-co.ru/softwlc
# Common version number
SWLC_VERSION=1.30-<tag>
SERVER_PORT=9696

SERVICES_NGW_ATTACHMENT_MAXSIZE=10000000
SERVICES_NGW_HOST=<ip_ngw_service>
SERVICES_NGW_PORT=8040
SERVICES_NGW_RETRIES=1
SERVICES_REPORT_ALLSESSIONS_COMPRESS=true
SPRING_BATCH_JOB_ENABLED=false
 
# Настройки подключения к БД eltex_jobs для Flyway
SPRING_FLYWAY_ENABLED=true
SPRING_FLYWAY_URL=jdbc:mysql://<ip_mysql_server>/eltex_jobs
SPRING_FLYWAY_USER=javauser
SPRING_FLYWAY_PASSWORD=javapassword
 
SPRING_DATASOURCE_DRIVERCLASSNAME=org.h2.Driver
SPRING_DATASOURCE_JDBCURL=jdbc:h2:mem:testdb;DB_CLOSE_ON_EXIT=FALSE
SPRING_DATASOURCE_MAXIMUMPOOLSIZE=200
SPRING_DATASOURCE_PASSWORD=
SPRING_DATASOURCE_USERNAME=sa
 
# Настройка подключения к БД eltex_jobs
SPRING_JOBSDATASOURCE_JDBCURL=jdbc:mysql://<ip_mysql_server>/eltex_jobs?zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf8&relaxAutoCommit=true&connectTimeout=5000
SPRING_JOBSDATASOURCE_DRIVERCLASSNAME=com.mysql.cj.jdbc.Driver
SPRING_JOBSDATASOURCE_POOLNAME=jobs-pool
SPRING_JOBSDATASOURCE_USERNAME=javauser
SPRING_JOBSDATASOURCE_PASSWORD=javapassword
 
# Настройка подключения к БД eltex_ems
SPRING_EMSDATASOURCE_CONNECTIONTIMEOUT=15000
SPRING_EMSDATASOURCE_DRIVERCLASSNAME=com.mysql.cj.jdbc.Driver
SPRING_EMSDATASOURCE_IDLETIMEOUT=30000
SPRING_EMSDATASOURCE_JDBCURL=jdbc:mysql://<ip_mysql_server>/eltex_ems?zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf8&relaxAutoCommit=true&connectTimeout=5000
SPRING_EMSDATASOURCE_MAXIMUMPOOLSIZE=48
SPRING_EMSDATASOURCE_MINIMUMIDLE=1
SPRING_EMSDATASOURCE_PASSWORD=javapassword
SPRING_EMSDATASOURCE_USERNAME=javauser
SPRING_EMSDATASOURCE_VALIDATIONTIMEOUT=3000
 
SPRING_H2_CONSOLE_ENABLED=true
 
# Настройка подключения к БД radius
SPRING_RADIUSDATASOURCE_DRIVERCLASSNAME=com.mysql.cj.jdbc.Driver
SPRING_RADIUSDATASOURCE_JDBCURL=jdbc:mysql://<ip_mysql_server>/radius?zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf8&relaxAutoCommit=true&connectTimeout=5000
SPRING_RADIUSDATASOURCE_PASSWORD=javapassword
SPRING_RADIUSDATASOURCE_USERNAME=javauser
 
# Настройка перенаправления логов в Graylog
GELF_HOST=udp:<ip_graylog_server>
GELF_PORT=12201
GELF_LEVEL=OFF
 
# Настройка логгирования
JOBS_CONSOLE_LEVEL=INFO
JOBS_LOG_LEVEL=INFO
 
#Настройка часового пояса
TZ=Asia/Novosibirsk

Вместо <tag> необходимо указать актуальную версию, которую можно посмотреть по ссылке.

Вместо <ip_ngw_service> необходимо указать ip-адрес сервиса NGW.

Вместо <ip_mysql_server> необходимо указать ip-адрес сервера MariaDB.

Вместо <ip_graylog_server> необходимо указать ip-адрес сервера Graylog (либо указать localhost, если не планируется использовать отправку логов)

Описание переменных (environment)

Запуск сервиса

  • SERVER_PORT - порт, на котором сервис будет работать внутри контейнера;

  • ELTEX_HUB - URL репозитория Элтекс;

  • SWLC_VERSION - версия образа;

Подключение к сервису NGW

  • SERVICES_NGW_HOST - ip-адрес сервиса NGW;

  • SERVICES_NGW_PORT - порт, на котором работает сервис NGW;

Подключение к БД eltex_jobs для миграции данных (MariaDB)

  • SPRING_FLYWAY_ENABLED - Нужно ли выполнить миграцию данных;
  • SPRING_FLYWAY_URL - jdbc-адрес для подключения к БД radius;
  • SPRING_FLYWAY_USER - Логин подключения к БД;
  • SPRING_FLYWAY_PASSWORD - Пароль подключения к БД;

Подключение к БД eltex_jobs (MariaDB)

  • SPRING_RADIUSDATASOURCE_JDBCURL - jdbc-адрес для подключения к БД radius;
  • SPRING_JOBSDATASOURCE_USERNAME - Логин подключения к БД;
  • SPRING_JOBSDATASOURCE_PASSWORD - Пароль подключения к БД;

Подключение к БД eltex_ems (MariaDB)

  • SPRING_JOBSDATASOURCE_JDBCURL - jdbc-адрес подключения к БД eltex_jobs;

  • SPRING_EMSDATASOURCE_USERNAME - Логин подключения к БД;

  • SPRING_EMSDATASOURCE_PASSWORD - Пароль подключения к БД;

Подключение к БД radius (MariaDB)

  • SPRING_RADIUSDATASOURCE_JDBCURL - jdbc-адрес для подключения к БД radius;

  • SPRING_RADIUSDATASOURCE_USERNAME - Логин подключения к БД;

  • SPRING_RADIUSDATASOURCE_PASSWORD - Пароль подключения к БД;

Параметры логирования

  • JOBS_CONSOLE_LOG_LEVEL - уровень логирования сервиса в консоль;

  • JOBS_LOG_LEVEL - уровень логирования сервиса;

Настройка перенаправления логов на сервер Graylog

  • GELF_LEVEL - уровень логов, перенаправляемых в Graylog;

  • GELF_HOST - адрес хоста Graylog;

  • GELF_PORT - порт хоста Graylog.

Настройка часового пояса

  • TZ - часовой пояс в формате Asia/Novosibirsk (список существующих можно посмотреть командой timedatectl list-timezones).


Файлы .env и docker-compose.yml должны находиться в одной папке. Контейнер запускается командой:

command
docker compose up -d

Метрики сервиса

Метрики сервиса доступны по адресу:

http://<IP-адрес eltex-jobs>:9696/actuator/prometheus
Пример вывода метрик
# HELP process_cpu_usage The "recent cpu usage" for the Java Virtual Machine process
# TYPE process_cpu_usage gauge
process_cpu_usage{application="jobs",} 0.009693053311793215
# HELP jvm_threads_live_threads The current number of live threads including both daemon and non-daemon threads
# TYPE jvm_threads_live_threads gauge
jvm_threads_live_threads{application="jobs",} 33.0
# HELP system_load_average_1m The sum of the number of runnable entities queued to available processors and the number of runnable entities running on the available processors averaged over a period of time
# TYPE system_load_average_1m gauge
system_load_average_1m{application="jobs",} 0.45
# HELP hikaricp_connections_usage_seconds Connection usage time
# TYPE hikaricp_connections_usage_seconds summary
hikaricp_connections_usage_seconds_count{application="jobs",pool="h2-pool",} 82.0
hikaricp_connections_usage_seconds_sum{application="jobs",pool="h2-pool",} 8.173
hikaricp_connections_usage_seconds_count{application="jobs",pool="ems-pool",} 2.0
hikaricp_connections_usage_seconds_sum{application="jobs",pool="ems-pool",} 6.574
# HELP hikaricp_connections_usage_seconds_max Connection usage time
# TYPE hikaricp_connections_usage_seconds_max gauge
hikaricp_connections_usage_seconds_max{application="jobs",pool="h2-pool",} 0.55
hikaricp_connections_usage_seconds_max{application="jobs",pool="ems-pool",} 0.519
# HELP process_start_time_seconds Start time of the process since unix epoch.
# TYPE process_start_time_seconds gauge
process_start_time_seconds{application="jobs",} 1.693538503052E9
# HELP hikaricp_connections_active Active connections
# TYPE hikaricp_connections_active gauge
hikaricp_connections_active{application="jobs",pool="h2-pool",} 0.0
hikaricp_connections_active{application="jobs",pool="ems-pool",} 0.0
# HELP jdbc_connections_min Minimum number of idle connections in the pool.
# TYPE jdbc_connections_min gauge
jdbc_connections_min{application="jobs",name="radius",} -1.0
jdbc_connections_min{application="jobs",name="h2",} 200.0
jdbc_connections_min{application="jobs",name="ems",} 1.0
# HELP jvm_gc_live_data_size_bytes Size of long-lived heap memory pool after reclamation
# TYPE jvm_gc_live_data_size_bytes gauge
jvm_gc_live_data_size_bytes{application="jobs",} 3.0503616E7
# HELP jetty_threads_config_min The minimum number of threads in the pool
# TYPE jetty_threads_config_min gauge
jetty_threads_config_min{application="jobs",} 8.0
# HELP jetty_threads_busy The number of busy threads in the pool
# TYPE jetty_threads_busy gauge
jetty_threads_busy{application="jobs",} 3.0
# HELP jdbc_connections_idle Number of established but idle connections.
# TYPE jdbc_connections_idle gauge
jdbc_connections_idle{application="jobs",name="h2",} 200.0
# HELP jetty_threads_current The total number of threads in the pool
# TYPE jetty_threads_current gauge
jetty_threads_current{application="jobs",} 8.0
# HELP jvm_gc_memory_allocated_bytes_total Incremented for an increase in the size of the (young) heap memory pool after one GC to before the next
# TYPE jvm_gc_memory_allocated_bytes_total counter
jvm_gc_memory_allocated_bytes_total{application="jobs",} 1.34742016E9
# HELP jvm_memory_committed_bytes The amount of memory in bytes that is committed for the Java virtual machine to use
# TYPE jvm_memory_committed_bytes gauge
jvm_memory_committed_bytes{application="jobs",area="nonheap",id="Metaspace",} 1.05054208E8
jvm_memory_committed_bytes{application="jobs",area="heap",id="G1 Old Gen",} 9.961472E7
jvm_memory_committed_bytes{application="jobs",area="heap",id="G1 Eden Space",} 1.55189248E8
jvm_memory_committed_bytes{application="jobs",area="nonheap",id="Code Cache",} 3.1195136E7
jvm_memory_committed_bytes{application="jobs",area="heap",id="G1 Survivor Space",} 1.3631488E7
jvm_memory_committed_bytes{application="jobs",area="nonheap",id="Compressed Class Space",} 1.2517376E7
# HELP http_server_requests_seconds  
# TYPE http_server_requests_seconds summary
http_server_requests_seconds_count{application="jobs",exception="None",method="POST",outcome="SUCCESS",status="200",uri="/executor",} 2.0
http_server_requests_seconds_sum{application="jobs",exception="None",method="POST",outcome="SUCCESS",status="200",uri="/executor",} 0.530950071
http_server_requests_seconds_count{application="jobs",exception="None",method="GET",outcome="SUCCESS",status="200",uri="/executor/jobs",} 32.0
http_server_requests_seconds_sum{application="jobs",exception="None",method="GET",outcome="SUCCESS",status="200",uri="/executor/jobs",} 0.453230082
http_server_requests_seconds_count{application="jobs",exception="None",method="GET",outcome="SUCCESS",status="200",uri="/executor/jobs/failed",} 8.0
http_server_requests_seconds_sum{application="jobs",exception="None",method="GET",outcome="SUCCESS",status="200",uri="/executor/jobs/failed",} 0.138323383
http_server_requests_seconds_count{application="jobs",exception="None",method="POST",outcome="SUCCESS",status="200",uri="/executor/status",} 8.0
http_server_requests_seconds_sum{application="jobs",exception="None",method="POST",outcome="SUCCESS",status="200",uri="/executor/status",} 0.588620684
http_server_requests_seconds_count{application="jobs",exception="None",method="GET",outcome="SUCCESS",status="200",uri="/actuator/prometheus",} 72.0
http_server_requests_seconds_sum{application="jobs",exception="None",method="GET",outcome="SUCCESS",status="200",uri="/actuator/prometheus",} 0.961336121
# HELP http_server_requests_seconds_max  
# TYPE http_server_requests_seconds_max gauge
http_server_requests_seconds_max{application="jobs",exception="None",method="POST",outcome="SUCCESS",status="200",uri="/executor",} 0.042568132
http_server_requests_seconds_max{application="jobs",exception="None",method="GET",outcome="SUCCESS",status="200",uri="/executor/jobs",} 0.058000466
http_server_requests_seconds_max{application="jobs",exception="None",method="GET",outcome="SUCCESS",status="200",uri="/executor/jobs/failed",} 0.058879302
http_server_requests_seconds_max{application="jobs",exception="None",method="POST",outcome="SUCCESS",status="200",uri="/executor/status",} 0.172183404
http_server_requests_seconds_max{application="jobs",exception="None",method="GET",outcome="SUCCESS",status="200",uri="/actuator/prometheus",} 0.019048325
# HELP jvm_buffer_memory_used_bytes An estimate of the memory that the Java virtual machine is using for this buffer pool
# TYPE jvm_buffer_memory_used_bytes gauge
jvm_buffer_memory_used_bytes{application="jobs",id="mapped",} 0.0
jvm_buffer_memory_used_bytes{application="jobs",id="direct",} 674664.0
# HELP spring_batch_chunk_write_seconds_max Chunk writing duration
# TYPE spring_batch_chunk_write_seconds_max gauge
spring_batch_chunk_write_seconds_max{application="jobs",job_name="AP_STATUS_REPORT",status="SUCCESS",step_name="ngwEmailTasklet",} 4.79532E-4
# HELP spring_batch_chunk_write_seconds Chunk writing duration
# TYPE spring_batch_chunk_write_seconds summary
spring_batch_chunk_write_seconds_count{application="jobs",job_name="AP_STATUS_REPORT",status="SUCCESS",step_name="ngwEmailTasklet",} 2.0
spring_batch_chunk_write_seconds_sum{application="jobs",job_name="AP_STATUS_REPORT",status="SUCCESS",step_name="ngwEmailTasklet",} 0.001403983
# HELP hikaricp_connections_idle Idle connections
# TYPE hikaricp_connections_idle gauge
hikaricp_connections_idle{application="jobs",pool="h2-pool",} 200.0
hikaricp_connections_idle{application="jobs",pool="ems-pool",} 1.0
# HELP hikaricp_connections Total connections
# TYPE hikaricp_connections gauge
hikaricp_connections{application="jobs",pool="h2-pool",} 200.0
hikaricp_connections{application="jobs",pool="ems-pool",} 1.0
# HELP jdbc_connections_max Maximum number of active connections that can be allocated at the same time.
# TYPE jdbc_connections_max gauge
jdbc_connections_max{application="jobs",name="radius",} -1.0
jdbc_connections_max{application="jobs",name="h2",} 200.0
jdbc_connections_max{application="jobs",name="ems",} 48.0
# HELP jvm_gc_memory_promoted_bytes_total Count of positive increases in the size of the old generation memory pool before GC to after GC
# TYPE jvm_gc_memory_promoted_bytes_total counter
jvm_gc_memory_promoted_bytes_total{application="jobs",} 3.3364296E7
# HELP jvm_buffer_count_buffers An estimate of the number of buffers in the pool
# TYPE jvm_buffer_count_buffers gauge
jvm_buffer_count_buffers{application="jobs",id="mapped",} 0.0
jvm_buffer_count_buffers{application="jobs",id="direct",} 16.0
# HELP spring_batch_item_process_seconds_max Item processing duration
# TYPE spring_batch_item_process_seconds_max gauge
spring_batch_item_process_seconds_max{application="jobs",job_name="AP_STATUS_REPORT",status="SUCCESS",step_name="ngwEmailTasklet",} 0.210033607
# HELP spring_batch_item_process_seconds Item processing duration
# TYPE spring_batch_item_process_seconds summary
spring_batch_item_process_seconds_count{application="jobs",job_name="AP_STATUS_REPORT",status="SUCCESS",step_name="ngwEmailTasklet",} 2.0
spring_batch_item_process_seconds_sum{application="jobs",job_name="AP_STATUS_REPORT",status="SUCCESS",step_name="ngwEmailTasklet",} 0.544431449
# HELP jvm_memory_max_bytes The maximum amount of memory in bytes that can be used for memory management
# TYPE jvm_memory_max_bytes gauge
jvm_memory_max_bytes{application="jobs",area="nonheap",id="Metaspace",} -1.0
jvm_memory_max_bytes{application="jobs",area="heap",id="G1 Old Gen",} 1.073741824E9
jvm_memory_max_bytes{application="jobs",area="heap",id="G1 Eden Space",} -1.0
jvm_memory_max_bytes{application="jobs",area="nonheap",id="Code Cache",} 2.5165824E8
jvm_memory_max_bytes{application="jobs",area="heap",id="G1 Survivor Space",} -1.0
jvm_memory_max_bytes{application="jobs",area="nonheap",id="Compressed Class Space",} 1.073741824E9
# HELP jvm_threads_states_threads The current number of threads having NEW state
# TYPE jvm_threads_states_threads gauge
jvm_threads_states_threads{application="jobs",state="new",} 0.0
jvm_threads_states_threads{application="jobs",state="runnable",} 6.0
jvm_threads_states_threads{application="jobs",state="blocked",} 0.0
jvm_threads_states_threads{application="jobs",state="terminated",} 0.0
jvm_threads_states_threads{application="jobs",state="waiting",} 3.0
jvm_threads_states_threads{application="jobs",state="timed-waiting",} 24.0
# HELP hikaricp_connections_timeout_total Connection timeout total count
# TYPE hikaricp_connections_timeout_total counter
hikaricp_connections_timeout_total{application="jobs",pool="h2-pool",} 0.0
hikaricp_connections_timeout_total{application="jobs",pool="ems-pool",} 0.0
# HELP jvm_threads_peak_threads The peak live thread count since the Java virtual machine started or peak was reset
# TYPE jvm_threads_peak_threads gauge
jvm_threads_peak_threads{application="jobs",} 34.0
# HELP process_files_max_files The maximum file descriptor count
# TYPE process_files_max_files gauge
process_files_max_files{application="jobs",} 4096.0
# HELP hikaricp_connections_min Min connections
# TYPE hikaricp_connections_min gauge
hikaricp_connections_min{application="jobs",pool="h2-pool",} 200.0
hikaricp_connections_min{application="jobs",pool="ems-pool",} 1.0
# HELP spring_batch_job_seconds_max Job duration
# TYPE spring_batch_job_seconds_max gauge
spring_batch_job_seconds_max{application="jobs",name="AP_STATUS_REPORT",status="COMPLETED",} 1.008083569
# HELP spring_batch_job_seconds Job duration
# TYPE spring_batch_job_seconds summary
spring_batch_job_seconds_count{application="jobs",name="AP_STATUS_REPORT",status="COMPLETED",} 2.0
spring_batch_job_seconds_sum{application="jobs",name="AP_STATUS_REPORT",status="COMPLETED",} 8.611529885
# HELP jvm_threads_daemon_threads The current number of live daemon threads
# TYPE jvm_threads_daemon_threads gauge
jvm_threads_daemon_threads{application="jobs",} 21.0
# HELP process_uptime_seconds The uptime of the Java virtual machine
# TYPE process_uptime_seconds gauge
process_uptime_seconds{application="jobs",} 892.085
# HELP jvm_memory_used_bytes The amount of used memory
# TYPE jvm_memory_used_bytes gauge
jvm_memory_used_bytes{application="jobs",area="nonheap",id="Metaspace",} 1.00220392E8
jvm_memory_used_bytes{application="jobs",area="heap",id="G1 Old Gen",} 3.8905208E7
jvm_memory_used_bytes{application="jobs",area="heap",id="G1 Eden Space",} 1.35266304E8
jvm_memory_used_bytes{application="jobs",area="nonheap",id="Code Cache",} 3.1016064E7
jvm_memory_used_bytes{application="jobs",area="heap",id="G1 Survivor Space",} 1.3631488E7
jvm_memory_used_bytes{application="jobs",area="nonheap",id="Compressed Class Space",} 1.1681784E7
# HELP jetty_threads_jobs Number of jobs queued waiting for a thread
# TYPE jetty_threads_jobs gauge
jetty_threads_jobs{application="jobs",} 0.0
# HELP jvm_gc_pause_seconds Time spent in GC pause
# TYPE jvm_gc_pause_seconds summary
jvm_gc_pause_seconds_count{action="end of minor GC",application="jobs",cause="Metadata GC Threshold",} 1.0
jvm_gc_pause_seconds_sum{action="end of minor GC",application="jobs",cause="Metadata GC Threshold",} 0.04
jvm_gc_pause_seconds_count{action="end of minor GC",application="jobs",cause="G1 Evacuation Pause",} 9.0
jvm_gc_pause_seconds_sum{action="end of minor GC",application="jobs",cause="G1 Evacuation Pause",} 0.354
# HELP jvm_gc_pause_seconds_max Time spent in GC pause
# TYPE jvm_gc_pause_seconds_max gauge
jvm_gc_pause_seconds_max{action="end of minor GC",application="jobs",cause="Metadata GC Threshold",} 0.0
jvm_gc_pause_seconds_max{action="end of minor GC",application="jobs",cause="G1 Evacuation Pause",} 0.036
# HELP jvm_gc_max_data_size_bytes Max size of long-lived heap memory pool
# TYPE jvm_gc_max_data_size_bytes gauge
jvm_gc_max_data_size_bytes{application="jobs",} 1.073741824E9
# HELP log4j2_events_total Number of fatal level log events
# TYPE log4j2_events_total counter
log4j2_events_total{application="jobs",level="warn",} 1.0
log4j2_events_total{application="jobs",level="trace",} 0.0
log4j2_events_total{application="jobs",level="info",} 57.0
log4j2_events_total{application="jobs",level="debug",} 29455.0
log4j2_events_total{application="jobs",level="fatal",} 0.0
log4j2_events_total{application="jobs",level="error",} 1.0
# HELP system_cpu_count The number of processors available to the Java virtual machine
# TYPE system_cpu_count gauge
system_cpu_count{application="jobs",} 2.0
# HELP hikaricp_connections_pending Pending threads
# TYPE hikaricp_connections_pending gauge
hikaricp_connections_pending{application="jobs",pool="h2-pool",} 0.0
hikaricp_connections_pending{application="jobs",pool="ems-pool",} 0.0
# HELP jetty_threads_config_max The maximum number of threads in the pool
# TYPE jetty_threads_config_max gauge
jetty_threads_config_max{application="jobs",} 200.0
# HELP jvm_buffer_total_capacity_bytes An estimate of the total capacity of the buffers in this pool
# TYPE jvm_buffer_total_capacity_bytes gauge
jvm_buffer_total_capacity_bytes{application="jobs",id="mapped",} 0.0
jvm_buffer_total_capacity_bytes{application="jobs",id="direct",} 674664.0
# HELP process_files_open_files The open file descriptor count
# TYPE process_files_open_files gauge
process_files_open_files{application="jobs",} 75.0
# HELP spring_batch_item_read_seconds Item reading duration
# TYPE spring_batch_item_read_seconds summary
spring_batch_item_read_seconds_count{application="jobs",job_name="AP_STATUS_REPORT",status="SUCCESS",step_name="ngwEmailTasklet",} 4.0
spring_batch_item_read_seconds_sum{application="jobs",job_name="AP_STATUS_REPORT",status="SUCCESS",step_name="ngwEmailTasklet",} 0.001115916
# HELP spring_batch_item_read_seconds_max Item reading duration
# TYPE spring_batch_item_read_seconds_max gauge
spring_batch_item_read_seconds_max{application="jobs",job_name="AP_STATUS_REPORT",status="SUCCESS",step_name="ngwEmailTasklet",} 1.6817E-4
# HELP jvm_classes_loaded_classes The number of classes that are currently loaded in the Java virtual machine
# TYPE jvm_classes_loaded_classes gauge
jvm_classes_loaded_classes{application="jobs",} 16329.0
# HELP spring_batch_step_seconds_max Step duration
# TYPE spring_batch_step_seconds_max gauge
spring_batch_step_seconds_max{application="jobs",job_name="AP_STATUS_REPORT",name="ngwEmailTasklet",status="COMPLETED",} 0.396551008
spring_batch_step_seconds_max{application="jobs",job_name="AP_STATUS_REPORT",name="apStatusReportTasklet",status="EMAIL",} 0.570764723
# HELP spring_batch_step_seconds Step duration
# TYPE spring_batch_step_seconds summary
spring_batch_step_seconds_count{application="jobs",job_name="AP_STATUS_REPORT",name="ngwEmailTasklet",status="COMPLETED",} 2.0
spring_batch_step_seconds_sum{application="jobs",job_name="AP_STATUS_REPORT",name="ngwEmailTasklet",status="COMPLETED",} 1.283609766
spring_batch_step_seconds_count{application="jobs",job_name="AP_STATUS_REPORT",name="apStatusReportTasklet",status="EMAIL",} 2.0
spring_batch_step_seconds_sum{application="jobs",job_name="AP_STATUS_REPORT",name="apStatusReportTasklet",status="EMAIL",} 7.094680953
# HELP jetty_threads_idle The number of idle threads in the pool
# TYPE jetty_threads_idle gauge
jetty_threads_idle{application="jobs",} 4.0
# HELP jvm_classes_unloaded_classes_total The total number of classes unloaded since the Java virtual machine has started execution
# TYPE jvm_classes_unloaded_classes_total counter
jvm_classes_unloaded_classes_total{application="jobs",} 0.0
# HELP hikaricp_connections_max Max connections
# TYPE hikaricp_connections_max gauge
hikaricp_connections_max{application="jobs",pool="h2-pool",} 200.0
hikaricp_connections_max{application="jobs",pool="ems-pool",} 48.0
# HELP jdbc_connections_active Current number of active connections that have been allocated from the data source.
# TYPE jdbc_connections_active gauge
jdbc_connections_active{application="jobs",name="h2",} 0.0
# HELP spring_batch_job_active_seconds_max Active jobs
# TYPE spring_batch_job_active_seconds_max gauge
spring_batch_job_active_seconds_max{application="jobs",name="AP_STATUS_REPORT",} 0.0
# HELP spring_batch_job_active_seconds Active jobs
# TYPE spring_batch_job_active_seconds summary
spring_batch_job_active_seconds_active_count{application="jobs",name="AP_STATUS_REPORT",} 0.0
spring_batch_job_active_seconds_duration_sum{application="jobs",name="AP_STATUS_REPORT",} 0.0
# HELP hikaricp_connections_acquire_seconds Connection acquire time
# TYPE hikaricp_connections_acquire_seconds summary
hikaricp_connections_acquire_seconds_count{application="jobs",pool="h2-pool",} 82.0
hikaricp_connections_acquire_seconds_sum{application="jobs",pool="h2-pool",} 0.004964261
hikaricp_connections_acquire_seconds_count{application="jobs",pool="ems-pool",} 2.0
hikaricp_connections_acquire_seconds_sum{application="jobs",pool="ems-pool",} 0.005780881
# HELP hikaricp_connections_acquire_seconds_max Connection acquire time
# TYPE hikaricp_connections_acquire_seconds_max gauge
hikaricp_connections_acquire_seconds_max{application="jobs",pool="h2-pool",} 0.003685246
hikaricp_connections_acquire_seconds_max{application="jobs",pool="ems-pool",} 0.005766206
# HELP hikaricp_connections_creation_seconds_max Connection creation time
# TYPE hikaricp_connections_creation_seconds_max gauge
hikaricp_connections_creation_seconds_max{application="jobs",pool="h2-pool",} 0.0
hikaricp_connections_creation_seconds_max{application="jobs",pool="ems-pool",} 0.0
# HELP hikaricp_connections_creation_seconds Connection creation time
# TYPE hikaricp_connections_creation_seconds summary
hikaricp_connections_creation_seconds_count{application="jobs",pool="h2-pool",} 0.0
hikaricp_connections_creation_seconds_sum{application="jobs",pool="h2-pool",} 0.0
hikaricp_connections_creation_seconds_count{application="jobs",pool="ems-pool",} 1.0
hikaricp_connections_creation_seconds_sum{application="jobs",pool="ems-pool",} 0.009
# HELP system_cpu_usage The "recent cpu usage" for the whole system
# TYPE system_cpu_usage gauge
system_cpu_usage{application="jobs",} 0.019417475728155338

Пример настройки подключения Prometheus:

  - job_name: 'jobs'
    metrics_path: '/actuator/prometheus'
    scrape_interval: 5s
    static_configs:
      - targets: [ '<IP-адрес eltex-jobs>:9696' ]


  • Нет меток