Documentation
¶
Overview ¶
Package sentry provides Console status providers backed by Sentry's API. Provider reports the health of a Sentry project from its current unresolved issue count (GET /api/0/projects/{org}/{project}/issues/?query=is:unresolved). The count is accurate up to one page (100) and saturates beyond that.
It satisfies the status.Provider interface structurally (Name + Check), so it does not import the status package and adds no coupling beyond core.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*Provider)
Option configures a Provider.
func WithBaseURL ¶
WithBaseURL overrides the Sentry API base URL (testing / self-hosted).
func WithHTTPClient ¶
WithHTTPClient sets the HTTP client.
type Provider ¶
type Provider struct {
// Token is the default Sentry auth token, used when a component does not set
// "auth_token". Typically sourced from the SENTRY_AUTH_TOKEN env var.
Token string
// BaseURL is the Sentry API base URL; defaults to Sentry's. Overridable for
// testing or a self-hosted instance.
BaseURL string
// HTTP issues the API request. If nil, a client with a sane timeout is used.
HTTP *http.Client
}
Provider checks a Sentry project's health from its unresolved issue count. The number of currently unresolved issues maps to a health state.
It reads its target from core.Component.Config:
org required; the Sentry organization slug project required; the Sentry project slug auth_token optional; overrides the provider's default token degraded_count optional; issue count at/above which state is degraded (default 1) down_count optional; issue count at/above which state is down (default 10) timeout optional; API call timeout as a Go duration, default "10s"
State mapping (count = number of currently unresolved issues, capped at 100):
count < degraded_count -> StateOperational degraded_count <= count < down_count -> StateDegraded count >= down_count -> StateDown API/network failure or non-2xx -> StateDown no org / project / token -> StateUnknown (configuration gap)