How saurabhmahawar/presto_observability_pipeline works
Purpose and Entry Points
This is a self-contained Docker Compose sandbox for observing a three-node Presto distributed SQL cluster: one coordinator and two workers. It demonstrates JMX-to-Prometheus telemetry, dashboards, alert evaluation, and Slack delivery. Start the stack with docker-compose up -d; orchestration, service networking, mounts, and exposed ports are defined in docker-compose.yml.
Presto Cluster and Workload Boundaries
The coordinator accepts SQL/UI traffic, provides discovery, and centrally manages query scheduling and resource groups. Workers execute distributed tasks and can spill intermediate query data to host-mounted disk.
• config/presto-coordinator/etc/config.properties
• config/presto-worker-1/etc/config.properties
• config/presto-worker-2/etc/config.properties
Resource-group policy is coordinator-owned and establishes team/query concurrency and queue boundaries; therefore queued/rejected-query telemetry originates from actual admission control.
• config/presto-coordinator/etc/resource-groups.properties
• config/presto-coordinator/etc/resource-groups.json
JVM Telemetry Export Stage
Each Presto JVM loads the Prometheus JMX exporter as a Java agent. JVM launch settings wire the agent to its common MBean selection/translation rules, exposing HTTP metrics on port 8081. The coordinator exporter is host-accessible; worker exporters remain on the Compose network.
• bin/jmx_prometheus_javaagent.jar
• config/presto-shared/presto-jmx-exporter.yaml
• config/presto-coordinator/etc/jvm.config
The exporter is the key schema boundary: raw Java/Presto MBeans become normalized Prometheus metrics for query state, resource groups, JVM memory/GC, task scheduling, spills, and related engine behavior.
Prometheus Collection, Storage, and Rule Evaluation
Prometheus pulls each coordinator/worker exporter at configured intervals, attaching role labels that distinguish coordinator from workers. It stores time-series metrics, evaluates PromQL alert rules, and forwards firing/resolved alerts to Alertmanager.
• config/prometheus/prometheus.yml
• config/prometheus/alert.rules.yml
The scrape boundary is pull-based over the internal Docker bridge network; Presto does not push telemetry. Alert rules cover node availability and operational symptoms such as heap pressure, queues/rejections, failures, and GC overhead.
Alert Routing and External Notification
Alertmanager receives Prometheus alerts, groups and deduplicates them, then formats and routes notifications to a Slack incoming-webhook receiver. The webhook URL/channel are external integration points and operational secrets/configuration.
• config/alertmanager/alertmanager.yml
This separates alert detection (Prometheus PromQL and durations) from notification policy (grouping, routing, Slack presentation).
Grafana Visualization Plane
Grafana is provisioned at startup with Prometheus as its default data source and imports a prebuilt Presto dashboard. Dashboard panels issue PromQL against Prometheus for cluster KPIs, query load/latency/failures, worker resource usage, spill behavior, scheduling, exchange, and metadata telemetry.
• config/grafana/provisioning/datasources/prometheus.yaml
• config/grafana/provisioning/dashboards/presto.yaml
• config/grafana/dashboards/presto-dashboard.json
Queryable Metrics and Spill Storage
All Presto nodes configure the Prometheus connector, allowing SQL queries over Prometheus data as a secondary path distinct from monitoring collection. Worker spill directories are mounted persistent host paths; they support memory-constrained joins/aggregations and produce spill-related operational signals.
• config/presto-coordinator/etc/catalog/prometheus.properties
• config/presto-worker-1/etc/catalog/prometheus.properties
• spill/worker-1
Main entry points: prometheus.yml Prometheus · docker-compose.yml Docker Compose stack · etc/config.properties Presto coordinator · etc/config.properties Presto workers
Components 14
Presto cluster
- Presto coordinator · Accepts SQL/UI traffic, discovery, scheduling, and resource-group admission.
config/presto-coordinator/etc/config.properties - Presto workers · Execute distributed query tasks.
config/presto-worker-1/etc/config.properties - Resource-group policy · Sets team concurrency and queue boundaries.
config/presto-coordinator/etc/resource-groups.properties - Worker spill storage · Stores intermediate data for memory-constrained operations.
spill/worker-1 - Prometheus SQL connector · Makes Prometheus data queryable through SQL.
config/presto-coordinator/etc/catalog/prometheus.properties
Telemetry pipeline
- JMX Prometheus agent · Normalizes Java and Presto MBeans into HTTP metrics.
bin/jmx_prometheus_javaagent.jar - JMX metric rules · Selects and translates MBeans into Prometheus metric names.
config/presto-shared/presto-jmx-exporter.yaml
Observability
- Prometheus · Pulls, stores, and evaluates cluster metrics.
config/prometheus/prometheus.yml - PromQL alert rules · Detects availability, memory, queue, failure, and GC symptoms.
config/prometheus/alert.rules.yml - Alertmanager · Groups, deduplicates, and routes alerts.
config/alertmanager/alertmanager.yml - Grafana · Visualizes cluster and query KPIs from Prometheus.
config/grafana/provisioning/datasources/prometheus.yaml - Presto dashboard · Provides prebuilt Presto operational panels.
config/grafana/dashboards/presto-dashboard.json
Other components
- Docker Compose stack · Defines services, network, mounts, and exposed ports.
docker-compose.yml - Slack webhook · Receives routed operational notifications.
Connections 19
- Docker Compose stack → Presto coordinator: runs
- Docker Compose stack → Presto workers: runs
- Docker Compose stack → Prometheus: runs
- Docker Compose stack → Alertmanager: runs
- Docker Compose stack → Grafana: runs
- Presto coordinator → Resource-group policy: enforces
- Presto coordinator → Presto workers: schedules tasks
- Presto workers → Worker spill storage: spills intermediate data
- Presto coordinator → JMX Prometheus agent: loads
- Presto workers → JMX Prometheus agent: load
- JMX metric rules → JMX Prometheus agent: configures translation
- JMX Prometheus agent → Prometheus: serves pull metrics · Prometheus scrapes coordinator and workers with role labels.
- PromQL alert rules → Prometheus: evaluated by
- Prometheus → Alertmanager: forwards firing/resolved alerts
- Alertmanager → Slack webhook: routes webhook notifications
- Grafana → Prometheus: queries PromQL
- Presto dashboard → Grafana: imported by
- Presto coordinator → Prometheus SQL connector: loads catalog
- Prometheus SQL connector → Prometheus: queries metrics via SQL