Files
stack/config/otel-collector.yaml
2026-01-19 18:24:07 -08:00

103 lines
2.0 KiB
YAML

# OpenTelemetry Collector configuration
# Documentation: https://opentelemetry.io/docs/collector/configuration/
receivers:
otlp:
protocols:
grpc:
endpoint: 0.0.0.0:4317
http:
endpoint: 0.0.0.0:4318
# Prometheus scrape config for metrics
prometheus:
config:
scrape_configs:
- job_name: 'otel-collector'
scrape_interval: 10s
static_configs:
- targets: ['localhost:8888']
processors:
batch:
timeout: 1s
send_batch_size: 1024
memory_limiter:
check_interval: 1s
limit_mib: 512
spike_limit_mib: 128
resourcedetection:
detectors: [env, system]
timeout: 2s
override: false
# Add resource attributes
resource:
attributes:
- key: service.namespace
value: hanzo
action: upsert
- key: deployment.environment
value: development
action: upsert
exporters:
# Export traces to Tempo
otlp/tempo:
endpoint: traces:4317
tls:
insecure: true
# Export metrics to VictoriaMetrics
prometheusremotewrite:
endpoint: http://metrics:8428/api/v1/write
tls:
insecure: true
# Export logs to Loki
loki:
endpoint: http://logs:3100/loki/api/v1/push
tls:
insecure: true
# Debug output (for development)
debug:
verbosity: basic
extensions:
health_check:
endpoint: 0.0.0.0:13133
pprof:
endpoint: 0.0.0.0:1777
zpages:
endpoint: 0.0.0.0:55679
service:
extensions: [health_check, pprof, zpages]
pipelines:
traces:
receivers: [otlp]
processors: [memory_limiter, resourcedetection, resource, batch]
exporters: [otlp/tempo, debug]
metrics:
receivers: [otlp, prometheus]
processors: [memory_limiter, resourcedetection, resource, batch]
exporters: [prometheusremotewrite, debug]
logs:
receivers: [otlp]
processors: [memory_limiter, resourcedetection, resource, batch]
exporters: [loki, debug]
telemetry:
logs:
level: info
metrics:
address: 0.0.0.0:8888