add tempo (tracing), pyroscope (profiling), node exporter (metriche)
This commit is contained in:
@@ -12,6 +12,8 @@ services:
|
||||
- "8889:8889" # Prometheus metrics endpoint
|
||||
networks:
|
||||
- observ-net
|
||||
labels:
|
||||
logging: "promtail"
|
||||
|
||||
|
||||
prometheus:
|
||||
@@ -28,9 +30,12 @@ services:
|
||||
- otel-collector
|
||||
networks:
|
||||
- observ-net
|
||||
labels:
|
||||
logging: "promtail"
|
||||
|
||||
grafana:
|
||||
image: grafana/grafana:latest
|
||||
container_name: grafana
|
||||
ports:
|
||||
- "3000:3000"
|
||||
environment:
|
||||
@@ -43,9 +48,97 @@ services:
|
||||
- prometheus
|
||||
networks:
|
||||
- observ-net
|
||||
labels:
|
||||
logging: "promtail"
|
||||
|
||||
promtail:
|
||||
image: grafana/promtail:2.9.3
|
||||
container_name: promtail
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
TZ: Europe/Rome
|
||||
volumes:
|
||||
- ./promtail-config.yml:/etc/promtail/config.yml:ro
|
||||
- /var/run/docker.sock:/var/run/docker.sock:ro
|
||||
networks:
|
||||
- observ-net
|
||||
depends_on:
|
||||
- loki
|
||||
|
||||
loki:
|
||||
image: grafana/loki:latest
|
||||
container_name: loki
|
||||
user: "0"
|
||||
ports:
|
||||
- "3100:3100"
|
||||
volumes:
|
||||
- ./loki-config.yml:/etc/loki/local-config.yaml
|
||||
- ./loki-data:/loki
|
||||
command: -config.file=/etc/loki/local-config.yaml
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- observ-net
|
||||
labels:
|
||||
logging: "promtail"
|
||||
|
||||
tempo:
|
||||
image: grafana/tempo:latest
|
||||
container_name: tempo
|
||||
user: "0"
|
||||
command: ["-config.file=/etc/tempo.yml"]
|
||||
volumes:
|
||||
- ./tempo-config.yml:/etc/tempo.yml
|
||||
- tempo-data:/tmp/tempo
|
||||
ports:
|
||||
- "3200:3200" # Tempo HTTP
|
||||
- "4317" # OTLP gRPC
|
||||
- "4318" # OTLP HTTP
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- observ-net
|
||||
labels:
|
||||
logging: "promtail"
|
||||
|
||||
node-exporter:
|
||||
image: prom/node-exporter:latest
|
||||
container_name: node-exporter
|
||||
command:
|
||||
- '--path.procfs=/host/proc'
|
||||
- '--path.sysfs=/host/sys'
|
||||
- '--path.rootfs=/rootfs'
|
||||
- '--collector.filesystem.mount-points-exclude=^/(sys|proc|dev|host|etc)($$|/)'
|
||||
volumes:
|
||||
- /proc:/host/proc:ro
|
||||
- /sys:/host/sys:ro
|
||||
- /:/rootfs:ro
|
||||
ports:
|
||||
- "9100:9100"
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- observ-net
|
||||
labels:
|
||||
logging: "promtail"
|
||||
|
||||
pyroscope:
|
||||
image: grafana/pyroscope:latest
|
||||
container_name: pyroscope
|
||||
ports:
|
||||
- "4040:4040" # Pyroscope UI and API
|
||||
volumes:
|
||||
- pyroscope-data:/var/lib/pyroscope
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- observ-net
|
||||
labels:
|
||||
logging: "promtail"
|
||||
environment:
|
||||
- PYROSCOPE_LOG_LEVEL=info
|
||||
|
||||
|
||||
volumes:
|
||||
grafana-storage:
|
||||
tempo-data:
|
||||
pyroscope-data:
|
||||
|
||||
networks:
|
||||
observ-net:
|
||||
|
||||
@@ -10,3 +10,65 @@ datasources:
|
||||
jsonData:
|
||||
timeInterval: 10s
|
||||
queryTimeout: 60s
|
||||
|
||||
- name: Loki
|
||||
type: loki
|
||||
access: proxy
|
||||
url: http://loki:3100
|
||||
isDefault: false
|
||||
editable: true
|
||||
jsonData:
|
||||
maxLines: 1000
|
||||
derivedFields:
|
||||
- datasourceUid: tempo
|
||||
matcherRegex: "trace_?id[\":]\\s*\"?([0-9a-fA-F]+)"
|
||||
name: TraceID
|
||||
url: "$${__value.raw}"
|
||||
|
||||
- name: Tempo
|
||||
type: tempo
|
||||
uid: tempo
|
||||
access: proxy
|
||||
url: http://tempo:3200
|
||||
isDefault: false
|
||||
editable: true
|
||||
jsonData:
|
||||
httpMethod: GET
|
||||
tracesToLogs:
|
||||
datasourceUid: loki
|
||||
mapTagNamesEnabled: true
|
||||
mappedTags:
|
||||
- key: service.name
|
||||
value: service_name
|
||||
spanStartTimeShift: '-1h'
|
||||
spanEndTimeShift: '1h'
|
||||
filterByTraceID: true
|
||||
filterBySpanID: false
|
||||
tracesToMetrics:
|
||||
datasourceUid: prometheus
|
||||
spanStartTimeShift: '-1h'
|
||||
spanEndTimeShift: '1h'
|
||||
tracesToProfiles:
|
||||
datasourceUid: pyroscope
|
||||
tags:
|
||||
- key: service.name
|
||||
value: service_name
|
||||
serviceMap:
|
||||
datasourceUid: prometheus
|
||||
nodeGraph:
|
||||
enabled: true
|
||||
search:
|
||||
hide: false
|
||||
lokiSearch:
|
||||
datasourceUid: loki
|
||||
|
||||
- name: Pyroscope
|
||||
type: grafana-pyroscope-datasource
|
||||
uid: pyroscope
|
||||
access: proxy
|
||||
url: http://pyroscope:4040
|
||||
isDefault: false
|
||||
editable: true
|
||||
jsonData:
|
||||
keepCookies: []
|
||||
minStep: '15s'
|
||||
|
||||
43
docker-compose/loki-config.yml
Normal file
43
docker-compose/loki-config.yml
Normal file
@@ -0,0 +1,43 @@
|
||||
auth_enabled: false
|
||||
|
||||
server:
|
||||
http_listen_port: 3100
|
||||
grpc_listen_port: 9096
|
||||
|
||||
common:
|
||||
instance_addr: 127.0.0.1
|
||||
path_prefix: /loki
|
||||
storage:
|
||||
filesystem:
|
||||
chunks_directory: /loki/chunks
|
||||
rules_directory: /loki/rules
|
||||
replication_factor: 1
|
||||
ring:
|
||||
kvstore:
|
||||
store: inmemory
|
||||
|
||||
query_range:
|
||||
results_cache:
|
||||
cache:
|
||||
embedded_cache:
|
||||
enabled: true
|
||||
max_size_mb: 100
|
||||
|
||||
schema_config:
|
||||
configs:
|
||||
- from: 2020-10-24
|
||||
store: tsdb
|
||||
object_store: filesystem
|
||||
schema: v13
|
||||
index:
|
||||
prefix: index_
|
||||
period: 24h
|
||||
|
||||
ruler:
|
||||
alertmanager_url: http://localhost:9093
|
||||
|
||||
limits_config:
|
||||
retention_period: 720h
|
||||
ingestion_rate_mb: 10
|
||||
ingestion_burst_size_mb: 20
|
||||
volume_enabled: true
|
||||
@@ -15,6 +15,10 @@ processors:
|
||||
exporters:
|
||||
prometheus:
|
||||
endpoint: "0.0.0.0:8889"
|
||||
otlp/tempo:
|
||||
endpoint: tempo:4317
|
||||
tls:
|
||||
insecure: true
|
||||
debug:
|
||||
verbosity: detailed
|
||||
|
||||
@@ -25,6 +29,11 @@ service:
|
||||
processors: [batch]
|
||||
exporters: [prometheus, debug]
|
||||
|
||||
traces:
|
||||
receivers: [otlp]
|
||||
processors: [batch]
|
||||
exporters: [otlp/tempo, debug]
|
||||
|
||||
logs:
|
||||
receivers: [otlp]
|
||||
processors: [batch]
|
||||
|
||||
@@ -17,5 +17,13 @@ scrape_configs:
|
||||
metrics_path: '/metrics'
|
||||
static_configs:
|
||||
# Raggiunge il Collector usando il suo nome di servizio Docker
|
||||
- targets: ['otel-collector:8889']
|
||||
- targets: ['otel-collector:8889']
|
||||
|
||||
# Job 3: Node Exporter - Metriche del sistema host
|
||||
- job_name: 'node-exporter'
|
||||
static_configs:
|
||||
- targets: ['node-exporter:9100']
|
||||
labels:
|
||||
instance: 'docker-host'
|
||||
environment: 'production'
|
||||
|
||||
|
||||
27
docker-compose/promtail-config.yml
Normal file
27
docker-compose/promtail-config.yml
Normal file
@@ -0,0 +1,27 @@
|
||||
server:
|
||||
http_listen_port: 9080
|
||||
grpc_listen_port: 0
|
||||
|
||||
positions:
|
||||
filename: /tmp/positions.yaml
|
||||
|
||||
clients:
|
||||
- url: http://loki:3100/loki/api/v1/push
|
||||
external_labels:
|
||||
environment: production
|
||||
cluster: myapp-cluster
|
||||
|
||||
scrape_configs:
|
||||
- job_name: docker
|
||||
docker_sd_configs:
|
||||
- host: unix:///var/run/docker.sock
|
||||
refresh_interval: 5s
|
||||
filters:
|
||||
- name: label
|
||||
values: ["logging=promtail"]
|
||||
relabel_configs:
|
||||
- source_labels: ['__meta_docker_container_name']
|
||||
regex: '/(.*)'
|
||||
target_label: 'container'
|
||||
- source_labels: ['__meta_docker_container_label_logging_jobname']
|
||||
target_label: 'job'
|
||||
49
docker-compose/tempo-config.yml
Normal file
49
docker-compose/tempo-config.yml
Normal file
@@ -0,0 +1,49 @@
|
||||
server:
|
||||
http_listen_port: 3200
|
||||
|
||||
distributor:
|
||||
receivers:
|
||||
otlp:
|
||||
protocols:
|
||||
grpc:
|
||||
endpoint: 0.0.0.0:4317
|
||||
http:
|
||||
endpoint: 0.0.0.0:4318
|
||||
|
||||
ingester:
|
||||
max_block_duration: 5m
|
||||
|
||||
compactor:
|
||||
compaction:
|
||||
block_retention: 48h
|
||||
|
||||
storage:
|
||||
trace:
|
||||
backend: local
|
||||
wal:
|
||||
path: /tmp/tempo/wal
|
||||
local:
|
||||
path: /tmp/tempo/blocks
|
||||
|
||||
query_frontend:
|
||||
search:
|
||||
duration_slo: 5s
|
||||
throughput_bytes_slo: 1.073741824e+09
|
||||
trace_by_id:
|
||||
duration_slo: 5s
|
||||
|
||||
metrics_generator:
|
||||
registry:
|
||||
external_labels:
|
||||
source: tempo
|
||||
cluster: docker-compose
|
||||
storage:
|
||||
path: /tmp/tempo/generator/wal
|
||||
remote_write:
|
||||
- url: http://prometheus:9090/api/v1/write
|
||||
send_exemplars: true
|
||||
|
||||
overrides:
|
||||
defaults:
|
||||
metrics_generator:
|
||||
processors: [service-graphs, span-metrics]
|
||||
Reference in New Issue
Block a user