Skip to main content

Monitoring gitGost

Monitor your gitGost instance to ensure healthy operation and detect issues early.

Health Check Endpoint

The /health endpoint provides service status and build information.

Check Service Health

Response:
The verify.github URL allows you to audit the exact source code running on the server. This ensures transparency and builds trust.

Health Check Integration

1

Add to monitoring dashboard

Configure your monitoring tool (Prometheus, Datadog, etc.) to poll /health every 30-60 seconds.
2

Set up alerts

Alert when:
  • /health returns non-200 status
  • Response time exceeds 5 seconds
  • Service becomes unreachable
3

Verify deployments

After deploying, check the deployedCommit matches your expected commit hash.

Metrics Endpoint

The /metrics endpoint exposes runtime metrics for performance monitoring.

Fetch Metrics

Response:

Key Metrics

High Memory Alert: If memory.alloc exceeds 500 MB consistently, investigate for memory leaks or consider scaling.

Service Status Endpoint

The /api/status endpoint shows if the panic button is active.
Response:
  • panic_mode: false → Service accepting pushes normally
  • panic_mode: true → Service suspended (panic button activated)

Logging System

GitGost uses privacy-focused logging that minimizes user data exposure.

Log Format

Configure log format via the LOG_FORMAT environment variable:

Text Format Logs

JSON Format Logs

Log Privacy Features

From internal/utils/logging.go:
  • No IP addresses logged in push operations
  • No user metadata captured or stored
  • Minimal context to prevent correlation attacks
  • All logs tagged with "privacy": "anonymized"
  • Logs focus on service health, not user activity
Privacy Notice: GitGost logs are designed to protect user anonymity. Do not add custom logging that captures IP addresses, user agents, or timing patterns that could deanonymize users.

Alert Configuration

1

Service Down

Trigger: /health endpoint returns non-200 or times outAction: Immediate investigation required
2

High Memory Usage

Trigger: memory.alloc > 500 MB for 5+ minutesAction: Check for memory leaks, restart if necessary
3

Panic Mode Activated

Trigger: /api/status returns panic_mode: trueAction: Administrator intervention required (abuse detected)
4

Rate Limit Exceeded

Trigger: Multiple rate limit alerts from ntfy admin notificationsAction: Review IP patterns, consider temporary panic mode

ntfy Admin Notifications

GitGost sends real-time alerts via ntfy when configured. Configure ntfy alerts:
Alert types:
  • Rate limit exceeded: Single IP exceeds 5 PRs/hour
  • Suspicious burst activity: 20+ pushes from 10+ IPs in 60 seconds
  • Service control: Action buttons to activate/deactivate panic mode
Subscribe to your admin topic on your phone using the ntfy app for instant push notifications:

Log Analysis Examples

Find Recent Errors

Count PR Creation Events

Monitor Fork Creation Rate

Deployment Verification

Verify deployments match the source code:
1

Fetch deployed commit

2

Compare with GitHub

3

Verify source transparency

Visit the GitHub verification URL:

Monitoring Best Practices

Production Monitoring Checklist

  • ✅ Health checks running every 30-60 seconds
  • ✅ Memory metrics tracked and alerted
  • ✅ Panic mode status monitored
  • ✅ ntfy admin notifications configured
  • ✅ Log aggregation set up (if using JSON format)
  • ✅ Uptime SLA tracking enabled
  • ✅ Deployment verification automated

Next Steps

Moderation

Learn how to moderate abuse and use the panic button

Troubleshooting

Diagnose and fix common operational issues