Skip to main content

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

ComponentTechnology
API frameworkFastAPI 0.116+
DatabaseMongoDB (via Motor async driver)
CacheRedis 6+
Message queueRabbitMQ (via aio-pika)
Data validationPydantic v2
Chart generationPlotly + Kaleido
RuntimePython 3.11+, Uvicorn

Service endpoints at a glance

ResourceBase 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/

Build docs developers (and LLMs) love