This commit is contained in:
Yevgeniy Ulyantsev
2026-01-30 21:43:46 +03:00
parent b889d34575
commit 309b3a9c95
3 changed files with 21 additions and 5 deletions

View File

@@ -37,10 +37,11 @@ services:
command: command:
- "--config=/etc/otel/otel-collector.yaml" - "--config=/etc/otel/otel-collector.yaml"
ports: ports:
- "4317:4317" - "4317:4317" # OTLP gRPC
- "4318:4318" - "4318:4318" # OTLP HTTP
- "8888:8888" - "8888:8888" # Collector self-metrics
- "55679:55679" - "8889:8889" # Application metrics (добавьте эту строку!)
- "55679:55679" # ZPages
grafana: grafana:
image: grafana/grafana:10.3.1 image: grafana/grafana:10.3.1

View File

@@ -15,6 +15,13 @@ exporters:
prometheus: prometheus:
endpoint: 0.0.0.0:8889 endpoint: 0.0.0.0:8889
namespace: pricehistory # Добавьте namespace для группировки метрик
const_labels:
service: pricehistory-api
send_timestamps: true
metric_expiration: 10m
enable_open_metrics: true
add_metric_suffixes: false # Важно для совместимости
otlp/tempo: otlp/tempo:
endpoint: tempo:4317 endpoint: tempo:4317

View File

@@ -2,6 +2,14 @@ global:
scrape_interval: 15s scrape_interval: 15s
scrape_configs: scrape_configs:
- job_name: otel-collector - job_name: 'otel-collector'
static_configs: static_configs:
- targets: ['otel-collector:8888'] - targets: ['otel-collector:8888']
# Это метрики самого коллектора
- job_name: 'application-metrics'
static_configs:
- targets: ['otel-collector:8889']
# Это прикладные метрики из вашего приложения
scrape_interval: 10s
metrics_path: /metrics