Skip to content

Commit 111899e

Browse files
committed
ADD: grafana example
1 parent 2aee84a commit 111899e

File tree

6 files changed

+709
-0
lines changed

6 files changed

+709
-0
lines changed

grafana_monitoring/README.md

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Monitoring
2+
3+
Learn how to configure Prometheus & Grafana to monitor your Pinecone Projects with Docker Compose.
4+
5+
## Configuration
6+
7+
Each Project needs to be configured with its own Prometheus scraper. You will need a Pinecone API
8+
Key to authorize Prometheus to fetch the metrics. For the target, you need to specify the Project's region,
9+
for example `us-west1-gcp`. Update the file found at `./prometheus/config.yml`
10+
11+
```yaml
12+
scrape_configs:
13+
- job_name: pinecone-project-1
14+
authorization:
15+
credentials: <APIKEY>
16+
scheme: https
17+
static_configs:
18+
- targets: [ 'metrics.<PROJECT REGION>.pinecone.io' ]
19+
```
20+
21+
22+
### Grafana
23+
24+
Grafana is configured by default to run against the local Prometheus instance. A sample dashboard
25+
for monitoring all indexes in a Project is preloaded into Grafana. You can add this dashboard to your own
26+
Grafana instance by copying `./grafana/dashbords/pinecone.json`.
27+
28+
## Run
29+
30+
Start docker compose
31+
32+
```shell
33+
docker-compose up
34+
```
35+
36+
Check the ports Grafana and Promethus are running on
37+
38+
```shell
39+
docker-compose ps
40+
```
41+
42+
Open Grafana in your browser an navigate to Dashboard. The default dashboard is a folder titled Pinecone.

grafana_monitoring/docker-compose.yml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
version: '2.1'
2+
3+
volumes:
4+
prometheus_data: { }
5+
grafana_data: { }
6+
7+
services:
8+
prometheus:
9+
image: prom/prometheus
10+
container_name: prometheus
11+
volumes:
12+
- ./prometheus:/etc/prometheus
13+
- prometheus_data:/prometheus
14+
command:
15+
- '--config.file=/etc/prometheus/config.yml'
16+
- '--storage.tsdb.path=/prometheus'
17+
- '--web.console.libraries=/etc/prometheus/console_libraries'
18+
- '--web.console.templates=/etc/prometheus/consoles'
19+
- '--storage.tsdb.retention.time=200h'
20+
- '--web.enable-lifecycle'
21+
ports:
22+
- "9090"
23+
grafana:
24+
image: grafana/grafana-oss
25+
container_name: grafana
26+
volumes:
27+
- grafana_data:/var/lib/grafana
28+
- ./grafana/provisioning:/etc/grafana/provisioning
29+
- ./grafana/dashboards:/var/lib/grafana/dashboards
30+
ports:
31+
- 3000:3000

0 commit comments

Comments
 (0)