Indicator Service
The Indicator Service is a high-performance REST API microservice built with FastAPI, MongoDB, and Redis. It provides comprehensive management of tourism indicators organized in a domain/subdomain hierarchy, with real-time data ingestion via RabbitMQ.Quickstart
Get the service running locally in minutes
Architecture
Understand the system design and components
API Reference
Explore all available endpoints
Configuration
Configure the service for your environment
What is the Indicator Service?
The Indicator Service manages tourism performance indicators — quantitative and qualitative metrics organized by domain (e.g., Accommodation, Transport) and subdomain (e.g., Hotels, Airlines). It handles the full lifecycle of each indicator:- Storage — Persists indicator definitions and time-series data in MongoDB
- Ingestion — Consumes data segments from external producers via RabbitMQ
- Caching — Serves frequently requested data from Redis with smart cache population
- Aggregation — Computes statistics and aggregates data across configurable time windows
- Export — Generates PNG chart images using Plotly
Key features
Domain hierarchy
Organize indicators under domains and subdomains with full CRUD support
Time-series data
Store and query time-series data points with flexible aggregation methods
Smart caching
Redis-backed cache with miss-threshold promotion and automatic invalidation
Message queue ingestion
Asynchronous data ingestion from RabbitMQ producers
Rich statistics
Descriptive statistics including mean, median, percentiles, and trend analysis
Chart export
Export indicator charts as PNG images using Plotly and Kaleido
Annotations
Attach contextual notes and annotations to any indicator
Full-text search
Search indicators by name with domain, subdomain, and governance filters
Technology stack
| Component | Technology |
|---|---|
| API framework | FastAPI 0.116+ |
| Database | MongoDB (via Motor async driver) |
| Cache | Redis 6+ |
| Message queue | RabbitMQ (via aio-pika) |
| Data validation | Pydantic v2 |
| Chart generation | Plotly + Kaleido |
| Runtime | Python 3.11+, Uvicorn |
Service endpoints at a glance
| Resource | Base path |
|---|---|
| Indicators | /indicators/ |
| Domains | /domains/ |
| Data points | /indicators/{id}/data |
| Statistics | /indicators/{id}/statistics |
| Annotations | /indicators/{id}/annotations |
| Chart export | /indicators/{id}/export/image |
| Health check | /health/ |