Подключил к своему Nuxt проекту Pino + OpenTelemetry для записи трейсов и логов в Loki + Tempo.
Все подключено через Grafana, все данные правильно визуализируются кроме:
Прикреплю конфиг:
Docker-compose
tempo:
image: grafana/tempo:latest
restart: unless-stopped
command: ["-config.file=/etc/tempo.yaml"]
volumes:
- ./configs/tempo.yaml:/etc/tempo.yaml:ro
- data-tempo:/var/tempo
networks:
- monitoring
ports:
- "4317:4317" # Для отправки данных GRPC
- "3200:3200" # Для чтения данных
prometheus:
image: prom/prometheus:latest
restart: unless-stopped
command:
- "--config.file=/etc/prometheus/prometheus.yaml" # Путь к конфигу
- "--storage.tsdb.retention.time=15d" # Хранить метрики 15 дней
- "--web.enable-remote-write-receiver"
- "--enable-feature=exemplar-storage"
- "--enable-feature=native-histograms"
volumes:
- ./configs/prometheus.yaml:/etc/prometheus/prometheus.yaml:ro # Основной конфиг
- data-prometheus:/prometheus # Данные TSDB
networks:
- monitoring
ports:
- "9090:9090"
prometheus.yaml
global:
scrape_interval: 15s
evaluation_interval: 15s
scrape_configs:
- job_name: 'prometheus'
static_configs:
- targets: ['localhost:9090']
- job_name: 'tempo'
static_configs:
- targets: ['tempo:3200']
- job_name: 'tempo-usage-metrics'
metrics_path: '/usage_metrics'
static_configs:
- targets: ['tempo:3200']
tempo.yaml
server:
http_listen_port: 3200
distributor:
receivers:
otlp:
protocols:
grpc:
endpoint: "0.0.0.0:4317"
log_received_spans:
enabled: true
compactor:
compaction:
block_retention: 48h
metrics_generator:
registry:
external_labels:
source: tempo
cluster: docker-compose
storage:
path: /var/tempo/wal
remote_write:
- url: http://prometheus:9090/api/v1/write
send_exemplars: true
traces_storage:
path: /var/tempo/traces
processor:
local_blocks:
filter_server_spans: false
flush_to_storage: true
storage:
trace:
backend: local
local:
path: /var/tempo/traces
wal:
path: /var/tempo/wal
overrides:
defaults:
cost_attribution:
dimensions:
service.name: ""
span.http.target: "service_route"
metrics_generator:
processors: [service-graphs, span-metrics, local-blocks]
generate_native_histograms: both
Вопрос соответственно как подключить эту опцию.