> For the complete documentation index, see [llms.txt](https://note.onurbolatoglu.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://note.onurbolatoglu.com/prometheus/grafana.md).

# Grafana

#### Ubuntu 20.04 Grafana kurulumu =>&#x20;

1. Öncelikle, yeni bir paket listesi almak için aşağıdaki komutu çalıştırın:

```bash
sudo apt update
```

2. Grafana'yı indirebilmek için apt deposunu ekleyin. Bunun için aşağıdaki komutları kullanın:

```bash
sudo apt-get install -y apt-transport-https
sudo apt-get install -y software-properties-common wget
wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add -
echo "deb https://packages.grafana.com/oss/deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list
```

3. Şimdi, Grafana'yı yükleyebilirsiniz. Yüklemek için aşağıdaki komutları çalıştırın:

```bash
sudo apt update
sudo apt-get install grafana
```

4. Grafana'yı başlatın ve sistem başladığında otomatik olarak başlamasını sağlayın. Bunun için aşağıdaki komutları kullanın:

```bash
sudo systemctl start grafana-server
sudo systemctl enable grafana-server
```

5. Grafana'yı web tarayıcınızdan erişilebilir hale getirmek için, tarayıcınızda `http://your_server_ip:3000` adresini ziyaret edin. Varsayılan kullanıcı adı `admin` ve şifre `admin`'dır.

<figure><img src="/files/kPyTRbEGT3mkDCWgJKFw" alt=""><figcaption><p>Grafana web arayüzü</p></figcaption></figure>

#### Adding Data source to Grafana

1. Grafana'ya giriş yapın: Grafana'ya giriş yapmak için tarayıcınızın adres çubuğuna `http://your_server_ip:3000` girin. Varsayılan kullanıcı adı ve şifre `admin`'dır.

<figure><img src="/files/NyAzVGcKVojZfIvzWmNg" alt=""><figcaption></figcaption></figure>

1. Sidebar'dan "Data Sources" seçeneğini bulun: Grafana'nın ana ekranında, sol taraftaki yan menüde "Configuration" (ayarlar) simgesini (dişli çark) bulun ve ona tıklayın. Ardından "Data Sources" seçeneğini seçin.

<figure><img src="/files/Nw9Cpvr4wuN5sTbj5yUf" alt=""><figcaption></figcaption></figure>

1. "Add data source" tıklayın: Bu, yeni bir data source eklemenize olanak sağlayacak bir ekranı açacaktır.
2. Data source tipini seçin: Mevcut data source türlerinin listesini göreceksiniz. Bu örnekte, Prometheus'u seçeceğiz.

<figure><img src="/files/r8KFbQBUIcV00PqYQram" alt=""><figcaption></figcaption></figure>

1. Detayları girin: Prometheus sunucunuzun URL'sini ve diğer gereken bilgileri girin. URL genellikle `http://<prometheus-server-ip>:9090` şeklindedir.
2. "Save & Test" tıklayın: Grafana, ayarların doğruluğunu kontrol etmek ve data source ile bağlantıyı test etmek için bu butonu kullanır. Eğer her şey doğruysa, "Data source is working" (data source çalışıyor) mesajını göreceksiniz.
3. İşlem tamam! Artık Grafana'ya data source eklediniz ve panolar oluştururken bu data source'dan veri çekebilirsiniz.

<figure><img src="/files/hbJSZygpztThBfN4nO53" alt=""><figcaption></figcaption></figure>

#### Grafana No data problemi çözümü:

<figure><img src="/files/xUoEpKGaePAdbMGetnHO" alt=""><figcaption></figcaption></figure>

Prometheus yapılandırma dosyasına, grafana servisini target olarak ekliyoruz.

{% code title="/etc/prometheus/prometheus.yml" %}

```yaml
  - job_name: "grafana"
    static_configs:
      - targets: ["10.90.0.138:3000"] # Grafana IP:Port
```

{% endcode %}

Ardından prometheus servisini restart ediyoruz.

```bash
systemctl restart prometheus
```

Servisi yeniden başlattıktan sonra, Grafana ara yüzü kontrol ettiğimizde verilerin geldiğini görüyoruz.&#x20;

<figure><img src="/files/KGx6nFyXyp7u4dhc613f" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://note.onurbolatoglu.com/prometheus/grafana.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
