Initialize observability stack with local monitoring and server134 deployment
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
modules:
|
||||
new_api_status:
|
||||
prober: http
|
||||
timeout: 5s
|
||||
http:
|
||||
method: GET
|
||||
valid_status_codes: [200]
|
||||
follow_redirects: false
|
||||
preferred_ip_protocol: ip4
|
||||
fail_if_body_not_matches_regexp:
|
||||
- '"success"\s*:\s*true'
|
||||
@@ -0,0 +1,239 @@
|
||||
{
|
||||
"uid": "new-api-local",
|
||||
"title": "New API - Local Health",
|
||||
"schemaVersion": 39,
|
||||
"version": 1,
|
||||
"refresh": "15s",
|
||||
"tags": ["new-api", "local"],
|
||||
"time": {
|
||||
"from": "now-30m",
|
||||
"to": "now"
|
||||
},
|
||||
"panels": [
|
||||
{
|
||||
"id": 1,
|
||||
"title": "Scope",
|
||||
"type": "text",
|
||||
"gridPos": {
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"w": 24,
|
||||
"h": 3
|
||||
},
|
||||
"options": {
|
||||
"mode": "markdown",
|
||||
"content": "Target: `http://host.docker.internal:3000/api/status` (Windows app at `127.0.0.1:3000`). Checks HTTP 200 and `success: true` every 15 seconds. **Status endpoint availability and latency only.** Model-call success rate, billing, application logs and business traces are not connected yet. No-traffic periods cannot be inferred from this probe."
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"title": "Status probe (1 = OK, 0 = failed)",
|
||||
"type": "stat",
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "victoriametrics"
|
||||
},
|
||||
"gridPos": {
|
||||
"x": 0,
|
||||
"y": 3,
|
||||
"w": 8,
|
||||
"h": 7
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"refId": "A",
|
||||
"expr": "probe_success{job=\"new-api-health\"}",
|
||||
"legendFormat": "{{service}}"
|
||||
}
|
||||
],
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"unit": "short"
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"options": {
|
||||
"reduceOptions": {
|
||||
"calcs": ["lastNotNull"],
|
||||
"fields": "",
|
||||
"values": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"title": "HTTP status",
|
||||
"type": "stat",
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "victoriametrics"
|
||||
},
|
||||
"gridPos": {
|
||||
"x": 8,
|
||||
"y": 3,
|
||||
"w": 8,
|
||||
"h": 7
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"refId": "A",
|
||||
"expr": "probe_http_status_code{job=\"new-api-health\"}",
|
||||
"legendFormat": "{{service}}"
|
||||
}
|
||||
],
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"unit": "short"
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"options": {
|
||||
"reduceOptions": {
|
||||
"calcs": ["lastNotNull"],
|
||||
"fields": "",
|
||||
"values": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"title": "Status endpoint duration",
|
||||
"type": "stat",
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "victoriametrics"
|
||||
},
|
||||
"gridPos": {
|
||||
"x": 16,
|
||||
"y": 3,
|
||||
"w": 8,
|
||||
"h": 7
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"refId": "A",
|
||||
"expr": "probe_duration_seconds{job=\"new-api-health\"}",
|
||||
"legendFormat": "{{service}}"
|
||||
}
|
||||
],
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"unit": "s"
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"options": {
|
||||
"reduceOptions": {
|
||||
"calcs": ["lastNotNull"],
|
||||
"fields": "",
|
||||
"values": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"title": "Status endpoint availability",
|
||||
"type": "timeseries",
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "victoriametrics"
|
||||
},
|
||||
"gridPos": {
|
||||
"x": 0,
|
||||
"y": 10,
|
||||
"w": 12,
|
||||
"h": 7
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"refId": "A",
|
||||
"expr": "probe_success{job=\"new-api-health\"}",
|
||||
"legendFormat": "{{service}}"
|
||||
}
|
||||
],
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"unit": "short"
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"options": {
|
||||
"reduceOptions": {
|
||||
"calcs": ["lastNotNull"],
|
||||
"fields": "",
|
||||
"values": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": 6,
|
||||
"title": "Status endpoint duration (not inference latency)",
|
||||
"type": "timeseries",
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "victoriametrics"
|
||||
},
|
||||
"gridPos": {
|
||||
"x": 12,
|
||||
"y": 10,
|
||||
"w": 12,
|
||||
"h": 7
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"refId": "A",
|
||||
"expr": "probe_duration_seconds{job=\"new-api-health\"}",
|
||||
"legendFormat": "{{service}}"
|
||||
}
|
||||
],
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"unit": "s"
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"options": {
|
||||
"reduceOptions": {
|
||||
"calcs": ["lastNotNull"],
|
||||
"fields": "",
|
||||
"values": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": 7,
|
||||
"title": "Monitoring scrapes",
|
||||
"type": "timeseries",
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "victoriametrics"
|
||||
},
|
||||
"gridPos": {
|
||||
"x": 0,
|
||||
"y": 17,
|
||||
"w": 24,
|
||||
"h": 7
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"refId": "A",
|
||||
"expr": "up",
|
||||
"legendFormat": "{{job}} {{instance}}"
|
||||
}
|
||||
],
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"unit": "short"
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"options": {
|
||||
"reduceOptions": {
|
||||
"calcs": ["lastNotNull"],
|
||||
"fields": "",
|
||||
"values": false
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
global:
|
||||
scrape_interval: 15s
|
||||
scrape_timeout: 10s
|
||||
external_labels:
|
||||
env: local
|
||||
cluster: observability-local
|
||||
scrape_configs:
|
||||
- job_name: new-api-health
|
||||
metrics_path: /probe
|
||||
params:
|
||||
module: [new_api_status]
|
||||
static_configs:
|
||||
- targets: [http://host.docker.internal:3000/api/status]
|
||||
labels:
|
||||
service: new-api
|
||||
brand: local
|
||||
relabel_configs:
|
||||
- source_labels: [__address__]
|
||||
target_label: __param_target
|
||||
- source_labels: [__param_target]
|
||||
target_label: instance
|
||||
- target_label: __address__
|
||||
replacement: blackbox:9115
|
||||
- job_name: observability-components
|
||||
static_configs:
|
||||
- targets:
|
||||
- victoriametrics:8428
|
||||
- victorialogs:9428
|
||||
- tempo:3200
|
||||
- alertmanager:9093
|
||||
- vmalert:8880
|
||||
- vmagent:8429
|
||||
- grafana:3000
|
||||
- blackbox:9115
|
||||
- job_name: mysql
|
||||
static_configs:
|
||||
- targets: [mysqld-exporter:9104]
|
||||
labels:
|
||||
service: mysql
|
||||
instance: local-mysql
|
||||
@@ -0,0 +1,19 @@
|
||||
groups:
|
||||
- name: local-application
|
||||
interval: 15s
|
||||
rules:
|
||||
- alert: NewApiUnavailable
|
||||
expr: probe_success{job="new-api-health"} == 0
|
||||
for: 2m
|
||||
labels:
|
||||
severity: P1
|
||||
annotations:
|
||||
summary: "Local new-api status check failed for two minutes"
|
||||
description: "This checks /api/status only; it does not measure model-call success."
|
||||
- alert: LocalMonitoringTargetDown
|
||||
expr: up == 0
|
||||
for: 2m
|
||||
labels:
|
||||
severity: P2
|
||||
annotations:
|
||||
summary: "Monitoring scrape failed: {{ $labels.instance }}"
|
||||
Reference in New Issue
Block a user