Implement Lab 7 security and infrastructure
Skeleton contracts / contracts (pull_request) Canceled after 0s

This commit is contained in:
sinveria
2026-11-22 11:55:09 +03:00
parent 20afc2c790
commit 6b5461a6b4
83 changed files with 8072 additions and 53 deletions
+171
View File
@@ -0,0 +1,171 @@
{
"id": null,
"uid": "messenger-overview",
"title": "Messenger — Observability",
"tags": ["messenger", "lab6", "observability"],
"timezone": "browser",
"schemaVersion": 39,
"version": 1,
"refresh": "10s",
"time": {
"from": "now-1h",
"to": "now"
},
"panels": [
{
"id": 1,
"title": "API Requests Per Second",
"type": "timeseries",
"gridPos": {"h": 8, "w": 12, "x": 0, "y": 0},
"datasource": {"type": "prometheus", "uid": "prometheus"},
"targets": [
{
"refId": "A",
"expr": "sum(rate(messenger_http_server_duration_milliseconds_count[5m]))",
"legendFormat": "Requests/sec"
}
],
"fieldConfig": {
"defaults": {
"unit": "reqps",
"min": 0
},
"overrides": []
},
"options": {
"legend": {"displayMode": "list", "placement": "bottom"},
"tooltip": {"mode": "multi"}
}
},
{
"id": 2,
"title": "API Error Rate",
"type": "timeseries",
"gridPos": {"h": 8, "w": 12, "x": 12, "y": 0},
"datasource": {"type": "prometheus", "uid": "prometheus"},
"targets": [
{
"refId": "A",
"expr": "100 * sum(rate(messenger_http_server_duration_milliseconds_count{http_response_status_code=~\"5..\"}[5m])) / clamp_min(sum(rate(messenger_http_server_duration_milliseconds_count[5m])), 0.001)",
"legendFormat": "5xx errors (%)"
}
],
"fieldConfig": {
"defaults": {
"unit": "percent",
"min": 0,
"max": 100
},
"overrides": []
},
"options": {
"legend": {"displayMode": "list", "placement": "bottom"},
"tooltip": {"mode": "multi"}
}
},
{
"id": 3,
"title": "API Request Duration — p95",
"type": "timeseries",
"gridPos": {"h": 8, "w": 12, "x": 0, "y": 8},
"datasource": {"type": "prometheus", "uid": "prometheus"},
"targets": [
{
"refId": "A",
"expr": "histogram_quantile(0.95, sum by (le) (rate(messenger_http_server_duration_milliseconds_bucket[5m])))",
"legendFormat": "p95"
}
],
"fieldConfig": {
"defaults": {
"unit": "ms",
"min": 0
},
"overrides": []
},
"options": {
"legend": {"displayMode": "list", "placement": "bottom"},
"tooltip": {"mode": "multi"}
}
},
{
"id": 4,
"title": "Successful Background Jobs",
"type": "timeseries",
"gridPos": {"h": 8, "w": 12, "x": 12, "y": 8},
"datasource": {"type": "prometheus", "uid": "prometheus"},
"targets": [
{
"refId": "A",
"expr": "sum(rate(messenger_jobs_processed_total[5m]))",
"legendFormat": "Successful jobs/sec"
}
],
"fieldConfig": {
"defaults": {
"unit": "ops",
"min": 0
},
"overrides": []
},
"options": {
"legend": {"displayMode": "list", "placement": "bottom"},
"tooltip": {"mode": "multi"}
}
},
{
"id": 5,
"title": "Failed Background Jobs",
"type": "timeseries",
"gridPos": {"h": 8, "w": 12, "x": 0, "y": 16},
"datasource": {"type": "prometheus", "uid": "prometheus"},
"targets": [
{
"refId": "A",
"expr": "sum(rate(messenger_jobs_failed_total[5m]))",
"legendFormat": "Failed jobs/sec"
}
],
"fieldConfig": {
"defaults": {
"unit": "ops",
"min": 0
},
"overrides": []
},
"options": {
"legend": {"displayMode": "list", "placement": "bottom"},
"tooltip": {"mode": "multi"}
}
},
{
"id": 6,
"title": "Job Processing Duration — p95",
"type": "timeseries",
"gridPos": {"h": 8, "w": 12, "x": 12, "y": 16},
"datasource": {"type": "prometheus", "uid": "prometheus"},
"targets": [
{
"refId": "A",
"expr": "histogram_quantile(0.95, sum by (le) (rate(messenger_job_processing_duration_seconds_bucket[5m])))",
"legendFormat": "p95"
}
],
"fieldConfig": {
"defaults": {
"unit": "s",
"min": 0
},
"overrides": []
},
"options": {
"legend": {"displayMode": "list", "placement": "bottom"},
"tooltip": {"mode": "multi"}
}
}
],
"annotations": {
"list": []
},
"links": []
}
@@ -0,0 +1,11 @@
apiVersion: 1
providers:
- name: Messenger
orgId: 1
folder: Messenger
type: file
disableDeletion: false
editable: true
options:
path: /var/lib/grafana/dashboards
@@ -0,0 +1,41 @@
apiVersion: 1
datasources:
- name: Prometheus
uid: prometheus
type: prometheus
access: proxy
url: https://tls-proxy:19090
isDefault: true
editable: false
jsonData:
tlsAuthWithCACert: true
secureJsonData:
tlsCACert: "$__file{/run/tls/ca.crt}"
- name: Loki
uid: loki
type: loki
access: proxy
url: https://tls-proxy:13100
editable: false
jsonData:
tlsAuthWithCACert: true
derivedFields:
- name: TraceID
matcherRegex: '"trace_id":"([0-9a-f]{32})"'
datasourceUid: tempo
url: '$${__value.raw}'
secureJsonData:
tlsCACert: "$__file{/run/tls/ca.crt}"
- name: Tempo
uid: tempo
type: tempo
access: proxy
url: https://tls-proxy:13200
editable: false
jsonData:
tlsAuthWithCACert: true
secureJsonData:
tlsCACert: "$__file{/run/tls/ca.crt}"