forked from mtusi2026/mtusi2026lab7
lab7
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
static_resources:
|
||||
clusters:
|
||||
- connect_timeout: 3s
|
||||
load_assignment:
|
||||
cluster_name: local_8080
|
||||
endpoints:
|
||||
- lb_endpoints:
|
||||
- endpoint:
|
||||
address:
|
||||
socket_address:
|
||||
address: 127.0.0.1
|
||||
port_value: 8080
|
||||
name: local_8080
|
||||
type: STATIC
|
||||
listeners:
|
||||
- address:
|
||||
socket_address:
|
||||
address: 0.0.0.0
|
||||
port_value: 8443
|
||||
filter_chains:
|
||||
- filters:
|
||||
- name: envoy.filters.network.tcp_proxy
|
||||
typed_config:
|
||||
'@type': type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy
|
||||
cluster: local_8080
|
||||
stat_prefix: local_8080
|
||||
transport_socket:
|
||||
name: envoy.transport_sockets.tls
|
||||
typed_config:
|
||||
'@type': type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.DownstreamTlsContext
|
||||
common_tls_context:
|
||||
tls_certificates:
|
||||
- certificate_chain:
|
||||
filename: /identity/api.crt
|
||||
private_key:
|
||||
filename: /identity/api.key
|
||||
tls_params:
|
||||
tls_minimum_protocol_version: TLSv1_2
|
||||
validation_context:
|
||||
crl:
|
||||
filename: /pki/ca.crl
|
||||
match_typed_subject_alt_names:
|
||||
- matcher:
|
||||
exact: client-api
|
||||
san_type: DNS
|
||||
trusted_ca:
|
||||
filename: /pki/ca.crt
|
||||
require_client_certificate: true
|
||||
name: tls_8443
|
||||
@@ -0,0 +1,40 @@
|
||||
static_resources:
|
||||
clusters:
|
||||
- connect_timeout: 3s
|
||||
load_assignment:
|
||||
cluster_name: local_13000
|
||||
endpoints:
|
||||
- lb_endpoints:
|
||||
- endpoint:
|
||||
address:
|
||||
socket_address:
|
||||
address: 127.0.0.1
|
||||
port_value: 13000
|
||||
name: local_13000
|
||||
type: STATIC
|
||||
listeners:
|
||||
- address:
|
||||
socket_address:
|
||||
address: 0.0.0.0
|
||||
port_value: 3000
|
||||
filter_chains:
|
||||
- filters:
|
||||
- name: envoy.filters.network.tcp_proxy
|
||||
typed_config:
|
||||
'@type': type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy
|
||||
cluster: local_13000
|
||||
stat_prefix: local_13000
|
||||
transport_socket:
|
||||
name: envoy.transport_sockets.tls
|
||||
typed_config:
|
||||
'@type': type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.DownstreamTlsContext
|
||||
common_tls_context:
|
||||
tls_certificates:
|
||||
- certificate_chain:
|
||||
filename: /identity/grafana.crt
|
||||
private_key:
|
||||
filename: /identity/grafana.key
|
||||
tls_params:
|
||||
tls_minimum_protocol_version: TLSv1_2
|
||||
require_client_certificate: false
|
||||
name: tls_3000
|
||||
@@ -0,0 +1,52 @@
|
||||
static_resources:
|
||||
clusters:
|
||||
- connect_timeout: 3s
|
||||
load_assignment:
|
||||
cluster_name: local_13100
|
||||
endpoints:
|
||||
- lb_endpoints:
|
||||
- endpoint:
|
||||
address:
|
||||
socket_address:
|
||||
address: 127.0.0.1
|
||||
port_value: 13100
|
||||
name: local_13100
|
||||
type: STATIC
|
||||
listeners:
|
||||
- address:
|
||||
socket_address:
|
||||
address: 0.0.0.0
|
||||
port_value: 3100
|
||||
filter_chains:
|
||||
- filters:
|
||||
- name: envoy.filters.network.tcp_proxy
|
||||
typed_config:
|
||||
'@type': type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy
|
||||
cluster: local_13100
|
||||
stat_prefix: local_13100
|
||||
transport_socket:
|
||||
name: envoy.transport_sockets.tls
|
||||
typed_config:
|
||||
'@type': type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.DownstreamTlsContext
|
||||
common_tls_context:
|
||||
tls_certificates:
|
||||
- certificate_chain:
|
||||
filename: /identity/loki.crt
|
||||
private_key:
|
||||
filename: /identity/loki.key
|
||||
tls_params:
|
||||
tls_minimum_protocol_version: TLSv1_2
|
||||
validation_context:
|
||||
crl:
|
||||
filename: /pki/ca.crl
|
||||
match_typed_subject_alt_names:
|
||||
- matcher:
|
||||
exact: otel-collector
|
||||
san_type: DNS
|
||||
- matcher:
|
||||
exact: grafana
|
||||
san_type: DNS
|
||||
trusted_ca:
|
||||
filename: /pki/ca.crt
|
||||
require_client_certificate: true
|
||||
name: tls_3100
|
||||
@@ -0,0 +1,98 @@
|
||||
static_resources:
|
||||
clusters:
|
||||
- connect_timeout: 3s
|
||||
load_assignment:
|
||||
cluster_name: local_14318
|
||||
endpoints:
|
||||
- lb_endpoints:
|
||||
- endpoint:
|
||||
address:
|
||||
socket_address:
|
||||
address: 127.0.0.1
|
||||
port_value: 14318
|
||||
name: local_14318
|
||||
type: STATIC
|
||||
- connect_timeout: 3s
|
||||
load_assignment:
|
||||
cluster_name: local_19464
|
||||
endpoints:
|
||||
- lb_endpoints:
|
||||
- endpoint:
|
||||
address:
|
||||
socket_address:
|
||||
address: 127.0.0.1
|
||||
port_value: 19464
|
||||
name: local_19464
|
||||
type: STATIC
|
||||
listeners:
|
||||
- address:
|
||||
socket_address:
|
||||
address: 0.0.0.0
|
||||
port_value: 4318
|
||||
filter_chains:
|
||||
- filters:
|
||||
- name: envoy.filters.network.tcp_proxy
|
||||
typed_config:
|
||||
'@type': type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy
|
||||
cluster: local_14318
|
||||
stat_prefix: local_14318
|
||||
transport_socket:
|
||||
name: envoy.transport_sockets.tls
|
||||
typed_config:
|
||||
'@type': type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.DownstreamTlsContext
|
||||
common_tls_context:
|
||||
tls_certificates:
|
||||
- certificate_chain:
|
||||
filename: /identity/otel-collector.crt
|
||||
private_key:
|
||||
filename: /identity/otel-collector.key
|
||||
tls_params:
|
||||
tls_minimum_protocol_version: TLSv1_2
|
||||
validation_context:
|
||||
crl:
|
||||
filename: /pki/ca.crl
|
||||
match_typed_subject_alt_names:
|
||||
- matcher:
|
||||
exact: api
|
||||
san_type: DNS
|
||||
- matcher:
|
||||
exact: worker
|
||||
san_type: DNS
|
||||
trusted_ca:
|
||||
filename: /pki/ca.crt
|
||||
require_client_certificate: true
|
||||
name: tls_4318
|
||||
- address:
|
||||
socket_address:
|
||||
address: 0.0.0.0
|
||||
port_value: 9464
|
||||
filter_chains:
|
||||
- filters:
|
||||
- name: envoy.filters.network.tcp_proxy
|
||||
typed_config:
|
||||
'@type': type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy
|
||||
cluster: local_19464
|
||||
stat_prefix: local_19464
|
||||
transport_socket:
|
||||
name: envoy.transport_sockets.tls
|
||||
typed_config:
|
||||
'@type': type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.DownstreamTlsContext
|
||||
common_tls_context:
|
||||
tls_certificates:
|
||||
- certificate_chain:
|
||||
filename: /identity/otel-collector.crt
|
||||
private_key:
|
||||
filename: /identity/otel-collector.key
|
||||
tls_params:
|
||||
tls_minimum_protocol_version: TLSv1_2
|
||||
validation_context:
|
||||
crl:
|
||||
filename: /pki/ca.crl
|
||||
match_typed_subject_alt_names:
|
||||
- matcher:
|
||||
exact: prometheus
|
||||
san_type: DNS
|
||||
trusted_ca:
|
||||
filename: /pki/ca.crt
|
||||
require_client_certificate: true
|
||||
name: tls_9464
|
||||
@@ -0,0 +1,49 @@
|
||||
static_resources:
|
||||
clusters:
|
||||
- connect_timeout: 3s
|
||||
load_assignment:
|
||||
cluster_name: local_19090
|
||||
endpoints:
|
||||
- lb_endpoints:
|
||||
- endpoint:
|
||||
address:
|
||||
socket_address:
|
||||
address: 127.0.0.1
|
||||
port_value: 19090
|
||||
name: local_19090
|
||||
type: STATIC
|
||||
listeners:
|
||||
- address:
|
||||
socket_address:
|
||||
address: 0.0.0.0
|
||||
port_value: 9090
|
||||
filter_chains:
|
||||
- filters:
|
||||
- name: envoy.filters.network.tcp_proxy
|
||||
typed_config:
|
||||
'@type': type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy
|
||||
cluster: local_19090
|
||||
stat_prefix: local_19090
|
||||
transport_socket:
|
||||
name: envoy.transport_sockets.tls
|
||||
typed_config:
|
||||
'@type': type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.DownstreamTlsContext
|
||||
common_tls_context:
|
||||
tls_certificates:
|
||||
- certificate_chain:
|
||||
filename: /identity/prometheus.crt
|
||||
private_key:
|
||||
filename: /identity/prometheus.key
|
||||
tls_params:
|
||||
tls_minimum_protocol_version: TLSv1_2
|
||||
validation_context:
|
||||
crl:
|
||||
filename: /pki/ca.crl
|
||||
match_typed_subject_alt_names:
|
||||
- matcher:
|
||||
exact: grafana
|
||||
san_type: DNS
|
||||
trusted_ca:
|
||||
filename: /pki/ca.crt
|
||||
require_client_certificate: true
|
||||
name: tls_9090
|
||||
@@ -0,0 +1,95 @@
|
||||
static_resources:
|
||||
clusters:
|
||||
- connect_timeout: 3s
|
||||
load_assignment:
|
||||
cluster_name: local_14318
|
||||
endpoints:
|
||||
- lb_endpoints:
|
||||
- endpoint:
|
||||
address:
|
||||
socket_address:
|
||||
address: 127.0.0.1
|
||||
port_value: 14318
|
||||
name: local_14318
|
||||
type: STATIC
|
||||
- connect_timeout: 3s
|
||||
load_assignment:
|
||||
cluster_name: local_13200
|
||||
endpoints:
|
||||
- lb_endpoints:
|
||||
- endpoint:
|
||||
address:
|
||||
socket_address:
|
||||
address: 127.0.0.1
|
||||
port_value: 13200
|
||||
name: local_13200
|
||||
type: STATIC
|
||||
listeners:
|
||||
- address:
|
||||
socket_address:
|
||||
address: 0.0.0.0
|
||||
port_value: 4318
|
||||
filter_chains:
|
||||
- filters:
|
||||
- name: envoy.filters.network.tcp_proxy
|
||||
typed_config:
|
||||
'@type': type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy
|
||||
cluster: local_14318
|
||||
stat_prefix: local_14318
|
||||
transport_socket:
|
||||
name: envoy.transport_sockets.tls
|
||||
typed_config:
|
||||
'@type': type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.DownstreamTlsContext
|
||||
common_tls_context:
|
||||
tls_certificates:
|
||||
- certificate_chain:
|
||||
filename: /identity/tempo.crt
|
||||
private_key:
|
||||
filename: /identity/tempo.key
|
||||
tls_params:
|
||||
tls_minimum_protocol_version: TLSv1_2
|
||||
validation_context:
|
||||
crl:
|
||||
filename: /pki/ca.crl
|
||||
match_typed_subject_alt_names:
|
||||
- matcher:
|
||||
exact: otel-collector
|
||||
san_type: DNS
|
||||
trusted_ca:
|
||||
filename: /pki/ca.crt
|
||||
require_client_certificate: true
|
||||
name: tls_4318
|
||||
- address:
|
||||
socket_address:
|
||||
address: 0.0.0.0
|
||||
port_value: 3200
|
||||
filter_chains:
|
||||
- filters:
|
||||
- name: envoy.filters.network.tcp_proxy
|
||||
typed_config:
|
||||
'@type': type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy
|
||||
cluster: local_13200
|
||||
stat_prefix: local_13200
|
||||
transport_socket:
|
||||
name: envoy.transport_sockets.tls
|
||||
typed_config:
|
||||
'@type': type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.DownstreamTlsContext
|
||||
common_tls_context:
|
||||
tls_certificates:
|
||||
- certificate_chain:
|
||||
filename: /identity/tempo.crt
|
||||
private_key:
|
||||
filename: /identity/tempo.key
|
||||
tls_params:
|
||||
tls_minimum_protocol_version: TLSv1_2
|
||||
validation_context:
|
||||
crl:
|
||||
filename: /pki/ca.crl
|
||||
match_typed_subject_alt_names:
|
||||
- matcher:
|
||||
exact: grafana
|
||||
san_type: DNS
|
||||
trusted_ca:
|
||||
filename: /pki/ca.crt
|
||||
require_client_certificate: true
|
||||
name: tls_3200
|
||||
@@ -0,0 +1,485 @@
|
||||
{
|
||||
"uid": "messenger-observability",
|
||||
"title": "Messenger — Observability",
|
||||
"schemaVersion": 40,
|
||||
"version": 1,
|
||||
"refresh": "5s",
|
||||
"time": {
|
||||
"from": "now-15m",
|
||||
"to": "now"
|
||||
},
|
||||
"panels": [
|
||||
{
|
||||
"id": 1,
|
||||
"title": "API RPS (business requests)",
|
||||
"type": "timeseries",
|
||||
"gridPos": {
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"w": 12,
|
||||
"h": 8
|
||||
},
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"refId": "A",
|
||||
"expr": "sum by(http_route)(rate(http_server_requests_total[$__rate_interval]))",
|
||||
"legendFormat": "{{http_route}}"
|
||||
}
|
||||
],
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"unit": "reqps"
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"title": "API p50 / p95 / p99 (all replicas)",
|
||||
"type": "timeseries",
|
||||
"gridPos": {
|
||||
"x": 12,
|
||||
"y": 0,
|
||||
"w": 12,
|
||||
"h": 8
|
||||
},
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"refId": "A",
|
||||
"expr": "histogram_quantile(0.5, sum by(le)(rate(http_server_request_duration_seconds_bucket[$__rate_interval])))",
|
||||
"legendFormat": "p50"
|
||||
},
|
||||
{
|
||||
"refId": "B",
|
||||
"expr": "histogram_quantile(0.95, sum by(le)(rate(http_server_request_duration_seconds_bucket[$__rate_interval])))",
|
||||
"legendFormat": "p95"
|
||||
},
|
||||
{
|
||||
"refId": "C",
|
||||
"expr": "histogram_quantile(0.99, sum by(le)(rate(http_server_request_duration_seconds_bucket[$__rate_interval])))",
|
||||
"legendFormat": "p99"
|
||||
}
|
||||
],
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"unit": "s"
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"title": "API error rate (5xx / all business requests)",
|
||||
"type": "timeseries",
|
||||
"gridPos": {
|
||||
"x": 0,
|
||||
"y": 8,
|
||||
"w": 12,
|
||||
"h": 8
|
||||
},
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"refId": "A",
|
||||
"expr": "(sum(rate(http_server_requests_total{http_response_status_class=\"5xx\"}[$__rate_interval])) or vector(0)) / clamp_min(sum(rate(http_server_requests_total[$__rate_interval])),0.001)",
|
||||
"legendFormat": "5xx ratio"
|
||||
}
|
||||
],
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"unit": "percentunit"
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"title": "Queue depth (durable outstanding jobs)",
|
||||
"type": "timeseries",
|
||||
"gridPos": {
|
||||
"x": 12,
|
||||
"y": 8,
|
||||
"w": 12,
|
||||
"h": 8
|
||||
},
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"refId": "A",
|
||||
"expr": "max(queue_depth)",
|
||||
"legendFormat": "jobs"
|
||||
}
|
||||
],
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"unit": "short"
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"title": "Oldest outstanding job / observation age",
|
||||
"type": "timeseries",
|
||||
"gridPos": {
|
||||
"x": 0,
|
||||
"y": 16,
|
||||
"w": 12,
|
||||
"h": 8
|
||||
},
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"refId": "A",
|
||||
"expr": "max(queue_oldest_age)",
|
||||
"legendFormat": "oldest"
|
||||
},
|
||||
{
|
||||
"refId": "B",
|
||||
"expr": "time()-max(queue_observation_timestamp)",
|
||||
"legendFormat": "observation age"
|
||||
}
|
||||
],
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"unit": "s"
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
{
|
||||
"id": 6,
|
||||
"title": "Worker saturation (busy / capacity)",
|
||||
"type": "timeseries",
|
||||
"gridPos": {
|
||||
"x": 12,
|
||||
"y": 16,
|
||||
"w": 12,
|
||||
"h": 8
|
||||
},
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"refId": "A",
|
||||
"expr": "sum(worker_busy) / clamp_min(sum(worker_capacity),1)",
|
||||
"legendFormat": "saturation"
|
||||
}
|
||||
],
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"unit": "percentunit"
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
{
|
||||
"id": 7,
|
||||
"title": "Worker outcomes per second",
|
||||
"type": "timeseries",
|
||||
"gridPos": {
|
||||
"x": 0,
|
||||
"y": 24,
|
||||
"w": 12,
|
||||
"h": 8
|
||||
},
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"refId": "A",
|
||||
"expr": "sum by(outcome)(rate(worker_jobs_total[$__rate_interval]))",
|
||||
"legendFormat": "{{outcome}}"
|
||||
}
|
||||
],
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"unit": "ops"
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
{
|
||||
"id": 8,
|
||||
"title": "Worker p50 / p95 / p99",
|
||||
"type": "timeseries",
|
||||
"gridPos": {
|
||||
"x": 12,
|
||||
"y": 24,
|
||||
"w": 12,
|
||||
"h": 8
|
||||
},
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"refId": "A",
|
||||
"expr": "histogram_quantile(0.5,sum by(le)(rate(worker_job_duration_seconds_bucket[$__rate_interval])))",
|
||||
"legendFormat": "p50"
|
||||
},
|
||||
{
|
||||
"refId": "B",
|
||||
"expr": "histogram_quantile(0.95,sum by(le)(rate(worker_job_duration_seconds_bucket[$__rate_interval])))",
|
||||
"legendFormat": "p95"
|
||||
},
|
||||
{
|
||||
"refId": "C",
|
||||
"expr": "histogram_quantile(0.99,sum by(le)(rate(worker_job_duration_seconds_bucket[$__rate_interval])))",
|
||||
"legendFormat": "p99"
|
||||
}
|
||||
],
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"unit": "s"
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
{
|
||||
"id": 9,
|
||||
"title": "DB pools (application + outbox)",
|
||||
"type": "timeseries",
|
||||
"gridPos": {
|
||||
"x": 0,
|
||||
"y": 32,
|
||||
"w": 12,
|
||||
"h": 8
|
||||
},
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"refId": "A",
|
||||
"expr": "sum(db_pool_used)",
|
||||
"legendFormat": "used"
|
||||
},
|
||||
{
|
||||
"refId": "B",
|
||||
"expr": "sum(db_pool_waiting)",
|
||||
"legendFormat": "waiting"
|
||||
},
|
||||
{
|
||||
"refId": "C",
|
||||
"expr": "sum(db_pool_capacity)",
|
||||
"legendFormat": "capacity"
|
||||
}
|
||||
],
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"unit": "short"
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
{
|
||||
"id": 10,
|
||||
"title": "Acceptance to ready p50 / p95 / p99",
|
||||
"type": "timeseries",
|
||||
"gridPos": {
|
||||
"x": 12,
|
||||
"y": 32,
|
||||
"w": 12,
|
||||
"h": 8
|
||||
},
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"refId": "A",
|
||||
"expr": "histogram_quantile(0.5,sum by(le)(rate(attachment_ready_duration_seconds_bucket[$__rate_interval])))",
|
||||
"legendFormat": "p50"
|
||||
},
|
||||
{
|
||||
"refId": "B",
|
||||
"expr": "histogram_quantile(0.95,sum by(le)(rate(attachment_ready_duration_seconds_bucket[$__rate_interval])))",
|
||||
"legendFormat": "p95"
|
||||
},
|
||||
{
|
||||
"refId": "C",
|
||||
"expr": "histogram_quantile(0.99,sum by(le)(rate(attachment_ready_duration_seconds_bucket[$__rate_interval])))",
|
||||
"legendFormat": "p99"
|
||||
}
|
||||
],
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"unit": "s"
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
{
|
||||
"id": 11,
|
||||
"title": "Process resident memory",
|
||||
"type": "timeseries",
|
||||
"gridPos": {
|
||||
"x": 0,
|
||||
"y": 40,
|
||||
"w": 12,
|
||||
"h": 8
|
||||
},
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"refId": "A",
|
||||
"expr": "process_memory_usage",
|
||||
"legendFormat": "{{service_name}} / {{service_instance_id}}"
|
||||
}
|
||||
],
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"unit": "bytes"
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
{
|
||||
"id": 12,
|
||||
"title": "Process CPU (cores)",
|
||||
"type": "timeseries",
|
||||
"gridPos": {
|
||||
"x": 12,
|
||||
"y": 40,
|
||||
"w": 12,
|
||||
"h": 8
|
||||
},
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"refId": "A",
|
||||
"expr": "rate(process_cpu_time[$__rate_interval])",
|
||||
"legendFormat": "{{service_name}} / {{service_instance_id}}"
|
||||
}
|
||||
],
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"unit": "short"
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
{
|
||||
"id": 13,
|
||||
"title": "Collector rejected/failed signal export",
|
||||
"type": "timeseries",
|
||||
"gridPos": {
|
||||
"x": 0,
|
||||
"y": 48,
|
||||
"w": 12,
|
||||
"h": 8
|
||||
},
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"refId": "A",
|
||||
"expr": "sum(rate(otelcol_exporter_send_failed_spans[$__rate_interval]))",
|
||||
"legendFormat": "exporter_send_failed_spans"
|
||||
},
|
||||
{
|
||||
"refId": "B",
|
||||
"expr": "sum(rate(otelcol_exporter_send_failed_log_records[$__rate_interval]))",
|
||||
"legendFormat": "exporter_send_failed_log_records"
|
||||
},
|
||||
{
|
||||
"refId": "C",
|
||||
"expr": "sum(rate(otelcol_processor_refused_spans[$__rate_interval]))",
|
||||
"legendFormat": "processor_refused_spans"
|
||||
},
|
||||
{
|
||||
"refId": "D",
|
||||
"expr": "sum(rate(otelcol_exporter_enqueue_failed_spans[$__rate_interval]))",
|
||||
"legendFormat": "exporter_enqueue_failed_spans"
|
||||
}
|
||||
],
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"unit": "short"
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
{
|
||||
"id": 14,
|
||||
"title": "Correlated application events",
|
||||
"type": "logs",
|
||||
"gridPos": {
|
||||
"x": 12,
|
||||
"y": 48,
|
||||
"w": 12,
|
||||
"h": 8
|
||||
},
|
||||
"datasource": {
|
||||
"type": "loki",
|
||||
"uid": "loki"
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"refId": "A",
|
||||
"expr": "{service_name=~\"messenger-api|messenger-worker\"}",
|
||||
"legendFormat": "logs"
|
||||
}
|
||||
],
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"unit": "short"
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"options": {}
|
||||
}
|
||||
],
|
||||
"tags": [
|
||||
"lab6"
|
||||
],
|
||||
"annotations": {
|
||||
"list": []
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
apiVersion: 1
|
||||
providers:
|
||||
- name: messenger
|
||||
folder: Messenger
|
||||
type: file
|
||||
options:
|
||||
path: /var/lib/grafana/dashboards
|
||||
@@ -0,0 +1,79 @@
|
||||
{
|
||||
"apiVersion": 1,
|
||||
"datasources": [
|
||||
{
|
||||
"access": "proxy",
|
||||
"isDefault": true,
|
||||
"jsonData": {
|
||||
"serverName": "prometheus",
|
||||
"tlsAuth": true,
|
||||
"tlsAuthWithCACert": true
|
||||
},
|
||||
"name": "Prometheus",
|
||||
"secureJsonData": {
|
||||
"tlsCACert": "$__file{/pki/ca.crt}",
|
||||
"tlsClientCert": "$__file{/identity/grafana.crt}",
|
||||
"tlsClientKey": "$__file{/identity/grafana.key}"
|
||||
},
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus",
|
||||
"url": "https://prometheus-tls:9090"
|
||||
},
|
||||
{
|
||||
"access": "proxy",
|
||||
"jsonData": {
|
||||
"derivedFields": [
|
||||
{
|
||||
"datasourceUid": "tempo",
|
||||
"matcherRegex": "trace_id",
|
||||
"matcherType": "label",
|
||||
"name": "TraceID",
|
||||
"url": "$${__value.raw}"
|
||||
}
|
||||
],
|
||||
"serverName": "loki",
|
||||
"tlsAuth": true,
|
||||
"tlsAuthWithCACert": true
|
||||
},
|
||||
"name": "Loki",
|
||||
"secureJsonData": {
|
||||
"tlsCACert": "$__file{/pki/ca.crt}",
|
||||
"tlsClientCert": "$__file{/identity/grafana.crt}",
|
||||
"tlsClientKey": "$__file{/identity/grafana.key}"
|
||||
},
|
||||
"type": "loki",
|
||||
"uid": "loki",
|
||||
"url": "https://loki-tls:3100"
|
||||
},
|
||||
{
|
||||
"access": "proxy",
|
||||
"jsonData": {
|
||||
"serverName": "tempo",
|
||||
"tlsAuth": true,
|
||||
"tlsAuthWithCACert": true,
|
||||
"tracesToLogsV2": {
|
||||
"datasourceUid": "loki",
|
||||
"filterBySpanID": true,
|
||||
"filterByTraceID": true,
|
||||
"spanEndTimeShift": "1m",
|
||||
"spanStartTimeShift": "-1m",
|
||||
"tags": [
|
||||
{
|
||||
"key": "service.name",
|
||||
"value": "service_name"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "Tempo",
|
||||
"secureJsonData": {
|
||||
"tlsCACert": "$__file{/pki/ca.crt}",
|
||||
"tlsClientCert": "$__file{/identity/grafana.crt}",
|
||||
"tlsClientKey": "$__file{/identity/grafana.key}"
|
||||
},
|
||||
"type": "tempo",
|
||||
"uid": "tempo",
|
||||
"url": "https://tempo-tls:3200"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
analytics:
|
||||
reporting_enabled: false
|
||||
auth_enabled: false
|
||||
common:
|
||||
instance_addr: 127.0.0.1
|
||||
path_prefix: /loki
|
||||
replication_factor: 1
|
||||
ring:
|
||||
kvstore:
|
||||
store: inmemory
|
||||
storage:
|
||||
filesystem:
|
||||
chunks_directory: /loki/chunks
|
||||
rules_directory: /loki/rules
|
||||
compactor:
|
||||
delete_request_store: filesystem
|
||||
retention_enabled: true
|
||||
working_directory: /loki/compactor
|
||||
limits_config:
|
||||
allow_structured_metadata: true
|
||||
retention_period: 168h
|
||||
schema_config:
|
||||
configs:
|
||||
- from: 2024-01-01
|
||||
index:
|
||||
period: 24h
|
||||
prefix: index_
|
||||
object_store: filesystem
|
||||
schema: v13
|
||||
store: tsdb
|
||||
server:
|
||||
grpc_listen_address: 127.0.0.1
|
||||
http_listen_address: 127.0.0.1
|
||||
http_listen_port: 13100
|
||||
@@ -0,0 +1,21 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
# Local MinIO Client (mc) from the official GitHub release binary (pinned).
|
||||
# Fallback when docker.io/minio/mc cannot be pulled.
|
||||
FROM ubuntu:24.04 AS runtime
|
||||
|
||||
ARG MC_VERSION=RELEASE.2025-04-16T18-13-26Z
|
||||
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
ca-certificates curl \
|
||||
&& curl -fsSL -o /tmp/mc.bin \
|
||||
"https://github.com/minio/mc/releases/download/${MC_VERSION}/mc.linux-amd64.${MC_VERSION}" \
|
||||
&& curl -fsSL -o /tmp/mc.sha256sum \
|
||||
"https://github.com/minio/mc/releases/download/${MC_VERSION}/mc.linux-amd64.${MC_VERSION}.sha256sum" \
|
||||
&& expected="$(awk '{print $1}' /tmp/mc.sha256sum)" \
|
||||
&& echo "${expected} /tmp/mc.bin" | sha256sum -c - \
|
||||
&& install -m 0755 /tmp/mc.bin /usr/local/bin/mc \
|
||||
&& rm -f /tmp/mc.bin /tmp/mc.sha256sum \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
USER 10001:10001
|
||||
ENTRYPOINT ["mc"]
|
||||
@@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
mkdir -p "$MC_CONFIG_DIR/certs/CAs"
|
||||
cp /pki/ca.crt "$MC_CONFIG_DIR/certs/CAs/ca.crt"
|
||||
exec /bin/sh "$@"
|
||||
@@ -0,0 +1,24 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
# Local MinIO image from the official GitHub release binary (pinned).
|
||||
# Fallback when docker.io/minio/minio cannot be pulled.
|
||||
FROM ubuntu:24.04 AS runtime
|
||||
|
||||
ARG MINIO_VERSION=RELEASE.2025-04-22T22-12-26Z
|
||||
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
ca-certificates curl \
|
||||
&& curl -fsSL -o /tmp/minio.bin \
|
||||
"https://github.com/minio/minio/releases/download/${MINIO_VERSION}/minio.linux-amd64.${MINIO_VERSION}" \
|
||||
&& curl -fsSL -o /tmp/minio.sha256sum \
|
||||
"https://github.com/minio/minio/releases/download/${MINIO_VERSION}/minio.linux-amd64.${MINIO_VERSION}.sha256sum" \
|
||||
&& expected="$(awk '{print $1}' /tmp/minio.sha256sum)" \
|
||||
&& echo "${expected} /tmp/minio.bin" | sha256sum -c - \
|
||||
&& install -m 0755 /tmp/minio.bin /usr/local/bin/minio \
|
||||
&& rm -f /tmp/minio.bin /tmp/minio.sha256sum \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
VOLUME ["/data"]
|
||||
EXPOSE 9000 9001
|
||||
USER 10001:10001
|
||||
ENTRYPOINT ["minio"]
|
||||
CMD ["server", "/data", "--console-address", ":9001"]
|
||||
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"Version": "2012-10-17",
|
||||
"Statement": [
|
||||
{
|
||||
"Effect": "Allow",
|
||||
"Action": [
|
||||
"s3:ListBucketMultipartUploads",
|
||||
"s3:GetBucketLocation",
|
||||
"s3:ListBucket"
|
||||
],
|
||||
"Resource": [
|
||||
"arn:aws:s3:::__S3_BUCKET__"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Effect": "Allow",
|
||||
"Action": [
|
||||
"s3:PutObject",
|
||||
"s3:GetObject",
|
||||
"s3:DeleteObject",
|
||||
"s3:AbortMultipartUpload",
|
||||
"s3:ListMultipartUploadParts"
|
||||
],
|
||||
"Resource": [
|
||||
"arn:aws:s3:::__S3_BUCKET__/*"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
path "database/creds/api-role" { capabilities=["read"] }
|
||||
path "secret/data/api" { capabilities=["read"] }
|
||||
path "sys/leases/renew" { capabilities=["update"] }
|
||||
path "auth/token/renew-self" { capabilities=["update"] }
|
||||
path "auth/token/revoke-self" { capabilities=["update"] }
|
||||
@@ -0,0 +1,9 @@
|
||||
ui = false
|
||||
api_addr = "https://openbao:8200"
|
||||
storage "file" { path = "/bao/data" }
|
||||
listener "tcp" {
|
||||
address = "0.0.0.0:8200"
|
||||
tls_cert_file = "/identity/openbao.crt"
|
||||
tls_key_file = "/identity/openbao.key"
|
||||
tls_min_version = "tls12"
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
path "database/creds/worker-role" { capabilities=["read"] }
|
||||
path "secret/data/worker" { capabilities=["read"] }
|
||||
path "sys/leases/renew" { capabilities=["update"] }
|
||||
path "auth/token/renew-self" { capabilities=["update"] }
|
||||
path "auth/token/revoke-self" { capabilities=["update"] }
|
||||
@@ -0,0 +1,62 @@
|
||||
exporters:
|
||||
otlphttp/loki:
|
||||
endpoint: https://loki-tls:3100/otlp
|
||||
timeout: 3s
|
||||
tls:
|
||||
ca_file: /pki/ca.crt
|
||||
cert_file: /identity/otel-collector.crt
|
||||
key_file: /identity/otel-collector.key
|
||||
server_name_override: loki
|
||||
otlphttp/tempo:
|
||||
endpoint: https://tempo-tls:4318
|
||||
timeout: 3s
|
||||
tls:
|
||||
ca_file: /pki/ca.crt
|
||||
cert_file: /identity/otel-collector.crt
|
||||
key_file: /identity/otel-collector.key
|
||||
server_name_override: tempo
|
||||
prometheus:
|
||||
endpoint: 127.0.0.1:19464
|
||||
resource_to_telemetry_conversion:
|
||||
enabled: true
|
||||
processors:
|
||||
batch:
|
||||
timeout: 1s
|
||||
memory_limiter:
|
||||
check_interval: 1s
|
||||
limit_mib: 192
|
||||
spike_limit_mib: 32
|
||||
receivers:
|
||||
otlp:
|
||||
protocols:
|
||||
http:
|
||||
endpoint: 127.0.0.1:14318
|
||||
service:
|
||||
pipelines:
|
||||
logs:
|
||||
exporters:
|
||||
- otlphttp/loki
|
||||
processors:
|
||||
- memory_limiter
|
||||
- batch
|
||||
receivers:
|
||||
- otlp
|
||||
metrics:
|
||||
exporters:
|
||||
- prometheus
|
||||
processors:
|
||||
- memory_limiter
|
||||
- batch
|
||||
receivers:
|
||||
- otlp
|
||||
traces:
|
||||
exporters:
|
||||
- otlphttp/tempo
|
||||
processors:
|
||||
- memory_limiter
|
||||
- batch
|
||||
receivers:
|
||||
- otlp
|
||||
telemetry:
|
||||
metrics:
|
||||
level: none
|
||||
@@ -0,0 +1,3 @@
|
||||
local all all trust
|
||||
hostssl messenger all 0.0.0.0/0 scram-sha-256 clientcert=verify-ca
|
||||
host all all 0.0.0.0/0 reject
|
||||
@@ -0,0 +1,27 @@
|
||||
groups:
|
||||
- name: messenger-slo
|
||||
rules:
|
||||
- alert: ApiHighErrorRate
|
||||
expr: (sum(rate(http_server_requests_total{http_response_status_class="5xx"}[1m])) or vector(0)) / clamp_min(sum(rate(http_server_requests_total[1m])), 0.001) > 0.05
|
||||
for: 30s
|
||||
labels:
|
||||
severity: warning
|
||||
annotations:
|
||||
summary: API 5xx ratio above 5% for 30 seconds (1 minute window)
|
||||
description: Check server spans, postgresql.pool.acquire and DB pool metrics. Runbook in REPORT.md.
|
||||
- alert: QueueLagGrowing
|
||||
expr: max(queue_oldest_age) > 30 and max(queue_depth) > 0 and max(delta(queue_oldest_age[1m])) > 0
|
||||
for: 30s
|
||||
labels:
|
||||
severity: warning
|
||||
annotations:
|
||||
summary: Durable backlog is ageing beyond 30 seconds
|
||||
description: Check worker capacity/busy, worker logs and Redis/DB/S3 spans. Runbook in REPORT.md.
|
||||
- alert: QueueObservationStale
|
||||
expr: time() - max(queue_observation_timestamp) > 30 or absent(queue_observation_timestamp)
|
||||
for: 30s
|
||||
labels:
|
||||
severity: warning
|
||||
annotations:
|
||||
summary: Queue observer unavailable
|
||||
description: Queue values may be stale; check PostgreSQL and API observer logs.
|
||||
@@ -0,0 +1,15 @@
|
||||
global:
|
||||
scrape_interval: 5s
|
||||
rule_files:
|
||||
- /etc/prometheus/alerts.yaml
|
||||
scrape_configs:
|
||||
- job_name: messenger
|
||||
scheme: https
|
||||
static_configs:
|
||||
- targets:
|
||||
- otel-collector-tls:9464
|
||||
tls_config:
|
||||
ca_file: /pki/ca.crt
|
||||
cert_file: /identity/prometheus.crt
|
||||
key_file: /identity/prometheus.key
|
||||
server_name: otel-collector
|
||||
@@ -0,0 +1,11 @@
|
||||
port 0
|
||||
tls-port 6379
|
||||
tls-cert-file /identity/redis.crt
|
||||
tls-key-file /identity/redis.key
|
||||
tls-ca-cert-file /pki/ca.crt
|
||||
tls-auth-clients yes
|
||||
tls-protocols "TLSv1.2 TLSv1.3"
|
||||
aclfile /run/redis/users.acl
|
||||
appendonly yes
|
||||
appendfsync always
|
||||
dir /data
|
||||
@@ -0,0 +1,24 @@
|
||||
compactor:
|
||||
compaction:
|
||||
block_retention: 168h
|
||||
distributor:
|
||||
receivers:
|
||||
otlp:
|
||||
protocols:
|
||||
http:
|
||||
endpoint: 127.0.0.1:14318
|
||||
ingester:
|
||||
max_block_duration: 5m
|
||||
server:
|
||||
grpc_listen_address: 127.0.0.1
|
||||
http_listen_address: 127.0.0.1
|
||||
http_listen_port: 13200
|
||||
storage:
|
||||
trace:
|
||||
backend: local
|
||||
local:
|
||||
path: /var/tempo/blocks
|
||||
wal:
|
||||
path: /var/tempo/wal
|
||||
usage_report:
|
||||
reporting_enabled: false
|
||||
Reference in New Issue
Block a user