feat: Integrate Grafana Loki

This commit is contained in:
gpt-engineer-app[bot]
2025-10-30 15:54:32 +00:00
parent 8ac61e01e3
commit 72a7cb7f7c
9 changed files with 1261 additions and 2 deletions

45
grafana-datasources.yml Normal file
View File

@@ -0,0 +1,45 @@
# Grafana Data Source Provisioning
# Auto-configures Loki as a data source in Grafana
apiVersion: 1
datasources:
- name: Loki
type: loki
access: proxy
url: http://loki:3100
isDefault: true
editable: true
jsonData:
maxLines: 1000
derivedFields:
# Extract trace ID from logs for distributed tracing
- datasourceUid: tempo
matcherRegex: "traceId=(\\w+)"
name: TraceID
url: "$${__value.raw}"
# Extract request ID for correlation
- matcherRegex: "requestId=(\\w+)"
name: RequestID
url: "$${__value.raw}"
version: 1
# Optional: Add Prometheus if you have metrics
# - name: Prometheus
# type: prometheus
# access: proxy
# url: http://prometheus:9090
# isDefault: false
# editable: true
# jsonData:
# timeInterval: 15s
# version: 1
# Optional: Add Tempo for distributed tracing
# - name: Tempo
# type: tempo
# access: proxy
# url: http://tempo:3200
# isDefault: false
# editable: true
# version: 1