Skip to Content
🚀 APSO is now in public beta. Get started →
ManageMonitoring

Monitoring & Logs

APSO provides built-in monitoring and logging to help you understand your service’s performance and diagnose issues.

Logs

Accessing Logs

From the dashboard:

  1. Navigate to your service
  2. Click the Logs tab
  3. View real-time log stream

Log Levels

LevelDescriptionColor
debugDetailed debugging infoGray
infoGeneral informationBlue
warnWarningsYellow
errorErrorsRed

Filtering Logs

Filter by:

  • Level — Show only specific log levels
  • Time Range — Last hour, day, week, or custom
  • Search — Full-text search in log messages
# Example searches "POST /api/v1/projects" error userId:user-123 statusCode:500

Log Format

Each log entry includes:

{ "timestamp": "2024-01-15T10:30:00.000Z", "level": "info", "message": "Request completed", "context": { "method": "POST", "path": "/api/v1/projects", "statusCode": 201, "duration": 45, "userId": "user-123", "organizationId": "org-456" } }

Downloading Logs

  1. Set your desired filters
  2. Click Download
  3. Choose format (JSON or CSV)
  4. Logs are downloaded for the selected time range

Log Retention

PlanRetention
Free7 days
Pro30 days
Enterprise90 days

Metrics

Service Metrics

Available metrics in the dashboard:

MetricDescription
Request RateRequests per minute
Error RatePercentage of 4xx/5xx responses
LatencyResponse time (p50, p95, p99)
Active ConnectionsCurrent open connections

Database Metrics

MetricDescription
Query CountQueries per minute
Query DurationAverage query time
Connection PoolActive/idle connections
Database SizeStorage used

Viewing Metrics

  1. Navigate to your service
  2. Click the Metrics tab
  3. Select time range
  4. Choose metrics to display

Metric Time Ranges

  • Last hour
  • Last 24 hours
  • Last 7 days
  • Last 30 days
  • Custom range

Alerts

Setting Up Alerts

  1. Navigate to Settings > Alerts
  2. Click Create Alert
  3. Configure:
    • Metric — What to monitor
    • Condition — Threshold
    • Duration — How long before alerting
    • Channel — Where to send alerts

Alert Types

AlertTrigger
High Error RateError rate > 5% for 5 minutes
High Latencyp95 latency > 1s for 5 minutes
Service DownNo responses for 1 minute
Database IssuesConnection failures

Notification Channels

  • Email — Send to team members
  • Slack — Post to a channel
  • Webhook — Custom HTTP endpoint
  • PagerDuty — Incident management

Example Alert Configuration

{ "name": "High Error Rate", "metric": "error_rate", "condition": { "operator": ">", "threshold": 0.05 }, "duration": "5m", "channels": ["slack-ops", "email-team"] }

Health Checks

Endpoint

GET /health

Response

{ "status": "healthy", "version": "1.2.0", "uptime": 86400, "checks": { "database": "connected", "redis": "connected", "memory": "ok" } }

Status Values

StatusDescription
healthyAll systems operational
degradedSome issues, partial functionality
unhealthyCritical issues

Custom Health Checks

Add custom checks in your extensions:

// src/extensions/health/custom.health.ts import { Injectable } from '@nestjs/common'; import { HealthIndicator, HealthCheckResult } from '@nestjs/terminus'; @Injectable() export class CustomHealthIndicator extends HealthIndicator { async check(key: string): Promise<HealthCheckResult> { // Your custom health check logic const isHealthy = true; return this.getStatus(key, isHealthy); } }

Performance Optimization

Identifying Slow Requests

  1. View Metrics > Latency chart
  2. Click on spike to see affected requests
  3. Check logs for those requests
  4. Identify slow database queries or external calls

Common Performance Issues

IssueSymptomSolution
N+1 QueriesSlow list endpointsUse include option
Missing IndexSlow filtered queriesAdd database index
Large PayloadSlow responsesImplement pagination
Memory LeakIncreasing latencyCheck for memory issues

Query Analysis

Enable query logging to identify slow queries:

.apsorc
{ "database": { "logging": ["query", "slow"] } }

External Integrations

Log Forwarding

Forward logs to external services:

  1. Go to Settings > Integrations
  2. Add log destination:
    • Datadog
    • Papertrail
    • Logtail
    • Custom Webhook

APM Integration

Connect to Application Performance Monitoring:

  • Datadog APM
  • New Relic
  • Sentry

Example: Datadog Integration

# Set environment variables DD_API_KEY=your-datadog-api-key DD_SITE=datadoghq.com DD_SERVICE=my-apso-service

Debugging

Enable Debug Mode

For detailed logs:

DEBUG=apso:* npm run dev

Database Query Logging

.apsorc
{ "database": { "logging": true } }

Request Tracing

Each request includes a trace ID:

X-Request-Id: abc123

Use this to trace a request through logs:

# Search logs by request ID requestId:abc123
Last updated on