1
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
Reference in New Issue
Block a user