012 remove signoz

This commit is contained in:
Раис Юсупалиев
2026-03-08 22:59:11 +03:00
parent 81e484d7d1
commit f799f2ba03
29 changed files with 118 additions and 1323 deletions
+2 -9
View File
@@ -4,7 +4,6 @@
- `app`: FastAPI service (`uvicorn app.main:app`) built from root `Dockerfile`
- `redis`: price cache backend
- `signoz`: observability backend (UI + OTLP receiver)
## Environment wiring
@@ -12,20 +11,14 @@
- `G2S_CONFIG_FILE=/app/config.yaml`
- `G2S_REPOSITORY__REDIS_DSN=redis://redis:6379/0`
- `G2S_OBSERVABILITY__OTLP_ENDPOINT=http://signoz:4317`
- `PYTHONUNBUFFERED=1`
### `signoz` service
- `G2S_ALERTS__TELEGRAM_BOT_TOKEN` (optional for Telegram alerts)
- `G2S_ALERTS__TELEGRAM_CHAT_ID` (optional for Telegram alerts)
## Startup instructions
1. Validate compose syntax:
- `docker compose config`
2. Start dependencies:
- `docker compose up -d redis signoz`
- `docker compose up -d redis`
3. Verify running containers:
- `docker compose ps`
4. Start application:
@@ -37,6 +30,6 @@
```bash
docker compose config
docker compose up -d redis signoz
docker compose up -d redis
docker compose ps
```
-39
View File
@@ -1,39 +0,0 @@
# SigNoz -> Telegram alerting setup
## Alerts config section example (`config.yaml`)
```yaml
alerts:
telegram_enabled: true
telegram_bot_token: "123456789:telegram-bot-token"
telegram_chat_id: "-1000000000000"
provider_5xx:
error_count: 5
window_minutes: 5
provider_p99_latency:
threshold_ms: 5000
window_minutes: 10
provider_unavailable:
duration_minutes: 5
```
## Routing artifacts
- `signoz_contact_point_telegram.yaml`:
- webhook endpoint points to Telegram Bot API `sendMessage`
- uses `G2S_ALERTS__TELEGRAM_BOT_TOKEN` and `G2S_ALERTS__TELEGRAM_CHAT_ID`
- `signoz_alert_rules.yaml`:
- provider 5xx: `>= 5 errors / 5m`
- provider p99 latency: `> 5000ms / 10m`
- provider unavailable: `> 5m`
## Local verification steps
1. Export Telegram variables (must match `config.yaml -> alerts` values):
- `export G2S_ALERTS__TELEGRAM_BOT_TOKEN="<bot_token>"`
- `export G2S_ALERTS__TELEGRAM_CHAT_ID="<chat_id>"`
2. Validate compose syntax:
- `docker compose config`
3. In SigNoz UI, create a webhook contact point using `infra/alerts/signoz_contact_point_telegram.yaml`.
4. Create three alert rules from `infra/alerts/signoz_alert_rules.yaml`.
5. Use SigNoz "Test alert" action and verify message delivery in Telegram chat.
-41
View File
@@ -1,41 +0,0 @@
rules:
- name: "provider-5xx-errors"
description: "Provider returned >= 5 server errors in 5 minutes."
severity: "critical"
condition:
query: |
sum(increase(g2s_provider_errors_total{status_code=~"5.."}[5m])) by (provider) >= 5
evaluate_for: "0m"
threshold:
error_count: 5
window_minutes: 5
annotations:
summary: "Provider {{ $labels.provider }} returned >= 5 5xx responses during last 5m."
- name: "provider-p99-latency"
description: "Provider p99 latency is above 5000ms for 10 minutes."
severity: "warning"
condition:
query: |
histogram_quantile(
0.99,
sum(rate(g2s_provider_latency_ms_bucket[10m])) by (provider, le)
) > 5000
evaluate_for: "10m"
threshold:
threshold_ms: 5000
window_minutes: 10
annotations:
summary: "Provider {{ $labels.provider }} p99 latency > 5000ms for 10m."
- name: "provider-unavailable"
description: "Provider is unavailable for more than 5 minutes."
severity: "critical"
condition:
query: |
max_over_time(g2s_provider_available[5m]) == 0
evaluate_for: "5m"
threshold:
duration_minutes: 5
annotations:
summary: "Provider {{ $labels.provider }} is unavailable for more than 5m."
@@ -1,14 +0,0 @@
contact_point:
name: "telegram-webhook"
type: "webhook"
settings:
method: "POST"
url: "https://api.telegram.org/bot${G2S_ALERTS__TELEGRAM_BOT_TOKEN}/sendMessage"
headers:
Content-Type: "application/json"
body: |
{
"chat_id": "${G2S_ALERTS__TELEGRAM_CHAT_ID}",
"text": "[{{ .Status }}] {{ .RuleName }}\nProvider: {{ index .Labels \"provider\" }}\nSummary: {{ index .Annotations \"summary\" }}",
"disable_notification": false
}