Skip to content

Instantly share code, notes, and snippets.

@giuliohome
Last active January 9, 2025 19:09
Show Gist options
  • Save giuliohome/c8e75c47a92f878683c0bb5eebc8689c to your computer and use it in GitHub Desktop.
Save giuliohome/c8e75c47a92f878683c0bb5eebc8689c to your computer and use it in GitHub Desktop.
Grafana Loki
helm repo add grafana https://grafana.github.io/helm-charts
helm repo update
helm upgrade --install loki grafana/loki -n monitoring --create-namespace -f loki-values.yaml
helm upgrade --install promtail grafana/promtail -n monitoring -f promtail-values.yaml
helm install my-grafana grafana/grafana --namespace monitoring
kubectl port-forward --namespace monitoring svc/my-grafana 3000:80
loki:
commonConfig:
replication_factor: 1
schemaConfig:
configs:
- from: "2024-04-01"
store: tsdb
object_store: s3
schema: v13
index:
prefix: loki_index_
period: 24h
pattern_ingester:
enabled: true
limits_config:
allow_structured_metadata: true
volume_enabled: true
ruler:
enable_api: true
minio:
enabled: true
deploymentMode: SingleBinary
singleBinary:
replicas: 1
# Zero out replica counts of other deployment modes
backend:
replicas: 0
read:
replicas: 0
write:
replicas: 0
ingester:
replicas: 0
querier:
replicas: 0
queryFrontend:
replicas: 0
queryScheduler:
replicas: 0
distributor:
replicas: 0
compactor:
replicas: 0
indexGateway:
replicas: 0
bloomCompactor:
replicas: 0
bloomGateway:
replicas: 0
config:
# publish data to loki
clients:
- url: http://loki-gateway/loki/api/v1/push
tenant_id: 1
@giuliohome
Copy link
Author

giuliohome commented Jan 9, 2025

Set the X-Scope-OrgId header to a value like 1 in Loki's settings under Home > Connections > Data Sources, in the Headers section.

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