homek8s/infrastructure/logging/datasource.yaml

35 lines
1.2 KiB
YAML
Raw Permalink Normal View History

# Grafana datasource for the log store.
#
# Lives in the monitoring namespace because the kube-prometheus-stack Grafana
# sidecar only watches its own release namespace (sidecar.datasources
# .searchNamespace is unset). The label `grafana_datasource` is what the
# sidecar selects on; the CM lands here from the logging Kustomization (see
# clusters/homek8s/logging.yaml) so the monitoring tree stays untouched.
#
# uid is pinned: dashboards and saved Explore queries can reference `uid: loki`
# without a lookup, and re-creating the datasource does not orphan links.
apiVersion: v1
kind: ConfigMap
metadata:
name: loki-datasource
namespace: monitoring
labels:
grafana_datasource: "1"
app.kubernetes.io/part-of: logging
data:
loki-datasource.yaml: |
apiVersion: 1
datasources:
- name: Loki
uid: loki
type: loki
access: proxy
url: http://loki.logging.svc.cluster.local:3100
isDefault: false
editable: false
jsonData:
maxLines: 1000
timeout: 60
# path-level hints so the Explore log browser shows namespace/pod/
# container as columns instead of raw label soup.
derivedFields: []