Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] feat: add opsgenie to migrator script #5495

Draft
wants to merge 5 commits into
base: dev
Choose a base branch
from

Conversation

joeyorlando
Copy link
Contributor

@joeyorlando joeyorlando commented Mar 12, 2025

This PR adds support for migrating data from OpsGenie to Grafana IRM.

Closes https://github.com/grafana/irm/issues/1179

Features Added

  • Migration of OpsGenie resources:
    • User notification rules
    • On-call schedules (with rotations and time restrictions)
    • Escalation policies
    • Integrations
  • User migration script support for OpsGenie
  • Comprehensive test coverage for all migration components

Implementation Details

  1. Core Migration Logic:

    • Schedule migration with support for daily, weekly, and hourly rotations
    • Escalation policy migration with proper delay handling
    • Integration migration with support for common integration types
    • User notification rules migration
  2. User Migration Support:

    • Added OpsGenie user migration to add_users_to_grafana.py
    • Support for both default and EU OpsGenie instances
    • Automatic user creation with random passwords
    • Proper error handling for existing users
  3. Testing:

    • Unit tests for matching logic (test_matching.py)
    • Unit tests for migration functions (test_migrate.py)
    • Unit tests for report formatting (test_report.py)
    • Unit tests for user migration (test_user_migration.py)
  4. Documentation:

    • Updated README with OpsGenie-specific instructions
    • Added configuration options documentation
    • Included user migration guide
    • Added limitations and caveats

Configuration Options Added

  • OPSGENIE_API_KEY: API key for OpsGenie access
  • OPSGENIE_API_URL: API URL with support for EU instances
  • OPSGENIE_FILTER_*: Various filtering options for selective migration
  • PRESERVE_EXISTING_USER_NOTIFICATION_RULES: Option to preserve existing rules

Testing Done

  • Unit tests for all major components
  • Integration tests for API interactions
  • Error handling verification
  • Edge case testing for various resource types

Documentation Updates

  • Added OpsGenie section to main README
  • Documented all new environment variables
  • Added user migration instructions
  • Included supported integration types
  • Added limitations and caveats section

@joeyorlando joeyorlando requested a review from a team as a code owner March 12, 2025 02:07
@joeyorlando joeyorlando marked this pull request as draft March 12, 2025 16:41
@joeyorlando joeyorlando changed the title feat: add opsgenie to migrator script [WIP] feat: add opsgenie to migrator script Mar 12, 2025
@joeyorlando
Copy link
Contributor Author

note. very much still a draft. playing around with Cursor to see what it is capable of.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant