> For the complete documentation index, see [llms.txt](https://utm-1.gitbook.io/utm-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://utm-1.gitbook.io/utm-docs/dokumentaciya/utm-it/resheniya/monitoring/prometheus/monitoring-mongodb.md).

# Мониторинг MongoDB

## Ссылки

percona / mongodb\_exporter: [github.com](https://github.com/percona/mongodb_exporter)

percona/mongodb\_exporter: [hub.docker.com](https://hub.docker.com/r/percona/mongodb_exporter)

Как мониторить MongoDB с Grafana и Prometheus на Ubuntu 24: [arenda-server.cloud](https://arenda-server.cloud/blog/kak-monitorit-mongodb-s-grafana-i-prometheus-na-ubuntu-24/)

## Установка MongoDB exporter

Описано [тут](/utm-docs/dokumentaciya/utm-it/resheniya/subd/mongodb/instansy/utm-mongodb8-na-utm-db4-9.md)

## Настройка Prometheus

### Регистрация target

В файле `argocd\env-prod\apps\monitoring\prometheus\values.yaml`&#x20;

<details>

<summary>Изменения в файле <code>argocd\env-prod\apps\monitoring\prometheus\values.yaml</code></summary>

Добавить ip сервера в секцию&#x20;

prometheus\prometheusSpec\additionalScrapeConfigs

```yaml
    additionalScrapeConfigs: |
      - job_name: 'mongodb_exporter'
        static_configs:
          - targets:
            - 192.168.4.9:9216
```

Сделать коммит в репозиторий GitHub с обновлением файла `values.yaml`&#x20;

Дождаться, когда Argo CD обновить приложение k8s-prometheus.

</details>

### Настройка оповещений

{% hint style="info" %}
**ПРОРАБОТАТЬ!!!**
{% endhint %}

## Настройка Grafana

### Импорт дашбордов из Argo CD

В файле `argocd\env-prod\apps\monitoring\grafana\values.yaml` добавить

<details>

<summary>Изменения в файле <code>argocd\env-prod\apps\monitoring\grafana\values.yaml</code></summary>

```yaml
dashboardProviders:
    - name: 'mongodb'
      orgId: 1
      folder: 'MongoDB'
      type: file
      disableDeletion: false
      editable: true
      options:
        path: /var/lib/grafana/dashboards/mongodb
        foldersFromFilesStructure: false
```

Сделать коммит в репозиторий GitHub с обновлением файла `values.yaml`&#x20;

Дождаться, когда Argo CD обновить приложение k8s-grafana.

</details>

#### Дашборды

<details>

<summary>Описание импортируемых дашбордов</summary>

Пока нет

</details>

### Ручной импорт дашбордов

В Grafana: Dashboards → Import → вставь ID  → выбери источник Prometheus.

Каталог в дашбордах: `MongoDB`

#### Дашборды

<details>

<summary>Описание импортируемых дашбордов</summary>

#### MongoDB (12079)

Ссылка: [grafana.com](https://grafana.com/grafana/dashboards/12079-mongodb/)

ID: 12079

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

#### Mongodb Dashboard (20867)

Ссылка: [grafana.com](https://grafana.com/grafana/dashboards/20867-mongodb-dashboard/)

ID: 20867

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

#### MongoDB Overview (20192)

Ссылка: [grafana.com](https://grafana.com/grafana/dashboards/20192-mongodb-overview/)

ID: 20192

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

#### MongoDB Overview Hmx (5270)

Ссылка: [grafana.com](https://grafana.com/grafana/dashboards/5270-mongodb-overview-hmx/)

ID: 5270

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

</details>


---

# 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, and the optional `goal` query parameter:

```
GET https://utm-1.gitbook.io/utm-docs/dokumentaciya/utm-it/resheniya/monitoring/prometheus/monitoring-mongodb.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
