English
Integrations
Git Sync

Git Sync

Manage ReliaPulse configuration as code with Git version control.

Overview

Git Sync enables infrastructure-as-code workflows:

  • Store configuration in Git repositories
  • Version control all changes
  • Automate deployments via webhooks
  • Detect and manage configuration drift

Supported Providers

ProviderWebhook SupportAPI
GitHub
GitLab
Bitbucket
Generic GitManual only-

Setup

1. Create Configuration File

Create a YAML file in your repository:

# status-page.yaml
apiVersion: v1
kind: StatusPageConfig
metadata:
  name: production-config
  configVersion: "1.0.0"
 
spec:
  componentGroups:
    - name: Backend Services
      order: 1
    - name: Infrastructure
      order: 2
 
  components:
    - name: API Gateway
      type: SERVICE
      group: Backend Services
      status: operational
 
    - name: API Health Check
      type: ENDPOINT
      group: Backend Services
      url: https://api.example.com/health
      method: GET
      checkInterval: 60
      conditions:
        - type: STATUS_CODE
          comparator: EQUALS
          target: "200"
 
    - name: Database CPU
      type: METRIC
      group: Infrastructure
      integration: datadog-prod
      query: avg:aws.rds.cpuutilization{*}
      pollingInterval: 60
      warningThreshold: 70
      criticalThreshold: 90
 
  integrations:
    - name: datadog-prod
      type: DATADOG
      config:
        site: US1
        apiKey: ${DATADOG_API_KEY}
        appKey: ${DATADOG_APP_KEY}

2. Configure Git Sync

  1. Navigate to Settings > Git Sync
  2. Click "Configure"
  3. Fill in details:
FieldDescription
ProviderGitHub, GitLab, Bitbucket, Generic
Repository URLFull repository URL
BranchBranch to sync from
Config PathPath to YAML file
Auth MethodToken, SSH Key, or GitHub App
Auto SyncEnable webhook-triggered sync
  1. Save configuration

3. Set Up Webhook (Optional)

For automatic sync on push:

  1. Copy the Webhook URL shown after saving
  2. Copy the Webhook Secret
  3. In your Git provider, create a webhook:
    • URL: The webhook URL from ReliaPulse
    • Secret: The webhook secret
    • Events: Push events
    • Content-Type: application/json

Configuration Schema

Root Structure

apiVersion: v1
kind: StatusPageConfig
metadata:
  name: string          # Config name
  configVersion: string # Version identifier
 
spec:
  componentGroups: []   # Component group definitions
  components: []        # Component definitions
  integrations: []      # Integration definitions

Component Groups

componentGroups:
  - name: Backend Services
    order: 1
    description: Core backend infrastructure

Components

SERVICE Type

components:
  - name: API Gateway
    type: SERVICE
    group: Backend Services
    description: Main API routing
    status: operational

ENDPOINT Type

components:
  - name: Health Check
    type: ENDPOINT
    group: Backend Services
    url: https://api.example.com/health
    method: GET
    checkInterval: 60
    timeout: 5000
    headers:
      Authorization: Bearer ${API_TOKEN}
    conditions:
      - type: STATUS_CODE
        comparator: EQUALS
        target: "200"
      - type: RESPONSE_TIME
        comparator: LESS_THAN
        target: "1000"
    autoCreateIncident: true
    failureThreshold: 3

METRIC Type

components:
  - name: CPU Usage
    type: METRIC
    group: Infrastructure
    integration: datadog-prod
    query: avg:system.cpu.user{*}
    pollingInterval: 60
    warningThreshold: 70
    criticalThreshold: 90

Integrations

integrations:
  - name: datadog-prod
    type: DATADOG
    config:
      site: US1
      apiKey: ${DATADOG_API_KEY}
      appKey: ${DATADOG_APP_KEY}
 
  - name: prometheus-k8s
    type: PROMETHEUS
    config:
      url: https://prometheus.example.com
      username: ${PROMETHEUS_USER}
      password: ${PROMETHEUS_PASS}

Environment Variables

Reference environment variables with ${VAR_NAME}:

config:
  apiKey: ${DATADOG_API_KEY}
⚠️

Never commit secrets directly in YAML. Always use environment variables.

Set environment variables:

  1. In Docker: Add to .env file
  2. In Kubernetes: Use ConfigMaps/Secrets
  3. In CI/CD: Set in pipeline configuration

Syncing

Manual Sync

  1. Navigate to Settings > Git Sync
  2. Click "Sync Now"
  3. View sync results

Automatic Sync

With webhooks configured:

  1. Push changes to the configured branch
  2. Webhook triggers sync
  3. Configuration is applied automatically

Sync History

View past syncs:

  1. Navigate to Settings > Git Sync
  2. Scroll to "Sync History"
  3. See status, timestamp, and changes

Drift Detection

Detect resources not managed by config:

GET /api/v1/config/drift

Response:

{
  "totalResources": 15,
  "managedByConfig": 10,
  "manuallyCreated": 5,
  "drift": [
    {
      "resourceType": "component",
      "resourceName": "Manual Service",
      "reason": "not_in_config"
    }
  ]
}

Handling Drift

Options for unmanaged resources:

  1. Add to config - Include in YAML file
  2. Delete manually - Remove from UI
  3. Ignore - Leave as manual override

Validation

Validate config before applying:

POST /api/v1/config/validate
Content-Type: application/yaml
 
<yaml content>

Response:

{
  "valid": true,
  "warnings": [
    "Component 'API' references non-existent integration 'old-datadog'"
  ]
}

API Endpoints

EndpointDescription
POST /config/validateValidate YAML config
POST /config/applyApply config
GET /config/exportExport current config
GET /config/driftDetect drift
GET /config/git-syncGet sync config
POST /config/git-syncCreate sync config
PATCH /config/git-syncUpdate sync config
POST /config/git-sync/syncTrigger manual sync
GET /config/git-sync/historyGet sync history

Best Practices

Repository Structure

/
├── status-page.yaml       # Main config
├── .env.example           # Example env vars
└── scripts/
    └── validate.sh        # Pre-commit validation

Version Control

  1. Use branches - Test changes in feature branches
  2. Review changes - Pull request workflow
  3. Tag releases - Track configuration versions

CI/CD Integration

# .github/workflows/status-page.yml
name: ReliaPulse Config
 
on:
  push:
    branches: [main]
    paths: ['status-page.yaml']
 
jobs:
  validate:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Validate config
        run: |
          curl -X POST $STATUS_PAGE_URL/api/v1/config/validate \
            -H "Authorization: Bearer $API_KEY" \
            -H "Content-Type: application/yaml" \
            -d @status-page.yaml

Troubleshooting

Sync Failed

  1. Check webhook signature
  2. Verify repository access
  3. Validate YAML syntax
  4. Check environment variables

Validation Errors

  1. Check YAML syntax
  2. Verify required fields
  3. Check integration references
  4. Validate component types

Webhook Not Triggering

  1. Verify webhook URL is correct
  2. Check webhook secret matches
  3. Confirm push events enabled
  4. Review webhook delivery logs

Related Documentation