ragleap-observability 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ragleap_observability-0.1.0/.gitignore +32 -0
- ragleap_observability-0.1.0/CHANGELOG.md +31 -0
- ragleap_observability-0.1.0/PKG-INFO +67 -0
- ragleap_observability-0.1.0/README.md +55 -0
- ragleap_observability-0.1.0/helm/ragleap-observability/Chart.yaml +6 -0
- ragleap_observability-0.1.0/helm/ragleap-observability/templates/postgres-exporter-deployment.yaml +33 -0
- ragleap_observability-0.1.0/helm/ragleap-observability/templates/postgres-exporter-service.yaml +14 -0
- ragleap_observability-0.1.0/helm/ragleap-observability/templates/prometheus-configmap.yaml +19 -0
- ragleap_observability-0.1.0/helm/ragleap-observability/values.yaml +32 -0
- ragleap_observability-0.1.0/pyproject.toml +25 -0
- ragleap_observability-0.1.0/src/ragleap_observability/__init__.py +19 -0
- ragleap_observability-0.1.0/tests/test_version.py +5 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Environment
|
|
2
|
+
.env
|
|
3
|
+
*.env.local
|
|
4
|
+
|
|
5
|
+
# Python
|
|
6
|
+
__pycache__/
|
|
7
|
+
*.py[cod]
|
|
8
|
+
*.egg-info/
|
|
9
|
+
venv/
|
|
10
|
+
.venv/
|
|
11
|
+
|
|
12
|
+
# Node
|
|
13
|
+
node_modules/
|
|
14
|
+
|
|
15
|
+
# Docker
|
|
16
|
+
docker-compose.override.yml
|
|
17
|
+
|
|
18
|
+
# IDE
|
|
19
|
+
.vscode/
|
|
20
|
+
.idea/
|
|
21
|
+
|
|
22
|
+
# OS
|
|
23
|
+
.DS_Store
|
|
24
|
+
Thumbs.db
|
|
25
|
+
|
|
26
|
+
# Logs
|
|
27
|
+
*.log
|
|
28
|
+
.env
|
|
29
|
+
|
|
30
|
+
# Package build artifacts
|
|
31
|
+
dist/
|
|
32
|
+
build/
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to `ragleap-observability` are documented here. Format loosely
|
|
4
|
+
follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|
5
|
+
|
|
6
|
+
## [Unreleased]
|
|
7
|
+
|
|
8
|
+
### Fixed
|
|
9
|
+
|
|
10
|
+
- `postgres-exporter` had `runAsNonRoot: true` with no `runAsUser` set. The image's Dockerfile sets its user by name (`nobody`) rather than a numeric UID, which Kubernetes cannot verify against `runAsNonRoot` without an explicit numeric value -- failed on real cluster with `container has runAsNonRoot and image has non-numeric user (nobody), cannot verify user is non-root`. Fixed with `runAsUser: 65534`, confirmed via `docker run --rm --entrypoint id quay.io/prometheuscommunity/postgres-exporter:v0.15.0` (uid=65534(nobody)), not assumed. Distinct bug pattern from the earlier root-default-image issues found in `ragleap-ops` -- same root problem (runAsNonRoot needs a numeric UID) but a different underlying cause.
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- Prometheus + `postgres_exporter`, step 1 of the planned build order (Prometheus/exporters first, alerting/dashboards later, per the README's own sequencing rationale -- alerting on data that doesn't exist yet is pointless).
|
|
15
|
+
- `neo4jExporter` config present but disabled by default -- Neo4j Community Edition Prometheus support is unverified and conflicting across sources (Neo4j's own KB and a working xk6-neo4j example show it configured successfully against Community 4.4.x; a separate monitoring vendor's compatibility notes claim Community is unsupported for their specific collector). Documented in README "Known open items", stays disabled until independently live-verified.
|
|
16
|
+
|
|
17
|
+
### Verified
|
|
18
|
+
|
|
19
|
+
- `helm lint` clean; `helm template` output confirmed exactly 3 resources render (Deployment, Service, ConfigMap), and the `neo4jExporter` scrape job is correctly absent from the rendered Prometheus config since `neo4jExporter.enabled` defaults to false.
|
|
20
|
+
- First live cluster deploy performed (`helm install` against a real kind cluster). `helm install` succeeded structurally with no template errors. The Prometheus ConfigMap deployed as a real object and its rendered content matched the earlier `helm template` output exactly -- only the `ragleap-postgres` scrape job present, `ragleap-neo4j` correctly absent, confirming `neo4jExporter.enabled: false` behaves identically on a real cluster, not just in template rendering. `postgres-exporter`'s pod failed exactly as pre-documented: `secret "ragleap-db-exporter-secret" not found` -- this is the already-known, already-flagged dependency gap (the read-only monitoring role does not yet exist in `ragleap-ops`'s db schema), not a new bug found by this test.
|
|
21
|
+
|
|
22
|
+
### Verified (this session)
|
|
23
|
+
|
|
24
|
+
- The `ragleap-ops` dependency is now resolved: `ragleap_monitor` role confirmed to genuinely exist in the live database via `psql -c "\\du ragleap_monitor"` (not assumed from the schema file alone), and `ragleap-db-exporter-secret` deployed successfully into the `ragleap-core` namespace.
|
|
25
|
+
- After the `runAsUser: 65534` fix above, `postgres-exporter` reached `1/1 Running`, 0 restarts, on a real kind cluster.
|
|
26
|
+
- Real end-to-end connectivity confirmed via `/metrics` endpoint (port-forwarded and curled directly, not just checked via pod status): `pg_up 1`, plus real non-zero live statistics for the `ragleap_core` database (`pg_stat_database_blks_hit`, `pg_stat_database_tup_returned`, `pg_stat_database_xact_commit`, `pg_stat_database_numbackends`, etc.) -- this is genuinely scraped data, not placeholder zeros. The exporter is proven to work end-to-end, not just "pod is green."
|
|
27
|
+
|
|
28
|
+
### Known limitations
|
|
29
|
+
|
|
30
|
+
- Neo4j Prometheus support genuinely unverified -- see Added section above. Do not enable `neo4jExporter` without independently confirming against the real `neo4j:5-community` image.
|
|
31
|
+
- Grafana, Loki, and AlertManager are not yet built at all -- correctly sequenced after Prometheus has real metrics flowing, per the README's own build order.
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: ragleap-observability
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Prometheus/Grafana/Loki/AlertManager observability stack for RagLeap Core, live-tested against a real cluster
|
|
5
|
+
Project-URL: Homepage, https://packages.ragleap.com/docs/ragleap-observability.html
|
|
6
|
+
Author: RagLeap Contributors
|
|
7
|
+
License: MIT
|
|
8
|
+
Classifier: Operating System :: OS Independent
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Requires-Python: >=3.10
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
|
|
13
|
+
# ragleap-observability
|
|
14
|
+
|
|
15
|
+
Metrics, logs, and alerting for RagLeap Core -- Prometheus, Grafana,
|
|
16
|
+
Loki, and AlertManager, wired against the real db/app/voice/neo4j
|
|
17
|
+
services.
|
|
18
|
+
|
|
19
|
+
## Status
|
|
20
|
+
|
|
21
|
+
Prometheus + `postgres_exporter` are built and live-verified end-to-end
|
|
22
|
+
against a real cluster: the exporter connects to `ragleap-db` using a
|
|
23
|
+
read-only monitoring role, and `/metrics` returns real, non-zero
|
|
24
|
+
PostgreSQL statistics (`pg_up 1`, live `pg_stat_database` values). This
|
|
25
|
+
is the prerequisite for AIOps per the project's own DevOps maturity
|
|
26
|
+
roadmap -- building anomaly detection before a metrics pipeline exists
|
|
27
|
+
would be "a dashboard for data that doesn't exist."
|
|
28
|
+
|
|
29
|
+
Grafana, Loki, and AlertManager are not yet built -- correctly
|
|
30
|
+
sequenced after Prometheus has proven real metrics flowing, per the
|
|
31
|
+
build order below.
|
|
32
|
+
|
|
33
|
+
## Planned build order
|
|
34
|
+
|
|
35
|
+
1. ✅ Prometheus + exporters (postgres_exporter for db) -- done,
|
|
36
|
+
live-verified this session. neo4j's exporter remains disabled
|
|
37
|
+
pending independent verification, see "Known open items".
|
|
38
|
+
2. Grafana, provisioned dashboards-as-code, verified against real
|
|
39
|
+
flowing data
|
|
40
|
+
3. Loki + log shipping (can parallel step 2)
|
|
41
|
+
4. AlertManager -- deliberately last; alerting on data that doesn't
|
|
42
|
+
exist yet is pointless
|
|
43
|
+
5. SLO/SLI dashboards, only after real data has accumulated for days,
|
|
44
|
+
not minutes
|
|
45
|
+
|
|
46
|
+
## Design principles
|
|
47
|
+
|
|
48
|
+
- RagLeap-specific scoping, same honest choice `ragleap-ops` made for
|
|
49
|
+
itself -- not a generic monitoring tool
|
|
50
|
+
- Every claim live-verified against a real cluster or explicitly
|
|
51
|
+
labeled unverified, same discipline as every other package here
|
|
52
|
+
|
|
53
|
+
## Known open items
|
|
54
|
+
|
|
55
|
+
- **Neo4j Prometheus support is unverified and conflicting in the wild.**
|
|
56
|
+
Neo4j's own KB and a working xk6-neo4j example show
|
|
57
|
+
`metrics.prometheus.enabled=true` configured successfully against
|
|
58
|
+
Neo4j Community 4.4.x. A separate monitoring vendor's own
|
|
59
|
+
compatibility notes claim Community Edition is unsupported for their
|
|
60
|
+
specific collector. `neo4jExporter.enabled` defaults to `false` in
|
|
61
|
+
`values.yaml` until this is live-verified against the real
|
|
62
|
+
`neo4j:5-community` image in this repo's own `kind` cluster.
|
|
63
|
+
- ~~`ragleap-db`'s schema does not yet have a read-only monitoring role~~
|
|
64
|
+
**Resolved and live-verified this session.** The `ragleap_monitor`
|
|
65
|
+
role exists in `ragleap-ops`'s schema and `ragleap-db-exporter-secret`
|
|
66
|
+
connects successfully -- confirmed via real `/metrics` output showing
|
|
67
|
+
`pg_up 1` and live PostgreSQL statistics, not just a running pod.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# ragleap-observability
|
|
2
|
+
|
|
3
|
+
Metrics, logs, and alerting for RagLeap Core -- Prometheus, Grafana,
|
|
4
|
+
Loki, and AlertManager, wired against the real db/app/voice/neo4j
|
|
5
|
+
services.
|
|
6
|
+
|
|
7
|
+
## Status
|
|
8
|
+
|
|
9
|
+
Prometheus + `postgres_exporter` are built and live-verified end-to-end
|
|
10
|
+
against a real cluster: the exporter connects to `ragleap-db` using a
|
|
11
|
+
read-only monitoring role, and `/metrics` returns real, non-zero
|
|
12
|
+
PostgreSQL statistics (`pg_up 1`, live `pg_stat_database` values). This
|
|
13
|
+
is the prerequisite for AIOps per the project's own DevOps maturity
|
|
14
|
+
roadmap -- building anomaly detection before a metrics pipeline exists
|
|
15
|
+
would be "a dashboard for data that doesn't exist."
|
|
16
|
+
|
|
17
|
+
Grafana, Loki, and AlertManager are not yet built -- correctly
|
|
18
|
+
sequenced after Prometheus has proven real metrics flowing, per the
|
|
19
|
+
build order below.
|
|
20
|
+
|
|
21
|
+
## Planned build order
|
|
22
|
+
|
|
23
|
+
1. ✅ Prometheus + exporters (postgres_exporter for db) -- done,
|
|
24
|
+
live-verified this session. neo4j's exporter remains disabled
|
|
25
|
+
pending independent verification, see "Known open items".
|
|
26
|
+
2. Grafana, provisioned dashboards-as-code, verified against real
|
|
27
|
+
flowing data
|
|
28
|
+
3. Loki + log shipping (can parallel step 2)
|
|
29
|
+
4. AlertManager -- deliberately last; alerting on data that doesn't
|
|
30
|
+
exist yet is pointless
|
|
31
|
+
5. SLO/SLI dashboards, only after real data has accumulated for days,
|
|
32
|
+
not minutes
|
|
33
|
+
|
|
34
|
+
## Design principles
|
|
35
|
+
|
|
36
|
+
- RagLeap-specific scoping, same honest choice `ragleap-ops` made for
|
|
37
|
+
itself -- not a generic monitoring tool
|
|
38
|
+
- Every claim live-verified against a real cluster or explicitly
|
|
39
|
+
labeled unverified, same discipline as every other package here
|
|
40
|
+
|
|
41
|
+
## Known open items
|
|
42
|
+
|
|
43
|
+
- **Neo4j Prometheus support is unverified and conflicting in the wild.**
|
|
44
|
+
Neo4j's own KB and a working xk6-neo4j example show
|
|
45
|
+
`metrics.prometheus.enabled=true` configured successfully against
|
|
46
|
+
Neo4j Community 4.4.x. A separate monitoring vendor's own
|
|
47
|
+
compatibility notes claim Community Edition is unsupported for their
|
|
48
|
+
specific collector. `neo4jExporter.enabled` defaults to `false` in
|
|
49
|
+
`values.yaml` until this is live-verified against the real
|
|
50
|
+
`neo4j:5-community` image in this repo's own `kind` cluster.
|
|
51
|
+
- ~~`ragleap-db`'s schema does not yet have a read-only monitoring role~~
|
|
52
|
+
**Resolved and live-verified this session.** The `ragleap_monitor`
|
|
53
|
+
role exists in `ragleap-ops`'s schema and `ragleap-db-exporter-secret`
|
|
54
|
+
connects successfully -- confirmed via real `/metrics` output showing
|
|
55
|
+
`pg_up 1` and live PostgreSQL statistics, not just a running pod.
|
ragleap_observability-0.1.0/helm/ragleap-observability/templates/postgres-exporter-deployment.yaml
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{{- if .Values.postgresExporter.enabled }}
|
|
2
|
+
apiVersion: apps/v1
|
|
3
|
+
kind: Deployment
|
|
4
|
+
metadata:
|
|
5
|
+
name: ragleap-postgres-exporter
|
|
6
|
+
labels:
|
|
7
|
+
app: ragleap-postgres-exporter
|
|
8
|
+
spec:
|
|
9
|
+
replicas: 1
|
|
10
|
+
selector:
|
|
11
|
+
matchLabels:
|
|
12
|
+
app: ragleap-postgres-exporter
|
|
13
|
+
template:
|
|
14
|
+
metadata:
|
|
15
|
+
labels:
|
|
16
|
+
app: ragleap-postgres-exporter
|
|
17
|
+
spec:
|
|
18
|
+
containers:
|
|
19
|
+
- name: postgres-exporter
|
|
20
|
+
image: {{ .Values.postgresExporter.image }}
|
|
21
|
+
ports:
|
|
22
|
+
- containerPort: {{ .Values.postgresExporter.port }}
|
|
23
|
+
env:
|
|
24
|
+
- name: DATA_SOURCE_NAME
|
|
25
|
+
valueFrom:
|
|
26
|
+
secretKeyRef:
|
|
27
|
+
name: {{ .Values.postgresExporter.datasourceSecretName }}
|
|
28
|
+
key: connection-string
|
|
29
|
+
securityContext:
|
|
30
|
+
runAsNonRoot: true
|
|
31
|
+
runAsUser: 65534
|
|
32
|
+
allowPrivilegeEscalation: false
|
|
33
|
+
{{- end }}
|
ragleap_observability-0.1.0/helm/ragleap-observability/templates/postgres-exporter-service.yaml
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{{- if .Values.postgresExporter.enabled }}
|
|
2
|
+
apiVersion: v1
|
|
3
|
+
kind: Service
|
|
4
|
+
metadata:
|
|
5
|
+
name: ragleap-postgres-exporter
|
|
6
|
+
labels:
|
|
7
|
+
app: ragleap-postgres-exporter
|
|
8
|
+
spec:
|
|
9
|
+
selector:
|
|
10
|
+
app: ragleap-postgres-exporter
|
|
11
|
+
ports:
|
|
12
|
+
- port: {{ .Values.postgresExporter.port }}
|
|
13
|
+
targetPort: {{ .Values.postgresExporter.port }}
|
|
14
|
+
{{- end }}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{{- if .Values.prometheus.enabled }}
|
|
2
|
+
apiVersion: v1
|
|
3
|
+
kind: ConfigMap
|
|
4
|
+
metadata:
|
|
5
|
+
name: ragleap-prometheus-config
|
|
6
|
+
data:
|
|
7
|
+
prometheus.yml: |
|
|
8
|
+
global:
|
|
9
|
+
scrape_interval: {{ .Values.prometheus.scrapeInterval }}
|
|
10
|
+
scrape_configs:
|
|
11
|
+
- job_name: 'ragleap-postgres'
|
|
12
|
+
static_configs:
|
|
13
|
+
- targets: ['ragleap-postgres-exporter:{{ .Values.postgresExporter.port }}']
|
|
14
|
+
{{- if .Values.neo4jExporter.enabled }}
|
|
15
|
+
- job_name: 'ragleap-neo4j'
|
|
16
|
+
static_configs:
|
|
17
|
+
- targets: ['ragleap-neo4j:{{ .Values.neo4jExporter.port }}']
|
|
18
|
+
{{- end }}
|
|
19
|
+
{{- end }}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# ragleap-observability — Prometheus + exporters (step 1 of the planned build order)
|
|
2
|
+
#
|
|
3
|
+
# Grafana, Loki, and AlertManager are NOT yet configured here — per the
|
|
4
|
+
# README's build order, alerting/dashboards come after real metrics
|
|
5
|
+
# are proven flowing, not before.
|
|
6
|
+
|
|
7
|
+
postgresExporter:
|
|
8
|
+
enabled: true
|
|
9
|
+
image: quay.io/prometheuscommunity/postgres-exporter:v0.15.0
|
|
10
|
+
# Connects to ragleap-db using a read-only monitoring role — NOT the
|
|
11
|
+
# app's own credentials. This role does not exist yet in ragleap-ops's
|
|
12
|
+
# db schema and needs to be created there first (real dependency,
|
|
13
|
+
# not yet done — see README "Known open items").
|
|
14
|
+
datasourceSecretName: ragleap-db-exporter-secret
|
|
15
|
+
port: 9187
|
|
16
|
+
|
|
17
|
+
neo4jExporter:
|
|
18
|
+
# UNVERIFIED — see README "Known open items". Neo4j's own docs and a
|
|
19
|
+
# working xk6-neo4j example show `metrics.prometheus.enabled=true`
|
|
20
|
+
# configured successfully against Neo4j Community 4.4.x. A separate
|
|
21
|
+
# third-party monitoring vendor's compatibility notes claim Community
|
|
22
|
+
# Edition is unsupported for their specific collector. These sources
|
|
23
|
+
# conflict. Do not enable this until live-verified against the real
|
|
24
|
+
# neo4j:5-community image running in this repo's own kind cluster.
|
|
25
|
+
enabled: false
|
|
26
|
+
port: 2004
|
|
27
|
+
|
|
28
|
+
prometheus:
|
|
29
|
+
enabled: true
|
|
30
|
+
image: prom/prometheus:v2.55.1
|
|
31
|
+
retention: 15d
|
|
32
|
+
scrapeInterval: 30s
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "ragleap-observability"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Prometheus/Grafana/Loki/AlertManager observability stack for RagLeap Core, live-tested against a real cluster"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
|
+
license = { text = "MIT" }
|
|
12
|
+
authors = [
|
|
13
|
+
{ name = "RagLeap Contributors" }
|
|
14
|
+
]
|
|
15
|
+
classifiers = [
|
|
16
|
+
"Programming Language :: Python :: 3",
|
|
17
|
+
"Operating System :: OS Independent",
|
|
18
|
+
]
|
|
19
|
+
dependencies = []
|
|
20
|
+
|
|
21
|
+
[project.urls]
|
|
22
|
+
Homepage = "https://packages.ragleap.com/docs/ragleap-observability.html"
|
|
23
|
+
|
|
24
|
+
[tool.hatchling.build.targets.wheel]
|
|
25
|
+
packages = ["src/ragleap_observability"]
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"""ragleap-observability: metrics, logs, and alerting for RagLeap Core.
|
|
2
|
+
|
|
3
|
+
This package ships Helm chart configuration wiring Prometheus (with
|
|
4
|
+
exporters for db/neo4j), Grafana (provisioned dashboards-as-code),
|
|
5
|
+
Loki (log aggregation), and AlertManager (routed to Slack/PagerDuty)
|
|
6
|
+
against RagLeap Core's own 4 services -- same RagLeap-specific scoping
|
|
7
|
+
choice ragleap-ops made for itself, not a generic tool.
|
|
8
|
+
|
|
9
|
+
This is the prerequisite for AIOps per the DevOps maturity roadmap:
|
|
10
|
+
anomaly detection and auto-remediation need a real metrics pipeline to
|
|
11
|
+
operate on, which doesn't exist until this package ships.
|
|
12
|
+
|
|
13
|
+
It contains almost no importable Python -- its purpose is to let the
|
|
14
|
+
existing PyPI/git-tag release automation version and ship the helm/
|
|
15
|
+
chart alongside this src/ tree, matching the release discipline of
|
|
16
|
+
ragleap-ops, ragleap-rag, ragleap-graph, and ragleap-vectorstores.
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
__version__ = "0.1.0"
|