I have installed loki and grafana via helm charts to my cloud hosted k8s cluster. How do I send the loki metrics to grafana cloud? I know I should edit the promtail config file but how do I locate and view/edit helm chart files?
My installation procedure for loki+grafana are:
helm upgrade --install loki --namespace=monitoring grafana/loki-stack
helm upgrade --install grafana --namespace=monitoring grafana/grafana
kubectl port-forward service/grafana 3000:80 -n monitoring
This installation of loki only exposes loki to grafana locally. I wish to enter the configuration of loki (or more specifically promtail) so that I can send the loki logs to my grafana cloud account and monitor the logs from grafana cloud as well. I have done this in a non-k8s setting by modifying the promtail-config.yaml which is referenced to send the logs to grafana cloud. Adding the grafana cloud url to the promtail config such as:
clients:
- url: http://loki:3100/loki/api/v1/push
- url: https://123456:[email protected]/api/prom/push
When I explore grafana cloud > intergrations and connections > loki hosted logs > k8s cluster. I receive the following instructions
Your configuration, complete with your API key, has been generated below. Copy and paste this code to promtail/config.yaml to send data using promtail.
The code snippet:
curl -fsS https://raw.githubusercontent.com/grafana/loki/master/tools/promtail.sh | sh -s 123456 eB9... logs-prod3.grafana.net default | kubectl apply --namespace=default -f -
I am new to helm charts, so I do not know how to view the helm config files and where they are stored. Or how to obtain the promtail/config.yaml
file from helm or the k8s cluster.