Skip to content

Collect Response Metrics on kernel.response instead of kernel.terminate resolves #130 #70

Collect Response Metrics on kernel.response instead of kernel.terminate resolves #130

Collect Response Metrics on kernel.response instead of kernel.terminate resolves #130 #70

---
name: Grafana Integration Screenshots
on:
pull_request:
branches: [master]
paths:
- 'grafana/**'
- 'demo/**'
- '.github/workflows/grafana-integration.yml'
push:
branches: [master]
paths:
- 'grafana/**'
- 'demo/**'
- '.github/workflows/grafana-integration.yml'
workflow_dispatch:
jobs:
grafana-integration:
runs-on: ubuntu-latest
name: Generate Grafana Dashboard Screenshots
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Set up Node.js for Playwright
uses: actions/setup-node@v4
with:
node-version: '18'
- name: Install Playwright dependencies
run: |
npm install
# Install Playwright deps + Chromium
npm run test:e2e:install-deps
npm run test:e2e:install:chromium
working-directory: e2e
- name: Start Docker services
run: |
docker compose up -d --build
# Wait for services to be healthy using healthchecks
echo "Waiting for services to be ready..."
sleep 45
# Check service status
echo "=== Docker Services Status ==="
docker compose ps
echo "=== Service Logs ==="
docker compose logs --tail=30
# Test service connectivity with more retries
echo "=== Testing Service Connectivity ==="
for i in {1..15}; do
echo "Attempt $i/15..."
if curl -s http://localhost:8080/ > /dev/null; then
echo "✓ Symfony app is responding"
break
else
echo "⚠ Symfony app not ready yet..."
sleep 5
fi
done
for i in {1..15}; do
echo "Attempt $i/15..."
if curl -s http://localhost:9090/-/ready > /dev/null; then
echo "✓ Prometheus is ready"
break
else
echo "⚠ Prometheus not ready yet..."
sleep 5
fi
done
# Wait for Grafana to be ready
for i in {1..15}; do
echo "Attempt $i/15..."
if curl -s http://localhost:3000/api/health > /dev/null; then
echo "✓ Grafana health API is ready"
break
else
echo "⚠ Grafana not ready yet..."
sleep 5
fi
done
working-directory: demo
- name: Verify Prometheus is collecting metrics
run: |
echo "Checking Prometheus metrics..."
curl -s "http://localhost:9090/api/v1/query?query=symfony_http_requests_total" | jq '.' || true
echo "Checking if Grafana can reach Prometheus..."
curl -s "http://localhost:3000/api/datasources/proxy/1/api/v1/query?query=up" | head -20 || true
- name: Capture live dashboard screenshots (Playwright)
run: |
echo "Capturing screenshots with Playwright - 5 minute time range and 5 second refresh..."
npm run test:e2e:chromium
working-directory: e2e
- name: Verify screenshots were created
run: |
ls -la screenshots/
file screenshots/*.png
working-directory: e2e
- name: Stop Docker services
run: |
docker compose down
docker compose logs --tail=50 || true
working-directory: demo
- name: Upload screenshots as artifacts
uses: actions/upload-artifact@v4
if: always()
with:
name: grafana-dashboard-screenshots-playwright
path: e2e/screenshots/
retention-days: 30
- name: Upload playwright report as artifacts
uses: actions/upload-artifact@v4
if: always()
with:
name: grafana-dashboard-screenshots-playwright-report
path: e2e/playwright-report/
retention-days: 30
- name: Upload playwright test results as artifacts
uses: actions/upload-artifact@v4
if: always()
with:
name: grafana-dashboard-screenshots-playwright-test-results
path: e2e/test-results/
retention-days: 30
- name: Upload service logs for debugging
uses: actions/upload-artifact@v4
if: failure()
with:
name: service-logs-playwright
path: demo/
retention-days: 7