Skip to content

Instantly share code, notes, and snippets.

@tyriis
Last active August 4, 2026 10:39
Show Gist options
  • Select an option

  • Save tyriis/e26022c14352b78915b1a6375d4cc4d5 to your computer and use it in GitHub Desktop.

Select an option

Save tyriis/e26022c14352b78915b1a6375d4cc4d5 to your computer and use it in GitHub Desktop.
otel
---
services:
lgtm:
image: grafana/otel-lgtm:latest
container_name: otel-lgtm
ports:
- "3000:3000" # Grafana
- "4317:4317" # OTLP gRPC receiver
- "4318:4318" # OTLP HTTP receiver
- "3200:3200" # Tempo
- "4040:4040" # Pyroscope
- "9090:9090" # Prometheus
environment:
# Prometheus retention config
- PROMETHEUS_EXTRA_ARGS=--storage.tsdb.retention.time=180d
- PYROSCOPE_EXTRA_ARGS=-compactor.blocks-retention-period=4380h
# Use these to enable verbose logging inside the container for specific components
- ENABLE_LOGS_GRAFANA=true
- ENABLE_LOGS_OTELCOL=true
- ENABLE_LOGS_LOKI=true
- ENABLE_LOGS_TEMPO=true
- ENABLE_LOGS_PROMETHEUS=true
- ENABLE_LOGS_PYROSCOPE=true
# --- OBI (eBPF Auto-Instrumentation) ---
# IMPORTANT SECURITY NOTE:
# Enabling OBI requires running this container with elevated privileges.
# To enable it, uncomment `ENABLE_OBI=true` AND add the following to this service:
# pid: "host"
# privileged: true
# ---------------------------------------
# - ENABLE_OBI=true
restart: always
volumes:
# Mount custom configs for Loki, Tempo and Pyroscope retention
- ./loki-config.yaml:/otel-lgtm/loki-config.yaml
- ./tempo-config.yaml:/otel-lgtm/tempo-config.yaml
# Persist data across container restarts
- lgtm-data:/data
volumes:
lgtm-data:
auth_enabled: false
server:
http_listen_port: 3100
common:
instance_addr: 127.0.0.1
path_prefix: /data/loki
storage:
filesystem:
chunks_directory: /data/loki/chunks
rules_directory: /data/loki/rules
replication_factor: 1
ring:
kvstore:
store: inmemory
schema_config:
configs:
- from: 2020-10-24
store: tsdb
object_store: filesystem
schema: v13
index:
prefix: index_
period: 24h
ruler:
alertmanager_url: http://127.0.0.1:9093
pattern_ingester:
lifecycler:
min_ready_duration: 1s
ingester:
lifecycler:
min_ready_duration: 1s
frontend:
scheduler_dns_lookup_period: 1s
address: 127.0.0.1
query_scheduler:
use_scheduler_ring: false
limits_config:
retention_period: 4380h # 6 months (182.5 days)
compactor:
working_directory: /data/loki/retention
compaction_interval: 10m
retention_enabled: true
retention_delete_delay: 2h
retention_delete_worker_count: 150
delete_request_store: filesystem
server:
http_listen_port: 3200
grpc_listen_port: 9096
distributor:
receivers:
otlp:
protocols:
grpc:
endpoint: "127.0.0.1:4417"
http:
endpoint: "127.0.0.1:4418"
ingester:
trace_idle_period: 1s
max_block_duration: 1s
flush_check_period: 1s
lifecycler:
address: 127.0.0.1
ring:
kvstore:
store: inmemory
replication_factor: 1
min_ready_duration: 1s
memberlist:
bind_addr: [127.0.0.1]
bind_port: 7947
query_frontend:
mcp_server:
enabled: true
querier:
frontend_worker:
frontend_address: 127.0.0.1:9096
storage:
trace:
backend: local
wal:
path: /data/tempo/wal
local:
path: /data/tempo/blocks
metrics_generator:
processor:
local_blocks:
filter_server_spans: false
span_metrics:
dimensions:
- service_name
- operation
- status_code
traces_storage:
path: /data/tempo/generator/traces
storage:
path: /data/tempo/generator/wal
remote_write:
- url: http://127.0.0.1:9090/api/v1/write
send_exemplars: true
overrides:
metrics_generator_processors: [service-graphs, local-blocks, span-metrics]
compactor:
compaction:
block_retention: 4380h # 6 months (182.5 days)
@tyriis

tyriis commented Aug 3, 2026

Copy link
Copy Markdown
Author

OPENCODE_ENABLE_TELEMETRY=1
OPENCODE_OTLP_ENDPOINT=http://127.0.0.1:4317
OPENCODE_RESOURCE_ATTRIBUTES=service.name=oc-tyriis

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment