Skip to content

Commit c1f2190

Browse files
fix(grafana-datasource): Grafana Datasource pointing to wrong service (cortexproject#6819)
Signed-off-by: Ajay-Satish-01 <ajay.satishpriya@gmail.com>
1 parent 8e3674d commit c1f2190

File tree

4 files changed

+91
-12
lines changed

4 files changed

+91
-12
lines changed

docs/getting-started/_index.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ $ git clone https://github.com/cortexproject/cortex.git
5151
$ cd cortex/docs/getting-started
5252
```
5353

54+
**Note**: This guide uses `grafana-datasource-docker.yaml` which is specifically configured for the single binary Docker Compose deployment. For Kubernetes/microservices mode, use `grafana-datasource.yaml` instead.
55+
5456
##### Start the services
5557

5658
```sh
@@ -215,6 +217,8 @@ how this is configured.
215217
$ helm upgrade --install --version=7.3.9 --namespace cortex grafana grafana/grafana -f grafana-values.yaml --wait
216218
```
217219

220+
**Note**: This guide uses `grafana-values.yaml` with Helm to configure Grafana datasources. Alternatively, you can manually deploy Grafana with `grafana-datasource.yaml` which is specifically configured for Kubernetes/microservices mode with the correct `cortex-nginx` endpoints.
221+
218222
```sh
219223
# Create dashboards for Cortex
220224
$ for dashboard in $(ls dashboards); do

docs/getting-started/docker-compose.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ services:
2020
ports:
2121
- "9009:9009"
2222
healthcheck:
23-
test: wget -qO- http://127.0.0.1:9009/ready
24-
interval: 10s
25-
timeout: 10s
26-
retries: 3
23+
test: wget -qO- http://127.0.0.1:9009/ready
24+
interval: 10s
25+
timeout: 10s
26+
retries: 3
2727
restart: on-failure
2828
grafana:
2929
image: grafana/grafana:${GRAFANA_VERSION}
@@ -34,7 +34,7 @@ services:
3434
- GF_LOG_MODE=console
3535
- GF_LOG_LEVEL=critical
3636
volumes:
37-
- ./grafana-datasource.yaml:/etc/grafana/provisioning/datasources/datasource.yaml:ro
37+
- ./grafana-datasource-docker.yaml:/etc/grafana/provisioning/datasources/datasource.yaml:ro
3838
- ./grafana-dashboard.yaml:/etc/grafana/provisioning/dashboards/dashboards.yaml:ro
3939
- ./dashboards/:/var/lib/grafana/dashboards/:ro
4040
ports:
@@ -66,7 +66,7 @@ services:
6666
ports:
6767
- "8333:8333"
6868
post_start:
69-
- command: /seaweedfs-init.sh
69+
- command: /seaweedfs-init.sh
7070
volumes:
7171
- ./seaweedfs-config.json:/workspace/seaweedfs-config.json:ro
7272
- ./seaweedfs-init.sh:/seaweedfs-init.sh:ro
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Grafana datasource configuration for Docker Compose/single binary mode
2+
# For Kubernetes mode, use grafana-datasource.yaml instead
3+
apiVersion: 1
4+
5+
datasources:
6+
- name: Cortex
7+
type: prometheus
8+
access: proxy
9+
orgId: 1
10+
url: http://cortex:9009/api/prom
11+
jsonData: &jsonData
12+
cacheLevel: None
13+
httpHeaderName1: X-Scope-OrgID
14+
httpMethod: POST
15+
prometheusType: Cortex
16+
prometheusVersion: 1.14.0
17+
timeInterval: 15s
18+
secureJsonData:
19+
httpHeaderValue1: cortex
20+
version: 1
21+
editable: true
22+
isDefault: true
23+
- name: Tenant A
24+
type: prometheus
25+
access: proxy
26+
orgId: 1
27+
url: http://cortex:9009/api/prom
28+
jsonData: *jsonData
29+
secureJsonData:
30+
httpHeaderValue1: tenant-a
31+
version: 1
32+
editable: true
33+
- name: Tenant B
34+
type: prometheus
35+
access: proxy
36+
orgId: 1
37+
url: http://cortex:9009/api/prom
38+
jsonData: *jsonData
39+
secureJsonData:
40+
httpHeaderValue1: tenant-b
41+
version: 1
42+
editable: true
43+
- name: Tenant C
44+
type: prometheus
45+
access: proxy
46+
orgId: 1
47+
url: http://cortex:9009/api/prom
48+
jsonData: *jsonData
49+
secureJsonData:
50+
httpHeaderValue1: tenant-c
51+
version: 1
52+
editable: true
53+
- name: Tenant D
54+
type: prometheus
55+
access: proxy
56+
orgId: 1
57+
url: http://cortex:9009/api/prom
58+
jsonData: *jsonData
59+
secureJsonData:
60+
httpHeaderValue1: tenant-d
61+
version: 1
62+
editable: true
63+
- orgId: 1
64+
name: Cortex Alertmanager
65+
type: alertmanager
66+
access: proxy
67+
url: http://cortex:9009/
68+
jsonData:
69+
httpHeaderName1: X-Scope-OrgID
70+
implementation: cortex
71+
secureJsonData:
72+
httpHeaderValue1: cortex
73+
version: 1

docs/getting-started/grafana-datasource.yaml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1+
# Grafana datasource configuration for Kubernetes/microservices mode
2+
# For Docker Compose mode, use grafana-datasource-docker.yaml instead
13
apiVersion: 1
24

35
datasources:
46
- name: Cortex
57
type: prometheus
68
access: proxy
79
orgId: 1
8-
url: http://cortex:9009/api/prom
10+
url: http://cortex-nginx/api/prom
911
jsonData: &jsonData
1012
cacheLevel: None
1113
httpHeaderName1: X-Scope-OrgID
@@ -22,7 +24,7 @@ datasources:
2224
type: prometheus
2325
access: proxy
2426
orgId: 1
25-
url: http://cortex:9009/api/prom
27+
url: http://cortex-nginx/api/prom
2628
jsonData: *jsonData
2729
secureJsonData:
2830
httpHeaderValue1: tenant-a
@@ -32,7 +34,7 @@ datasources:
3234
type: prometheus
3335
access: proxy
3436
orgId: 1
35-
url: http://cortex:9009/api/prom
37+
url: http://cortex-nginx/api/prom
3638
jsonData: *jsonData
3739
secureJsonData:
3840
httpHeaderValue1: tenant-b
@@ -42,7 +44,7 @@ datasources:
4244
type: prometheus
4345
access: proxy
4446
orgId: 1
45-
url: http://cortex:9009/api/prom
47+
url: http://cortex-nginx/api/prom
4648
jsonData: *jsonData
4749
secureJsonData:
4850
httpHeaderValue1: tenant-c
@@ -52,7 +54,7 @@ datasources:
5254
type: prometheus
5355
access: proxy
5456
orgId: 1
55-
url: http://cortex:9009/api/prom
57+
url: http://cortex-nginx/api/prom
5658
jsonData: *jsonData
5759
secureJsonData:
5860
httpHeaderValue1: tenant-d
@@ -62,7 +64,7 @@ datasources:
6264
name: Cortex Alertmanager
6365
type: alertmanager
6466
access: proxy
65-
url: http://cortex:9009/
67+
url: http://cortex-nginx/
6668
jsonData:
6769
httpHeaderName1: X-Scope-OrgID
6870
implementation: cortex

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy