- Add ServiceMonitors for Traefik, ArgoCD, and Longhorn - Enable cert-manager ServiceMonitor via helm values - Deploy Grafana Tempo for distributed tracing (single-binary, Longhorn PVC) - Add Tempo datasource with trace-to-logs and trace-to-metrics correlation - Instrument API with OpenTelemetry SDK (Prometheus metrics + OTLP traces) - Replace console.log with pino structured logging + pino-http middleware - Add Grafana dashboards for Traefik, API overview, and PostgreSQL (CNPG)
37 lines
918 B
YAML
37 lines
918 B
YAML
apiVersion: v1
|
|
kind: ConfigMap
|
|
metadata:
|
|
name: loki-datasource
|
|
namespace: observability
|
|
labels:
|
|
grafana_datasource: "1"
|
|
data:
|
|
loki-datasource.yaml: |
|
|
apiVersion: 1
|
|
datasources:
|
|
- name: Loki
|
|
type: loki
|
|
access: proxy
|
|
url: http://loki.observability.svc:3100
|
|
jsonData:
|
|
maxLines: 1000
|
|
derivedFields:
|
|
- datasourceUid: tempo
|
|
matcherRegex: '"traceID":"(\w+)"'
|
|
name: TraceID
|
|
url: "$${__value.raw}"
|
|
- name: Tempo
|
|
type: tempo
|
|
uid: tempo
|
|
access: proxy
|
|
url: http://tempo.observability.svc:3100
|
|
jsonData:
|
|
tracesToLogs:
|
|
datasourceUid: loki
|
|
filterByTraceID: true
|
|
filterBySpanID: false
|
|
tracesToMetrics:
|
|
datasourceUid: prometheus
|
|
serviceMap:
|
|
datasourceUid: prometheus
|