#!/bin/bash
# OpenAccess MCP Monitoring Stack Quick Start
# This script sets up and starts the complete monitoring stack
set -e
echo "๐ Starting OpenAccess MCP Monitoring Stack..."
# Check if Docker is running
if ! docker info > /dev/null 2>&1; then
echo "โ Docker is not running. Please start Docker and try again."
exit 1
fi
# Check if Docker Compose is available
if ! command -v docker-compose &> /dev/null; then
echo "โ Docker Compose is not installed. Please install it and try again."
exit 1
fi
# Create necessary directories
echo "๐ Creating directories..."
mkdir -p grafana/dashboards
mkdir -p grafana/provisioning/datasources
mkdir -p rules
# Copy configuration files if they don't exist
if [ ! -f "prometheus.yml" ]; then
echo "โ prometheus.yml not found. Please ensure you're in the monitoring directory."
exit 1
fi
# Start the monitoring stack
echo "๐ณ Starting monitoring services..."
docker-compose up -d
# Wait for services to be ready
echo "โณ Waiting for services to start..."
sleep 10
# Check service status
echo "๐ Checking service status..."
docker-compose ps
# Display access information
echo ""
echo "โ Monitoring stack is running!"
echo ""
echo "๐ Access your monitoring tools:"
echo " โข Prometheus: http://localhost:9090"
echo " โข Grafana: http://localhost:3000 (admin/admin123)"
echo " โข Alertmanager: http://localhost:9093"
echo ""
echo "๐ Next steps:"
echo " 1. Open Grafana at http://localhost:3000"
echo " 2. Login with admin/admin123"
echo " 3. Import the dashboard: grafana/dashboards/openaccess-mcp-overview.json"
echo " 4. Configure your OpenAccess MCP server to expose metrics at /metrics"
echo ""
echo "๐ To stop the monitoring stack:"
echo " docker-compose down"
echo ""
echo "๐ For more information, see MONITORING.md"