Use Case Overview
Telemetry pipelines powered by Proton enable:- Real-time Log Analysis: Process application and system logs as they arrive
- Metrics Aggregation: Compute statistics and rollups for time-series data
- Distributed Tracing: Analyze request flows across microservices
- Alerting: Detect anomalies and trigger notifications
- SQL-based Observability: Query telemetry data using standard SQL
Why SQL-based Observability?
SQL-based Observability is growing in popularity due to:- Performance: ClickHouse-based solutions handle 300K+ logs/second vs 25K for ELK (Uber case study)
- Fast Aggregations: Columnar storage enables sub-second queries over billions of rows
- Familiar Interface: Use SQL instead of domain-specific query languages
- Real-time + Historical: Single system for both streaming and batch analytics
Architecture: Nginx Access Log Streaming
This tutorial demonstrates real-time analysis of Nginx access logs using Timeplus Proton.Deployment Options
Option 1: Simple (Development)Tutorial: Real-time Nginx Log Analysis
Setup: NFS-based Log Sharing
For production environments, share logs securely over NFS: On Nginx Server:Step 1: Create External Stream for Log Files
Proton can directly tail log files and parse timestamps:Step 2: Query Live Traffic
View logs in real-time:Step 3: Parse and Analyze Logs
Create a parsed view with structured fields:Step 4: Real-time Analytics
Request Rate by Method:Step 5: Windowed Aggregations
Compute metrics per time window:Alerting Patterns
High Error Rate Alert
Traffic Spike Detection
Slow Response Detection
Historical Analysis with CSV Import
For analyzing historical logs, convert and import them:Step 1: Convert Logs to CSV
Use a parser script to convert Nginx logs:Step 2: Create Historical Table
Step 3: Import CSV
Step 4: Historical Analytics
Error analysis:Geographic Analysis with IP Enrichment
Enrich logs with geographic data:Visualization with Grafana
Connect Proton to Grafana using the Timeplus Proton plugin:- Install the plugin in Grafana
- Configure data source pointing to Proton
- Create dashboards with real-time queries
- Requests per second:
SELECT count() FROM nginx_parsed - P95 Response Time:
SELECT quantile(0.95)(response_time) FROM nginx_parsed - Geographic Distribution: Join with IP geolocation table
Performance Tips
Materialize Frequently Queried Fields
Instead of parsing JSON in every query, create a materialized view:Use Appropriate Data Types
Next Steps
- Explore Feature Pipeline for ML feature computation
- Learn about Real-time ETL patterns
- Set up Change Data Capture for databases