Monitoring & Observability
Tarasol uses a comprehensive monitoring stack for application performance, logging, and metrics collection across all microservices.
Stack Overview
| Tool | Purpose |
|---|---|
| Elastic APM | Application performance monitoring |
| Elasticsearch | Log aggregation and search |
| Winston | Structured logging framework |
| Prometheus | Metrics collection |
| Morgan | HTTP request logging |
Elastic APM
Every NestJS service includes the Elastic APM agent for:
- Transaction Tracing — End-to-end request tracking across services
- Error Tracking — Automatic error capture and alerting
- Performance Metrics — Response times, throughput, latency
Configuration
| Name | Type | Default | Description |
|---|---|---|---|
| ELASTIC_APM_SERVER_URL | string | - | APM Server URL |
| ELASTIC_APM_SERVICE_NAME | string | - | Service name for APM |
| ELASTIC_APM_SECRET_TOKEN | string | - | APM authentication token |
| ELASTIC_APM_ENVIRONMENT | string | production | Environment name |
Logging
All services use Winston with ECS (Elastic Common Schema) format:
// Logging configuration
{
format: winston.format.combine(
winston.format.timestamp(),
ecsFormat()
),
transports: [
new winston.transports.Console(),
new ElasticsearchTransport({
node: ELASTICSEARCH_URL
})
]
}
Log Levels
| Level | Usage |
|---|---|
error | Application errors, unhandled exceptions |
warn | Deprecation notices, retry attempts |
info | Request lifecycle, business events |
debug | Detailed diagnostic information |
Prometheus Metrics
Services expose metrics at /metrics endpoint:
http_request_duration_seconds— Request duration histogramhttp_requests_total— Total request counteractive_connections— Current active connectionsrabbitmq_messages_consumed— Messages consumed counter
Health Checks
Every service exposes /health with checks for:
- Database connectivity
- Redis connectivity
- RabbitMQ connectivity
- External service dependencies