@@ -42,37 +42,57 @@ fetch the logs and it needs to know the UID of this datasource.
4242
4343A simple way to get the datasource UID is to access the Grafana API by running the following request:
4444
45- .. code-block :: bash
4645
47- # port forward if you are using Robusta's grafana from your kubernetes cluster
48- kubectl port-forward svc/robusta-grafana 3000:80
49-
50- # List the loki data sources
51- curl -s -u < username> :< password> http://localhost:3000/api/datasources | jq ' .[] | select(.type == "loki")'
52- {
53- " id" : 2,
54- " uid" : " klja8hsa-8a9c-4b35-1230-7baab22b02ee" ,
55- " orgId" : 1,
56- " name" : " Loki-kubernetes" ,
57- " type" : " loki" ,
58- " typeName" : " Loki" ,
59- " typeLogoUrl" : " /public/app/plugins/datasource/loki/img/loki_icon.svg" ,
60- " access" : " proxy" ,
61- " url" : " http://loki.loki:3100" ,
62- " user" : " " ,
63- " database" : " " ,
64- " basicAuth" : false,
65- " isDefault" : false,
66- " jsonData" : {
67- " httpHeaderName1" : " admin" ,
68- " httpHeaderName2" : " X-Scope-OrgID" ,
69- " tlsSkipVerify" : true
70- },
71- " readOnly" : false
72- }
73- # In this case, there is a single Loki datasourceUID
74- # with UID "klja8hsa-8a9c-4b35-1230-7baab22b02ee"
46+ .. md-tab-set ::
7547
48+ .. md-tab-item :: Self Hosted
49+
50+ .. code-block :: bash
51+
52+ # port forward if you are using Robusta's grafana from your kubernetes cluster
53+ kubectl port-forward svc/robusta-grafana 3000:80
54+
55+ # List the loki data sources
56+ curl -s -u < username> :< password> http://localhost:3000/api/datasources | jq ' .[] | select(.type == "loki")'
57+ {
58+ " id" : 2,
59+ " uid" : " klja8hsa-8a9c-4b35-1230-7baab22b02ee" ,
60+ " orgId" : 1,
61+ " name" : " Loki-kubernetes" ,
62+ " type" : " loki" ,
63+ " typeName" : " Loki" ,
64+ " typeLogoUrl" : " /public/app/plugins/datasource/loki/img/loki_icon.svg" ,
65+ " access" : " proxy" ,
66+ " url" : " http://loki.loki:3100" ,
67+ " user" : " " ,
68+ " database" : " " ,
69+ " basicAuth" : false,
70+ " isDefault" : false,
71+ " jsonData" : {
72+ " httpHeaderName1" : " admin" ,
73+ " httpHeaderName2" : " X-Scope-OrgID" ,
74+ " tlsSkipVerify" : true
75+ },
76+ " readOnly" : false
77+ }
78+ # In this case, there is a single Loki datasourceUID
79+ # with UID "klja8hsa-8a9c-4b35-1230-7baab22b02ee"
80+
81+
82+
83+ .. md-tab-item :: Grafana Cloud
84+
85+ Choose the datasource you want to use for logs and click on it.
86+
87+ .. image :: /images/grafana-loki-holmes-uid1.png
88+ :width: 600
89+ :align: center
90+
91+ The part of the URL after ``edit/ `` is the UID.
92+
93+ .. image :: /images/grafana-loki-holmes-uid2.png
94+ :width: 600
95+ :align: center
7696
7797Configuration
7898^^^^^^^^^^^^^
0 commit comments