bugsnag

package
v0.4.4 Latest Latest
Warning

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

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

Documentation

Overview

Package bugsnag implements the Bugsnag Data Access API connector. It populates `incidents` for repos whose Bugsnag project ID is mapped via `[connectors.bugsnag.projects]` in xray.toml.

Notes versus the canonical schema:

  • CulpritRef is emitted as the empty string. Bugsnag's top stack frame is not an exact equivalent of Sentry's culprit and is intentionally left blank rather than synthesised (spec rule: emit null where the source's native shape does not cleanly map).
  • AcknowledgedAt is left nil; Bugsnag has no native acknowledge concept.
  • DeployID and CommitSHA are left blank at extract time; the M10 wiring resolves them from ReleaseRef downstream.
  • Window filtering is by Bugsnag's `first_seen` field: only errors whose `first_seen` falls inside the configured window are emitted.

Index

Constants

View Source
const APIVersion = "2"

APIVersion is the value sent in the X-Version header per Bugsnag's API versioning scheme.

View Source
const DefaultBaseURL = "https://api.bugsnag.com"

DefaultBaseURL is the Bugsnag Data Access API base URL.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Token    string
	BaseURL  string
	Projects map[string]string
}

Config is the connector's input. BaseURL is exposed only for tests.

type Connector

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

Connector implements connector.Connector against the Bugsnag Data Access API. It populates `incidents`.

func New

func New(cfg config.BugsnagConn, log *slog.Logger) (*Connector, error)

New builds a Connector wired to the rate-limit transport.

func (*Connector) BudgetSnapshot added in v0.4.4

func (c *Connector) BudgetSnapshot() map[string]ratelimit.BudgetState

BudgetSnapshot returns the current rate-limit budget for this connector.

func (*Connector) Extract

func (c *Connector) Extract(
	ctx context.Context,
	repo connector.Repo,
	window connector.Window,
	sink connector.Sink,
) connector.Provenance

Extract pulls incidents for `repo` from every Bugsnag project mapped to this repo's slug in the connector's project map. Per-project errors are recorded but do not abort the overall extraction; provenance carries the per-project failure message.

func (*Connector) Name

func (c *Connector) Name() string

Name returns the stable connector name used in `source` columns and the manifest's `extraction_provenance` entries.

func (*Connector) Ping

func (c *Connector) Ping(ctx context.Context) error

Ping verifies the configured token by calling GET /user. 401 is a fatal authentication failure; other non-2xx responses are surfaced verbatim so the caller can log the upstream status.

Jump to

Keyboard shortcuts

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