Skip to content

Commit

Permalink
feat: auto loki datasource creation in grafana when promtail enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
butschi84 committed Dec 3, 2023
1 parent c2f83f1 commit c91f547
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions helm/templates/grafana/grafana-datasources.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,10 @@ data:
access: proxy
url: http://prometheus-service.f2s:9090
isDefault: true
{{- if .Values.promtail.enabled }}
- name: Loki
type: loki
access: proxy
url: {{.Values.promtail.loki_url}}
{{- end }}
{{- end }}
2 changes: 1 addition & 1 deletion helm/templates/prometheus/promtail.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ data:
http_listen_port: 9080
grpc_listen_port: 0
clients:
- url: "{{.Values.promtail.loki_url}}"
- url: "{{.Values.promtail.loki_url}}/loki/api/v1/push"
headers:
X-Scope-OrgID: loki-internal
positions:
Expand Down
2 changes: 1 addition & 1 deletion helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ testfunctions:
# you need your own loki instance
promtail:
enabled: false
loki_url: http://loki-loki-distributed-gateway.loki:80/loki/api/v1/push
loki_url: http://loki-loki-distributed-gateway.loki:80

# deploy grafana to have insight into metrics
# - f2s scaling decision dashboard
Expand Down

0 comments on commit c91f547

Please sign in to comment.