How abdullah-farooqi/palantir works
PALANTIR monitors Netdata agents through a FastAPI API and scheduled Celery workers. Its main flow registers monitored nodes, collects per-second metrics, stores snapshots, evaluates anomaly scores, and exposes metrics, alerts, and investigations to UI callers; Netdata also pushes alert webhooks. PostgreSQL backs API and worker persistence, with Redis as the Celery broker. The graph preserves the documented retention job and investigation capability. Relationships for unsampled routes and task implementations rely on the README or source-index references; optional agent investigation triggering is not shown because the sampled implementation leaves it commented out.
Main entry points: main.py FastAPI App · metrics.py Metric Collection · anomaly.py Anomaly Evaluation · database.py Database Sessions
Components 30
API and Webhooks
- FastAPI App
backend/main.py - Node API
backend/api/v1/nodes.py - Metrics API
backend/api/v1/metrics.py - Alerts API
backend/api/v1/alerts.py - Investigations API
backend/api/v1/investigations.py - Alert Webhook
backend/api/v1/internal.py
Monitoring Collection
- Node Registration
backend/services/nodes.py - Metric Collection
backend/services/metrics.py
Detection and Events
- Anomaly Evaluation
backend/services/anomaly.py - Alert Ingestion
backend/services/alerts.py - Anomaly Events
backend/models/anomaly.py - Alert Events
backend/models/alert.py - Investigations
backend/models/investigation.py
Workers and Persistence
- Celery Schedule
backend/workers/celery_app.py - Metrics Task
backend/workers/metrics_tasks.py - Anomaly Task
backend/workers/anomaly_tasks.py - Retention Task
backend/workers/maintenance_tasks.py - Database Sessions
backend/core/database.py - Monitored Nodes
backend/models/node.py - Metric Snapshots
backend/models/metric.py - Configuration
backend/core/config.py
Netdata Integration
- Netdata Client
backend/integrations/netdata/client.py - Response Parsing
backend/integrations/netdata/parsers.py - Metric Contexts
backend/integrations/netdata/contexts.py - Response Schemas
backend/integrations/netdata/schemas.py - Netdata Errors
backend/integrations/netdata/exceptions.py
Other components
- UI Caller
- Netdata Agent
- Redis Broker
- PostgreSQL
Connections 48
- UI Caller → FastAPI App: requests
README.md - FastAPI App → Node API: routes to
backend/main.py - FastAPI App → Metrics API: routes to
backend/main.py - FastAPI App → Alerts API: routes to
backend/main.py - FastAPI App → Investigations API: routes to
backend/main.py - FastAPI App → Alert Webhook: routes to
backend/main.py - Node API → Node Registration: delegates to
backend/api/v1/nodes.py - Node API → Database Sessions: uses session
backend/api/v1/nodes.py - Node API → Netdata Errors: handles
backend/api/v1/nodes.py - Metrics API → Database Sessions: uses session
backend/api/v1/metrics.py - Metrics API → Metric Snapshots: queries
backend/api/v1/metrics.py - Alerts API → Database Sessions: uses session
backend/api/v1/alerts.py - Alerts API → Alert Events: queries
backend/api/v1/alerts.py - Alerts API → Anomaly Events: queries
backend/api/v1/alerts.py - Investigations API → Database Sessions: uses session
backend/api/v1/investigations.py - Investigations API → Investigations: queries
backend/api/v1/investigations.py - Netdata Agent → Alert Webhook: pushes alerts
README.md - Alert Webhook → Alert Ingestion: delegates to
backend/api/v1/internal.py - Alert Ingestion → Monitored Nodes: uses node
backend/services/alerts.py - Alert Ingestion → Alert Events: creates events
backend/services/alerts.py - Celery Schedule → Redis Broker: uses broker
README.md - Celery Schedule → Metrics Task: schedules
backend/workers/celery_app.py - Celery Schedule → Anomaly Task: schedules
backend/workers/celery_app.py - Celery Schedule → Retention Task: schedules
backend/workers/celery_app.py - Metrics Task → Metric Collection: invokes
backend/workers/metrics_tasks.py - Metrics Task → Database Sessions: opens session
backend/workers/metrics_tasks.py - Metrics Task → Monitored Nodes: loads nodes
backend/workers/metrics_tasks.py - Anomaly Task → Anomaly Evaluation: invokes
backend/workers/anomaly_tasks.py - Anomaly Task → Database Sessions: opens session
backend/workers/anomaly_tasks.py - Anomaly Task → Monitored Nodes: loads nodes
backend/workers/anomaly_tasks.py - Retention Task → Database Sessions: opens session
backend/workers/maintenance_tasks.py - Retention Task → Metric Snapshots: prunes snapshots
backend/workers/maintenance_tasks.py - Metric Collection → Netdata Client: requests metrics
backend/services/metrics.py - Metric Collection → Response Parsing: parses responses
backend/services/metrics.py - Metric Collection → Metric Contexts: selects contexts
backend/services/metrics.py - Metric Collection → Netdata Errors: handles failures
backend/services/metrics.py - Metric Collection → Metric Snapshots: writes snapshots
backend/services/metrics.py - Node Registration → Netdata Client: probes agent
backend/services/nodes.py - Node Registration → Netdata Errors: handles failures
backend/services/nodes.py - Node Registration → Monitored Nodes: registers node
backend/services/nodes.py - Anomaly Evaluation → Netdata Client: requests scores
backend/services/anomaly.py - Anomaly Evaluation → Response Parsing: parses rates
backend/services/anomaly.py - Anomaly Evaluation → Metric Contexts: selects contexts
backend/services/anomaly.py - Anomaly Evaluation → Netdata Errors: handles failures
backend/services/anomaly.py - Anomaly Evaluation → Anomaly Events: records events
backend/services/anomaly.py - Netdata Client → Netdata Agent: queries
backend/integrations/netdata/client.py - Netdata Client → Response Schemas: validates with
backend/integrations/netdata/client.py - Netdata Client → Netdata Errors: raises
backend/integrations/netdata/client.py