opsgenie

package
v0.14.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 20, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

README

OpsGenie

Extract service and incident metadata from OpsGenie using the OpsGenie REST API.

Usage

source:
  name: opsgenie
  scope: my-opsgenie
  config:
    api_key: your-api-key
    base_url: https://api.opsgenie.com
    exclude:
      - service-id-to-skip

Configuration

Key Type Required Description
api_key string Yes OpsGenie API key for authentication.
base_url string No OpsGenie API base URL. Defaults to https://api.opsgenie.com.
exclude []string No Service IDs to exclude from extraction.

Note: For EU instances, set base_url: https://api.eu.opsgenie.com.

Entities

The extractor emits two entity types and their relationships as edges.

Entity: service
Field Sample Value
urn urn:opsgenie:my-opsgenie:service:abc-123
name Payment Service
description Handles payment processing
properties.description Handles payment processing
properties.team_id team-456
properties.html_url https://app.opsgenie.com/service/abc-123
Entity: incident
Field Sample Value
urn urn:opsgenie:my-opsgenie:incident:inc-789
name Database connection timeout
properties.status open
properties.priority P1
properties.created_at 2024-01-15T10:30:00Z
properties.resolved_at 2024-01-15T11:00:00Z
properties.html_url https://app.opsgenie.com/incident/detail/inc-789
properties.message Database connection timeout
properties.tags ["database", "critical"]
properties.owner_id team-456
Edges
Type Source Target Description
owned_by service team Service is owned by a team
belongs_to incident service Incident impacts a service

Contributing

Refer to the contribution guidelines for information on contributing to this module.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client wraps the OpsGenie REST API v1.

func NewClient

func NewClient(baseURL, apiKey string) *Client

NewClient creates a new OpsGenie API client.

func (*Client) ListIncidents

func (c *Client) ListIncidents(ctx context.Context) ([]Incident, error)

ListIncidents returns all OpsGenie incidents using offset pagination.

func (*Client) ListServices

func (c *Client) ListServices(ctx context.Context) ([]Service, error)

ListServices returns all OpsGenie services using offset pagination.

type Config

type Config struct {
	APIKey  string   `json:"api_key" yaml:"api_key" mapstructure:"api_key" validate:"required"`
	BaseURL string   `json:"base_url" yaml:"base_url" mapstructure:"base_url" validate:"omitempty,url"`
	Exclude []string `json:"exclude" yaml:"exclude" mapstructure:"exclude"`
}

type Extractor

type Extractor struct {
	plugins.BaseExtractor
	// contains filtered or unexported fields
}

func New

func New(logger log.Logger) *Extractor

func (*Extractor) Extract

func (e *Extractor) Extract(ctx context.Context, emit plugins.Emit) error

func (*Extractor) Init

func (e *Extractor) Init(ctx context.Context, config plugins.Config) error

type Incident

type Incident struct {
	ID               string   `json:"id"`
	Message          string   `json:"message"`
	Status           string   `json:"status"`
	Priority         string   `json:"priority"`
	CreatedAt        string   `json:"createdAt"`
	ResolvedAt       string   `json:"resolvedAt"`
	Tags             []string `json:"tags"`
	ImpactedServices []string `json:"impactedServices"`
	OwnerTeam        string   `json:"ownerTeam"`
}

Incident represents an OpsGenie incident.

type Service

type Service struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
	TeamID      string `json:"teamId"`
}

Service represents an OpsGenie service.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL