VK WorkSpace On-Premise logo
Помощь
Обновлена 20 октября 2026 г. в 14:33

Настройка мониторинга

Docker

Для включения метрик prometheus Проекты VK WorkSpace необходимо установить параметр PROM_METRICS_ENABLED: true в файле .env. В prometheus необходимо создать ScrapeConfig по каждому сервису. Например для kube-prometheus-stack

apiVersion: monitoring.coreos.com/v1alpha1kind: ScrapeConfigmetadata:  name: workspace  namespace: monitoring  labels:    prometheus: system-monitoring-prometheusspec:  scrapeInterval: 30s  staticConfigs:    - targets:        - mysrv.example.com      labels:        job: workspace        instance: mysrv.example.com  metricsPath: /admin/metrics  tlsConfig:    insecureSkipVerify: false  scheme: HTTPS---apiVersion: monitoring.coreos.com/v1alpha1kind: ScrapeConfigmetadata:  name: template  namespace: monitoring  labels:    prometheus: system-monitoring-prometheusspec:  scrapeInterval: 30s  staticConfigs:    - targets:        - mysrv.example.com      labels:        job: template        instance: mysrv.example.com  metricsPath: /template/metrics  tlsConfig:    insecureSkipVerify: false  scheme: HTTPS---apiVersion: monitoring.coreos.com/v1alpha1kind: ScrapeConfigmetadata:  name: automation  namespace: monitoring  labels:    prometheus: system-monitoring-prometheus    app: kube-prometheus-stackspec:  scrapeInterval: 30s  staticConfigs:    - targets:        - mysrv.example.com      labels:        job: automation        instance: mysrv.example.com  metricsPath: /automation/metrics  tlsConfig:    insecureSkipVerify: false   scheme: HTTPS---apiVersion: monitoring.coreos.com/v1alpha1kind: ScrapeConfigmetadata:  name: gitintegration  namespace: monitoring  labels:    prometheus: system-monitoring-prometheus    release: kube-prometheus-stack    app: kube-prometheus-stackspec:  scrapeInterval: 30s  staticConfigs:    - targets:        - mysrv.example.com      labels:        job: gitintegration        instance: mysrv.example.com  metricsPath: /vcs/metrics  tlsConfig:    insecureSkipVerify: false   scheme: HTTPS---apiVersion: monitoring.coreos.com/v1alpha1kind: ScrapeConfigmetadata:  name: history  namespace: monitoring  labels:    prometheus: system-monitoring-prometheusspec:  scrapeInterval: 30s  staticConfigs:    - targets:        - mysrv.example.com      labels:        job: history        instance: mysrv.example.com  metricsPath: /history/metrics  tlsConfig:    insecureSkipVerify: true   scheme: HTTPS  ---apiVersion: monitoring.coreos.com/v1alpha1kind: ScrapeConfigmetadata:  name: webhook  namespace: monitoring  labels:    prometheus: system-monitoring-prometheusspec:  scrapeInterval: 30s  staticConfigs:    - targets:        - mysrv.example.com      labels:        job: webhook        instance: mysrv.example.com  metricsPath: /webhook/metrics  tlsConfig:    insecureSkipVerify: false   scheme: HTTPS---apiVersion: monitoring.coreos.com/v1alpha1kind: ScrapeConfigmetadata:  name: comment  namespace: monitoring  labels:    prometheus: system-monitoring-prometheusspec:  scrapeInterval: 30s  staticConfigs:    - targets:        - mysrv.example.com      labels:        job: comment        instance: mysrv.example.com  metricsPath: /comments/metrics  tlsConfig:    insecureSkipVerify: false   scheme: HTTPS---apiVersion: monitoring.coreos.com/v1alpha1kind: ScrapeConfigmetadata:  name: notification  namespace: monitoring  labels:    prometheus: system-monitoring-prometheusspec:  scrapeInterval: 30s  staticConfigs:    - targets:        - mysrv.example.com      labels:        job: notification        instance: mysrv.example.com  metricsPath: /notifications/metrics  tlsConfig:    insecureSkipVerify: false   scheme: HTTPS---apiVersion: monitoring.coreos.com/v1alpha1kind: ScrapeConfigmetadata:  name: attachment  namespace: monitoring  labels:    prometheus: system-monitoring-prometheusspec:  scrapeInterval: 30s  staticConfigs:    - targets:        - mysrv.example.com      labels:        job: attachment        instance: mysrv.example.com  metricsPath: /attachments/metrics  tlsConfig:    insecureSkipVerify: false   scheme: HTTPS---apiVersion: monitoring.coreos.com/v1alpha1kind: ScrapeConfigmetadata:  name: workitem  namespace: monitoring  labels:    prometheus: system-monitoring-prometheusspec:  scrapeInterval: 30s  staticConfigs:    - targets:        - mysrv.example.com      labels:        job: workitem        instance: mysrv.example.com  metricsPath: /tasks/metrics  tlsConfig:    insecureSkipVerify: false   scheme: HTTPS---apiVersion: monitoring.coreos.com/v1alpha1kind: ScrapeConfigmetadata:  name: wiki  namespace: monitoring  labels:    prometheus: system-monitoring-prometheusspec:  scrapeInterval: 30s  staticConfigs:    - targets:        - mysrv.example.com      labels:        job: wiki        instance: mysrv.example.com  metricsPath: /wiki/metrics  tlsConfig:    insecureSkipVerify: false   scheme: HTTPS---apiVersion: monitoring.coreos.com/v1alpha1kind: ScrapeConfigmetadata:  name: taskitem  namespace: monitoring  labels:    prometheus: system-monitoring-prometheusspec:  scrapeInterval: 30s  staticConfigs:    - targets:        - mysrv.example.com      labels:        job: taskitem        instance: mysrv.example.com  metricsPath: /personal-tasks/metrics  tlsConfig:    insecureSkipVerify: false   scheme: HTTPS

Kubernetes

Для включения метрик prometheus Проекты VK WorkSpace необходимо установить параметр .Values.metrics.enabled: true в values.yaml. Автоматически будут созданы ServiceMonitor, с помощью которых prometheus будет забирать метрики. Если в kubernetes не используется prometheus operator или нет crd, то необходимо отключить создание ServiceMonitor .Values.metrics.serviceMonitor.enabled: false в values.yaml и настроить с помощью ScrapeConfig.


Технический писатель: Белова Ирина

Была ли статья полезна?