Skip to content

Feature/logging prometheus#163

Merged
afarut merged 11 commits into
devfrom
feature/logging-prometheus
Sep 9, 2023
Merged

Feature/logging prometheus#163
afarut merged 11 commits into
devfrom
feature/logging-prometheus

Conversation

@afarut
Copy link
Copy Markdown
Collaborator

@afarut afarut commented Jul 14, 2023

Метрики

Внес изменения в докер

Добавил графану, работает на 3000 порту. Node-exporter для отслеживания метрик систем и сам Prometheus для сбора метрик. Добавил "web" (название контейнера) в переменную ALLOWED_HOSTS по просьбе Prometheus.

Проверка кода

После запуска докера переходим по ссылке и проверяем работоспособность графаны, доступ admin admin.
Далее переходим по ссылке и добавляем прометеус http://localhost:3000/datasources
Settings > HTTP > URL > http://prometheus:9090
Далее проматываем внизу и нажимаем Save and test
Переходим по ссылке http://localhost:3000/dashboard/import и импортим нужный шаблон via grafana.com (9528)
Теперь тотально кайфуем.

Дополнительная информация

В планах настроить nginx, чтобы графана работала на основном порте сервиса и добавить отслеживание метрик для нескольких самых популярных моделей.

Важно

Смерджить feature/nginx > feature/logging-prometheus
#172

@afarut afarut requested a review from yakser July 14, 2023 12:52
Copy link
Copy Markdown
Contributor

@VeryBigSad VeryBigSad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

кайфы

Comment thread docker-compose.yml Outdated
HOST: 0.0.0.0 No newline at end of file
HOST: 0.0.0.0
grafana:
image: grafana/grafana:8.5.3-ubuntu
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

графана лейтест мб?

Comment thread procollab/settings.py
Comment on lines +321 to +339
PROMETHEUS_LATENCY_BUCKETS = (
0.01,
0.025,
0.05,
0.075,
0.1,
0.25,
0.5,
0.75,
1.0,
2.5,
5.0,
7.5,
10.0,
25.0,
50.0,
75.0,
float("inf"),
)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Странно, что это нужно указывать в настройках
Я бы такие бакеты поставил, но в целом as you wish
0.1
0.5
1
3
5
10

10

@VeryBigSad
Copy link
Copy Markdown
Contributor

Еще, если у тебя жалуется линтер, то ты, кажется, не подключил pre-commit хуки, они должны будут перед коммитом форматировать все файлики и проверять их на всякое полезное. В ридми написано, как установить, полезная штука

Copy link
Copy Markdown
Member

@yakser yakser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

круто, надеюсь заведётся

Copy link
Copy Markdown
Contributor

@VeryBigSad VeryBigSad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

кайф

Copy link
Copy Markdown
Member

@yakser yakser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

не работает
image

  • скрыты роуты prometheus

@afarut afarut merged commit 1a05988 into dev Sep 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants